Bladeren bron

Minor fixes

Jeremie Pardou-Piquemal 2 jaren geleden
bovenliggende
commit
23de323d33
3 gewijzigde bestanden met toevoegingen van 17 en 17 verwijderingen
  1. 1 7
      src/components/mediaLibrary/ImageDropNPaste.jsx
  2. 8 5
      src/views/GameView.jsx
  3. 8 5
      src/views/Session.jsx

+ 1 - 7
src/components/mediaLibrary/ImageDropNPaste.jsx

@@ -70,13 +70,7 @@ const ImageDropNPaste = ({ children }) => {
   }, [onPaste]);
 
   return (
-    <div
-      {...getRootProps()}
-      style={{
-        position: "fixed",
-        inset: 0,
-      }}
-    >
+    <div {...getRootProps()}>
       {children}
       {uploading && <Waiter message={t("Uploading image(s)...")} />}
     </div>

+ 8 - 5
src/views/GameView.jsx

@@ -97,16 +97,19 @@ export const GameView = ({ create = false }) => {
 
   const itemLibraries = [
     {
-      name: "Standard",
+      name: t("Standard"),
       key: "standard",
       items: itemLibrary,
     },
-    {
-      name: "Box",
+  ];
+
+  if (availableItems.length) {
+    itemLibraries.push({
+      name: t("Box"),
       key: "box",
       items: availableItemLibrary,
-    },
-  ];
+    });
+  }
 
   const mediaLibraries = React.useMemo(() => {
     return [{ id: "game", name: t("Game"), boxId: "game", resourceId: gameId }];

+ 8 - 5
src/views/Session.jsx

@@ -106,16 +106,19 @@ export const Session = () => {
 
   const itemLibraries = [
     {
-      name: "Standard",
+      name: t("Standard"),
       key: "standard",
       items: itemLibrary,
     },
-    {
-      name: "Box",
+  ];
+
+  if (availableItems.length) {
+    itemLibraries.push({
+      name: t("Box"),
       key: "box",
       items: availableItemLibrary,
-    },
-  ];
+    });
+  }
 
   const mediaLibraries = React.useMemo(() => {
     if (gameId) {