imported logos, header displays logo based on whiteLabel

This commit is contained in:
Carter 2024-10-31 17:21:12 -06:00
parent 0d5d2e821f
commit 95a1ba486b
214 changed files with 290 additions and 193 deletions

View file

@ -16,10 +16,6 @@ function AuthHTTPWrapper() {
let client_id = import.meta.env.VITE_AUTH0_DEV_CLIENT_ID;
console.log("Domain: ", url)
console.log("Audience: ", audience)
console.log("Client: ", client_id)
return (
<Auth0Provider
domain={or(url, "")}

View file

@ -2,23 +2,24 @@ import { AppBar, Box, IconButton, Theme, Toolbar } from "@mui/material";
import { Menu } from "@mui/icons-material";
import classNames from "classnames";
import { makeStyles } from "@mui/styles";
import { getSignatureAccentColour } from "../services/whiteLabel";
import { getDarkLogo, getLightLogo, getSignatureAccentColour, hasTransparentLogoBG, hideLogo } from "../services/whiteLabel";
import { Link } from "react-router-dom";
import { useThemeType } from "../hooks/useThemeType";
const useStyles = makeStyles((theme: Theme) => ({
appBar: {
// zIndex: 10, // TODO: make variables to keep zIndex consistent
zIndex: theme.zIndex.drawer + 1
},
toolbar: {
marginLeft: theme.spacing(0.5),
[theme.breakpoints.up("md")]: {
marginLeft: theme.spacing(1.5)
marginLeft: theme.spacing(1.5)
}
},
buttonContainer: {
marginRight: theme.spacing(0.5),
[theme.breakpoints.up("md")]: {
marginRight: theme.spacing(1.5)
marginRight: theme.spacing(1.5)
}
},
button: {
@ -27,6 +28,31 @@ const useStyles = makeStyles((theme: Theme) => ({
hide: {
display: "none"
},
logoContainer: {
display: "flex",
alignItems: "flex-end",
justifyContent: "flex-start"
},
logoLink: {
display: "flex",
justifyContent: "center",
alignItems: "center",
borderRadius: "5px",
backgroundColor: hasTransparentLogoBG()
? ""
: theme.palette.mode === "light"
? "#fff"
: "#323232"
},
HeaderLogo: {
objectFit: "cover",
height: "56px",
width: "auto",
padding: theme.spacing(1),
[theme.breakpoints.up("md")]: {
height: "64px"
}
},
}));
interface Props {
@ -40,6 +66,8 @@ interface Props {
export default function Header(props: Props) {
const { sideIsOpen, openSide} = props;
const themeType = useThemeType();
const classes = useStyles()
return (
@ -53,9 +81,20 @@ export default function Header(props: Props) {
onClick={openSide}
className={classNames(classes.button, sideIsOpen && classes.hide)}>
<Menu />
</IconButton>
</IconButton>
{/* )} */}
</Box>
<Box flexGrow={1} marginLeft={0.5}>
{!hideLogo() && (
<div className={classes.logoContainer}>
<img
className={classes.HeaderLogo}
src={themeType === "light" ? getDarkLogo() : getLightLogo()}
alt={import.meta.env.REACT_APP_WEBSITE_TITLE}
/>
</div>
)}
</Box>
</Toolbar>
</AppBar>
)

View file

@ -17,6 +17,7 @@ export default function UserWrapper() {
const useAuth = useAuth0();
const hasFetched = useRef(false);
const [user, setUser] = useState<pond.User | undefined>(undefined)
const [message, setMessage] = useState("Loading user profile...")
let user_id = or(useAuth.user?.sub, "")
@ -24,8 +25,15 @@ export default function UserWrapper() {
if (hasFetched.current) return;
setLoading(true)
userAPI.getUser(user_id).then(resp => {
setUser(resp)
}).finally(() => {
setUser(resp)
}).catch(err => {
if (err.toString().includes("CORS")) {
setMessage("CORS error")
} else {
setMessage("Loading failed, refresh may help")
}
})
.finally(() => {
setLoading(false)
hasFetched.current = true;
})
@ -38,7 +46,7 @@ export default function UserWrapper() {
if (!user || loading) return (
<LoadingScreen
message={"Loading user profile..."}
message={message}
/>
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
src/assets/editor/fan1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
src/assets/editor/fan2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
src/assets/editor/fan3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
src/assets/editor/fans.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
src/assets/editor/move.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
src/assets/editor/redo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
src/assets/editor/undo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
src/assets/external/datadog.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
src/assets/grain/barley.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
src/assets/grain/canola.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
src/assets/grain/corn.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
src/assets/grain/flax.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
src/assets/grain/lentil.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
src/assets/grain/oat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
src/assets/grain/pea.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
src/assets/grain/peanut.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
src/assets/grain/rice.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
src/assets/grain/wheat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Some files were not shown because too many files have changed in this diff Show more