Skip to content

Commit

Permalink
Merge pull request #1859 from hackforla/1857-fix-console-warnings
Browse files Browse the repository at this point in the history
Fix console warnings
  • Loading branch information
VirginiaWu11 authored Oct 10, 2023
2 parents e0fa428 + 50647a9 commit a846201
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 117 deletions.
8 changes: 0 additions & 8 deletions client/src/components/Admin/OrganizationEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ import Verification from "./OrganizationEdit/Verification";
import Label from "./ui/Label";
import Textarea from "./ui/Textarea";

const HourSchema = Yup.object().shape({
weekOfMonth: Yup.number().required("Interval is required"),
dayOfWeek: Yup.string().required("Day is required"),
open: Yup.string().required("Opening time is required"),
close: Yup.string().required("Closing time is required"),
})

const validationSchema = Yup.object().shape({
name: Yup.string().required("Name is required"),
address1: Yup.string().required("Street address is required"),
Expand All @@ -51,7 +44,6 @@ const validationSchema = Yup.object().shape({
latitude: Yup.number().required("Latitude is required").min(-90).max(90),
longitude: Yup.number().required("Longitude is required").min(-180).max(180),
email: Yup.string().email("Invalid email address format"),
hours: Yup.array().of(HourSchema),
selectedCategoryIds: Yup.array().min(
1,
"You must select at least one category"
Expand Down
147 changes: 64 additions & 83 deletions client/src/components/Layout/Footer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React from "react";
import { Box, CardMedia } from "@mui/material";
import useLocationHook from "hooks/useLocationHook";
import { MENU_ITEMS } from "helpers/Constants";
Expand All @@ -19,109 +19,90 @@ const logoPaths = {
6: require("images/foodoasis.svg").default,
};



const Footer = () => {
const { isHomePage } = useLocationHook();

const initialFooterSwitch = window.innerWidth >= 960 ? true : false;
const [fullSizeFooterVisible, changeFooterSize] =
useState(initialFooterSwitch);

useEffect(() => {
const checkWindowSize = () => {
window.innerWidth >= 960
? changeFooterSize(true)
: changeFooterSize(false);
};
window.addEventListener("resize", checkWindowSize);
return () => window.removeEventListener("resize", checkWindowSize);
}, []);

if (isHomePage) return null;

const holderStyle = fullSizeFooterVisible
? {
alignItems: "center",
}
: {
alignItems: "flex-end",
};

const constantLinks = MENU_ITEMS.map((item, index) => {
const { text, link } = item;
return (
<Link style={{
padding: "0 !important",
color: "#1b1b1b",
textDecoration: "none",
fontSize: "16px",
textTransform: "uppercase",
margin: ".4em 0 .4em 1.5em",
"&:hover": {
textDecoration: "underline",
},
}} key={index} to={link}>
<Link
style={{
padding: "0 !important",
color: "#1b1b1b",
textDecoration: "none",
fontSize: "16px",
textTransform: "uppercase",
margin: ".4em 0 .4em 1.5em",
"&:hover": {
textDecoration: "underline",
},
}}
key={index}
to={link}
>
{text}
</Link>
);
});

return (
<Box
sx={(theme) => ({
position: "relative",
backgroundColor: "#FFF",
padding: "1.5rem 1rem",
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
color: "#1b1b1b",
[theme.breakpoints.up("md")]: {
alignItems: 'flex-start'
},
[theme.breakpoints.down("md")]: {
alignItems: 'flex-end'
},
fontFamily: `"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans- serif`,
})}
>
<CardMedia
component='img'
alt='logo'
src={logoPaths[tenantId]}
sx={(theme) => ({
maxWidth: "95px",
height: "100%",
width: "100%",
marginTop: "0",

"&:hover": {
filter: "brightness(1.2)",
},
position: "relative",
backgroundColor: "#FFF",
padding: "1.5rem 1rem",
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
color: "#1b1b1b",
[theme.breakpoints.up("md")]: {
paddingTop: '5px'
alignItems: "flex-start",
},
[theme.breakpoints.down("md")]: {
alignItems: "flex-end",
},
fontFamily: `"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans- serif`,
})}
>
<CardMedia
component="img"
alt="logo"
src={logoPaths[tenantId]}
sx={(theme) => ({
maxWidth: "95px",
height: "100%",
width: "100%",
marginTop: "0",

"&:hover": {
filter: "brightness(1.2)",
},
[theme.breakpoints.up("md")]: {
paddingTop: "5px",
},
})}
/>

<Box
sx={(theme) => ({
justifyContent: 'center',
alignItems: 'flex-end',
display: "flex",
flexDirection: "column",
marginBottom: "10px",
[theme.breakpoints.up("md")]: {
flexDirection: "row",
alignItems: "flex-start",
gap: "4em"
},
[theme.breakpoints.down("md")]: {
height: '180px',
}
})}>
{constantLinks}
<Box
sx={(theme) => ({
justifyContent: "center",
alignItems: "flex-end",
display: "flex",
flexDirection: "column",
marginBottom: "10px",
[theme.breakpoints.up("md")]: {
flexDirection: "row",
alignItems: "flex-start",
gap: "4em",
},
[theme.breakpoints.down("md")]: {
height: "180px",
},
})}
>
{constantLinks}
</Box>
{/* <Copyright /> */}
</Box>
Expand Down
49 changes: 23 additions & 26 deletions client/src/components/Layout/HeaderHome.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
import React from "react";
import Menu from "./Menu";
import { AppBar, Toolbar, useMediaQuery } from "@mui/material";
import { useTheme } from "@mui/styles";
import { AppBar, Toolbar } from "@mui/material";

export default function Header() {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down("sm"), {
defaultMatches: true,
});

return (
<>
<AppBar position="sticky"
sx={{
backgroundColor: 'transparent',
mb:'-65px',
boxShadow: 'none'
}}>
<Toolbar sx={(theme) => ({
display: 'flex',
justifyContent: "flex-end",
"&.MuiToolbar-root": {
minHeight: "60px",
padding: "0.25em 1.25em 0 0",
[theme.breakpoints.down("sm")]: {
minHeight: "45px",
padding: "0.25em 0.5em 0 0",
},
},
})}
>
<AppBar
position="sticky"
sx={{
backgroundColor: "transparent",
mb: "-65px",
boxShadow: "none",
}}
>
<Toolbar
sx={(theme) => ({
display: "flex",
justifyContent: "flex-end",
"&.MuiToolbar-root": {
minHeight: "60px",
padding: "0.25em 1.25em 0 0",
[theme.breakpoints.down("sm")]: {
minHeight: "45px",
padding: "0.25em 0.5em 0 0",
},
},
})}
>
<Menu />
</Toolbar>
</AppBar>
Expand Down

0 comments on commit a846201

Please sign in to comment.