Răsfoiți Sursa

disable ESlint warning

Ramona Plogmann 4 ani în urmă
părinte
comite
b33ee5bfb7

+ 1 - 1
client/src/components/Meals/EditMealCore.jsx

@@ -39,7 +39,7 @@ const EditMealCore = (props) => {
     isSecondary,
   } = props;
 
-  const colorA = isSecondary ? "primary" : "secondary";
+  // const colorA = isSecondary ? "primary" : "secondary";
   const colorB = isSecondary ? "secondary" : "primary";
 
   const [, updateState] = React.useState();

+ 1 - 0
client/src/components/Meals/Meals.jsx

@@ -43,6 +43,7 @@ const Meals = (props) => {
 
   useEffect(() => {
     fetchAndUpdateMeals();
+    // eslint-disable-next-line
   }, [userId]);
 
   const openMealDetailView = (meal) => {

+ 0 - 2
client/src/components/Plans/EditPlanItemCore.jsx

@@ -79,8 +79,6 @@ const useStyles = makeStyles((theme) => ({
   }
 }));
 
-const serverURL = process.env.REACT_APP_SERVER_URL;
-
 /** component is used by AddPlanItem and EditPlanItem and provides their shared input elements
  *  Does not handle communication to server */
 const EditPlanItemCore = (props) => {

+ 1 - 1
client/src/components/Plans/Plans.jsx

@@ -7,7 +7,6 @@ import { makeStyles } from "@material-ui/styles";
 import EditPlanItem from "./EditPlanItem";
 import { useTranslation } from "react-i18next";
 import MealDetailView from "../Meals/MealDetailView";
-import Loading from "../Loading";
 import { bool, string } from "prop-types";
 import { dateStringOptions, withLoginRequired } from "../util";
 import MissingIngredients from "./MissingIngredients";
@@ -80,6 +79,7 @@ const Plans = (props) => {
     });
   }
 
+  // eslint-disable-next-line
   useEffect(fetchAndUpdatePlans, [userId]);
 
   const openMealDetailView = (meal) => {

+ 2 - 0
client/src/components/Plans/ShoppingList.jsx

@@ -63,6 +63,7 @@ const ShoppingList = (props) => {
     } else {
       setPlans(plansFromProps);
     }
+    // eslint-disable-next-line
   }, [plansFromProps]);
 
   useEffect(() => {
@@ -82,6 +83,7 @@ const ShoppingList = (props) => {
       });
       forceUpdate();
     }
+    // eslint-disable-next-line
   }, [plans]);
 
   const checkOrUncheck = (ingredient, planId) => {

+ 1 - 1
client/src/components/Settings/EditProfile.jsx

@@ -81,7 +81,7 @@ const EditProfile = (props) => {
   const { userData, onUpdateUser, isSecondary, open, closeDialog } = props;
 
   const colorA = isSecondary ? "primary" : "secondary";
-  const colorB = isSecondary ? "secondary" : "primary";
+  // const colorB = isSecondary ? "secondary" : "primary";
 
   const {
     user_metadata: metadata,

+ 1 - 3
client/src/components/Settings/Profile.jsx

@@ -7,8 +7,6 @@ import CircleImage from "../Images/CircleImage";
 import { muiTableBorder } from "../util";
 import { Box, Dialog, Table, TableBody, TableCell, TableContainer, TableRow, Typography } from "@material-ui/core";
 
-const serverURL = process.env.REACT_APP_SERVER_URL;
-
 const useStyles = makeStyles(theme => ({
   imageWrapper: {
     width: '8rem',
@@ -51,7 +49,7 @@ const Profile = (props) => {
       </Box>
 
       <Dialog open={isImageZoomed} onClose={() => setIsImageZoomed(false)}>
-        <img src={metadata.picture || userData.picture} alt={`profile picture of ${name}`} />
+        <img src={metadata.picture || userData.picture} alt={name} />
       </Dialog>
 
       <TableContainer className={classes.table}>

+ 3 - 2
client/src/components/Settings/Settings.jsx

@@ -50,11 +50,12 @@ const Settings = (props) => {
   const { palette } = theme;
 
   const [userData, setUserData] = useState(null);
-  const [settings, setSettings] = useState(null);
+  const [/*settings*/, setSettings] = useState(null); // settings is not currently used because settings are better fetched from other place but might be necessary in the future
   const [editDialogOpen, setEditDialogOpen] = useState(false);
 
   useEffect(() => {
     getUser();
+    // eslint-disable-next-line
   }, [user]);
 
   const getUser = () => {
@@ -78,7 +79,7 @@ const Settings = (props) => {
     }
   }
 
-  useEffect(getSettings, []);
+  useEffect(getSettings, [user]);
 
   function updateLanguageInUserMetadata(lng) {
     if (user) {

+ 1 - 1
client/src/components/Social/ContactsContent.jsx

@@ -64,7 +64,7 @@ const ContactsContent = () => {
           <Navbar pageTitle={getContactName(otherUser)} titleOnClick={() => {setIsContactProfileOpen(true);}} leftSideComponent={leftSideComponent()} />
 
           <Dialog open={isContactProfileOpen} onClose={() => setIsContactProfileOpen(false)}>
-            <img src={getContactPicture(otherUser)} alt={`profile picture of ${getContactName(otherUser)}`} />
+            <img src={getContactPicture(otherUser)} alt={getContactName(otherUser)} />
           </Dialog>
 
           {getTabs()}

+ 4 - 4
client/src/components/Social/FriendOrUnfriendButton.jsx

@@ -54,15 +54,15 @@ const FriendOrUnfriendButton = (props) => {
   }
 
   useEffect(() => {
-    if(!givenContacts) fetchContacts();
-  }, [user]);
+    if (!givenContacts) fetchContacts();
+  }, [user]); // eslint-disable-line
 
   useEffect(() => {
     if (contacts && user) {
       setIsContact(contacts.some(c => c.user_id === otherUser.user_id));
       if (!checkedIsContact) setCheckedIsContact(true);
     }
-  }, [user, contacts]);
+  }, [user, contacts]); // eslint-disable-line
 
   const addFriend = () => {
     const newFriends = contacts;
@@ -78,7 +78,7 @@ const FriendOrUnfriendButton = (props) => {
   if (!checkedIsContact) return null;
 
   return (
-    <IconButton edge="end" className={(props.inNavbar)?classes.iconButtonInNavbar:''} onClick={() => isContact ? removeFriend() : addFriend()}>
+    <IconButton edge="end" className={(props.inNavbar) ? classes.iconButtonInNavbar : ''} onClick={() => isContact ? removeFriend() : addFriend()}>
       {isContact
         ? <PersonAddDisabled className={classes.removeFriend} />
         : <PersonAdd className={classes.addFriend} />}

+ 1 - 0
client/src/components/Social/Social.jsx

@@ -46,6 +46,7 @@ const Social = () => {
 
   useEffect(() => {
     fetchContacts();
+    // eslint-disable-next-line
   }, [])
 
   const showUser = (userId) => {

+ 1 - 0
client/src/components/Social/UserSearch.jsx

@@ -109,6 +109,7 @@ const UserSearch = (props) => {
 
   useEffect(() => {
     getUsers();
+    // eslint-disable-next-line
   }, [query]);
 
   const getListItems = () => {

+ 1 - 1
client/src/components/util/CircularProgressWithLabel.jsx

@@ -12,7 +12,7 @@ export default function CircularProgressWithLabel(props) {
       setCurrentValue(currentValue => currentValue === 0 ? currentValue : currentValue - step);
     }, 1000);
     return () => clearInterval(interval);
-  }, []);
+  }, [step]);
 
   return (
     <Box position="relative" display="inline-flex" style={{alignSelf: 'center'}}>

+ 4 - 1
client/src/translations/de.translation.json

@@ -58,5 +58,8 @@
   "Logged in via {{provider}}": "Über {{provider}} eingeloggt",
   "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.": "Weil Sie mit Ihrem {{provider}}-Konto eingeloggt sind, können Sie Ihre Daten hier nicht ändern. Sie können stattdessen die Daten direkt in Ihrem {{provider}}-Konto ändern und sie werden beim nächsten Login übernommen.",
   "You can, however, set a custom profile picture and nickname.": "Sie können allerdings ein eigenes Profilbild hochladen und einen Spitznamen wählen.",
-  "Use dark mode?": "Dunkler Modus"
+  "Use dark mode?": "Dunkler Modus",
+  "Missing Ingredients": "Fehlende Zutaten",
+  "List is currently empty": "Die Liste ist derzeit leer",
+  "Without Date": "Ohne Datum"
 }

+ 4 - 1
client/src/translations/en-GB.translation.json

@@ -57,5 +57,8 @@
   "Logged in via {{provider}}": "Logged in via {{provider}}",
   "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.": "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.",
   "You can, however, set a custom profile picture and nickname.": "You can, however, set a custom profile picture and nickname.",
-  "Use dark mode?": "Use dark mode?"
+  "Use dark mode?": "Use dark mode?",
+  "Missing Ingredients": "Missing Ingredients",
+  "List is currently empty": "List is currently empty",
+  "Without Date": "Without Date"
 }

+ 4 - 1
client/src/translations/en-US.translation.json

@@ -57,5 +57,8 @@
   "Logged in via {{provider}}": "Logged in via {{provider}}",
   "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.": "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.",
   "You can, however, set a custom profile picture and nickname.": "You can, however, set a custom profile picture and nickname.",
-  "Use dark mode?": "Use dark mode?"
+  "Use dark mode?": "Use dark mode?",
+  "Missing Ingredients": "Missing Ingredients",
+  "List is currently empty": "List is currently empty",
+  "Without Date": "Without Date"
 }

+ 4 - 1
client/src/translations/es.translation.json

@@ -57,5 +57,8 @@
   "Logged in via {{provider}}": "Inició la sesión a través de {{provider}}",
   "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.": "Como has iniciado sesión a través de tu cuenta de {{provider}}, no puedes cambiar tus datos aquí. Puedes cambiar los datos directamente en tu cuenta de {{provider}} y se adoptarán en el siguiente inicio de sesión.",
   "You can, however, set a custom profile picture and nickname.": "Sin embargo, puedes establecer una imagen de perfil personalizada tanto como un apodo.",
-  "Use dark mode?": "Modo oscuro"
+  "Use dark mode?": "Modo oscuro",
+  "Missing Ingredients": "Ingredientes faltantes",
+  "List is currently empty": "La lista está actualmente vacía",
+  "Without Date": "Sin fecha"
 }

+ 4 - 1
client/src/translations/fr-FR.translation.json

@@ -57,5 +57,8 @@
   "Logged in via {{provider}}": "Connecté via {{provider}}",
   "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.": "Comme vous êtes connecté via votre compte {{provider}}, vous ne pouvez pas modifier vos données ici. Vous pouvez modifier les données directement dans votre compte {{provider}} et elles seront adoptées lors de la prochaine connexion.",
   "You can, however, set a custom profile picture and nickname.": "Vous pouvez toutefois définir une photo de profil et un surnom personnalisés.",
-  "Use dark mode?": "mode sombre"
+  "Use dark mode?": "mode sombre",
+  "Missing Ingredients": "Ingrédients manquants",
+  "List is currently empty": "La liste est actuellement vide",
+  "Without Date": "Sans date"
 }

+ 4 - 1
client/src/translations/it.translation.json

@@ -57,5 +57,8 @@
   "Logged in via {{provider}}": "Registrato tramite {{provider}}",
   "Since you are logged in via your {{provider}} account, you cannot change your data here. You can change the data directly in your {{provider}} account and it will be adopted on the next login.": "Dato che sei collegato tramite il tuo account {{provider}}, non puoi cambiare i tuoi dati qui. Puoi cambiare i dati direttamente nel tuo account {{provider}} e saranno adottati al prossimo login.",
   "You can, however, set a custom profile picture and nickname.": "Puoi, tuttavia, impostare un'immagine di profilo personalizzata e un soprannome.",
-  "Use dark mode?": "modo scuro"
+  "Use dark mode?": "modo scuro",
+  "Missing Ingredients": "Ingredienti mancanti",
+  "List is currently empty": "La lista è attualmente vuota",
+  "Without Date": "Senza Data"
 }