imported logos, header displays logo based on whiteLabel
44
package-lock.json
generated
|
|
@ -19,7 +19,8 @@
|
|||
"moment": "^2.30.1",
|
||||
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router-dom": "^6.27.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.25.8",
|
||||
|
|
@ -1555,6 +1556,15 @@
|
|||
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.20.0.tgz",
|
||||
"integrity": "sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz",
|
||||
|
|
@ -4101,6 +4111,38 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "6.27.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.27.0.tgz",
|
||||
"integrity": "sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@remix-run/router": "1.20.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "6.27.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.27.0.tgz",
|
||||
"integrity": "sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@remix-run/router": "1.20.0",
|
||||
"react-router": "6.27.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8",
|
||||
"react-dom": ">=16.8"
|
||||
}
|
||||
},
|
||||
"node_modules/react-transition-group": {
|
||||
"version": "4.4.5",
|
||||
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
"moment": "^2.30.1",
|
||||
"protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router-dom": "^6.27.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.25.8",
|
||||
|
|
|
|||
|
|
@ -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, "")}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
/>
|
||||
)
|
||||
|
||||
|
|
|
|||
BIN
src/assets/common/contractBlack.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
src/assets/common/contractWhite.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
src/assets/common/dataDuckDark.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
src/assets/common/dataDuckLight.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
src/assets/common/graphDark.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
src/assets/common/graphLight.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src/assets/components/aerationFanDark.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src/assets/components/aerationFanLight.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
src/assets/components/binStickDark.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
BIN
src/assets/components/binStickLight.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/components/co2Dark.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/assets/components/co2Light.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/components/directionDark.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
src/assets/components/directionLight.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
src/assets/components/exhaustFanDark.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
src/assets/components/exhaustFanLight.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
src/assets/components/fuelDark.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/assets/components/fuelLight.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/assets/components/fullCentrifugalFanDark.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
src/assets/components/fullCentrifugalFanLight.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
src/assets/components/grainCableDark.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/components/grainCableLight.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/assets/components/heaterDark.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/assets/components/heaterLight.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/assets/components/humidityDark.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/components/humidityLight.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src/assets/components/inLineAerationDark.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
src/assets/components/inLineAerationLight.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
BIN
src/assets/components/lidarSensorDark.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
src/assets/components/lidarSensorLight.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
src/assets/components/lowSpeedCentrifugalFanDark.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
src/assets/components/lowSpeedCentrifugalFanLight.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
src/assets/components/mineIconDark.png
Normal file
|
After Width: | Height: | Size: 726 B |
BIN
src/assets/components/mineIconLight.png
Normal file
|
After Width: | Height: | Size: 726 B |
BIN
src/assets/components/modemDark.png
Normal file
|
After Width: | Height: | Size: 356 B |
BIN
src/assets/components/modemLight.png
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
src/assets/components/pipeT.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/components/powerDark.png
Normal file
|
After Width: | Height: | Size: 206 B |
BIN
src/assets/components/powerLight.png
Normal file
|
After Width: | Height: | Size: 203 B |
BIN
src/assets/components/pressureDark.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/assets/components/pressureLight.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/assets/components/rainFallDark.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
src/assets/components/rainFallLight.png
Normal file
|
After Width: | Height: | Size: 4 KiB |
BIN
src/assets/components/temperatureDark.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/components/temperatureHumidityDark.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
src/assets/components/temperatureHumidityLight.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/assets/components/temperatureLight.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/components/windSpeedDark.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
src/assets/components/windSpeedLight.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/assets/editor/addDark.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/editor/addLight.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/assets/editor/cursor.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
src/assets/editor/cursorDark.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/assets/editor/cursorLight.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/assets/editor/delete.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
src/assets/editor/deleteDark.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/editor/deleteLight.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/editor/device.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/editor/devices.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
src/assets/editor/ducting.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
src/assets/editor/ductingYellow.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/assets/editor/fan1.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
src/assets/editor/fan2.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
src/assets/editor/fan3.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
src/assets/editor/fans.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
src/assets/editor/fansYellow.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
src/assets/editor/fullCentrifugal.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
src/assets/editor/inlineCentrifugal.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
src/assets/editor/lowCentrifugal.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
src/assets/editor/move.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
src/assets/editor/moveDark.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/assets/editor/moveLight.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
BIN
src/assets/editor/redo.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
src/assets/editor/sensors.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
src/assets/editor/sensorsYellow.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
src/assets/editor/undo.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
src/assets/external/datadog.png
vendored
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
src/assets/grain/barley.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
src/assets/grain/canola.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
src/assets/grain/corn.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
src/assets/grain/flax.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
src/assets/grain/lentil.jpg
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
src/assets/grain/oat.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
src/assets/grain/pea.jpg
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
src/assets/grain/peanut.jpg
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
src/assets/grain/rice.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/grain/sorghum.jpg
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
src/assets/grain/soybean.jpg
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
src/assets/grain/sunflower.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
src/assets/grain/wheat.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
src/assets/hardware/buffleheadv2.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/assets/hardware/gadwallv1.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/assets/hardware/gadwallv1_with_backpack.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
src/assets/hardware/magpiev1_visor.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/hardware/ruddy.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |