diff --git a/package-lock.json b/package-lock.json index 854864d..04c8345 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@tanstack/react-query": "^4.29.7", "ajv": "^8.12.0", "deep-equal": "^2.2.1", + "mui-file-input": "^2.0.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, @@ -30,6 +31,7 @@ "eslint": "^8.38.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.3.4", + "prettier": "^3.0.3", "typescript": "^5.0.2", "vite": "^4.3.2" } @@ -3382,6 +3384,28 @@ "dev": true, "license": "MIT" }, + "node_modules/mui-file-input": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/mui-file-input/-/mui-file-input-2.0.6.tgz", + "integrity": "sha512-l1aCosY/Z9EfQDYKd+6g/SgilW/MuixX1ArgPZM+PB+Fowb9lgL5uzE3Q7z+xn+IPKNOd4vBqCGUJDRqZQH3KQ==", + "dependencies": { + "pretty-bytes": "^6.1.0" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@mui/icons-material": "^5.0.0", + "@mui/material": "^5.0.0", + "@types/react": "^18.0.0", + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/nanoid": { "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", @@ -3714,6 +3738,32 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-bytes": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.1.tgz", + "integrity": "sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==", + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -6716,6 +6766,14 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "mui-file-input": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/mui-file-input/-/mui-file-input-2.0.6.tgz", + "integrity": "sha512-l1aCosY/Z9EfQDYKd+6g/SgilW/MuixX1ArgPZM+PB+Fowb9lgL5uzE3Q7z+xn+IPKNOd4vBqCGUJDRqZQH3KQ==", + "requires": { + "pretty-bytes": "^6.1.0" + } + }, "nanoid": { "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", @@ -6910,6 +6968,17 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "prettier": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", + "dev": true + }, + "pretty-bytes": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.1.tgz", + "integrity": "sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==" + }, "prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", diff --git a/src/components/Branding/Branding.tsx b/src/components/Branding/Branding.tsx index 930ec8a..a754a66 100644 --- a/src/components/Branding/Branding.tsx +++ b/src/components/Branding/Branding.tsx @@ -31,6 +31,7 @@ function Branding() { const [footerMessage, setFooterMessage] = useState(); const [topLogos, setTopLogos] = useState(false); const [bottomLogos, setBottomLogos] = useState(false); + const [favicon, setFavicon] = useState('favicon.svg'); useEffect(() => { if (configFile) { @@ -62,6 +63,9 @@ function Branding() { setBottomLogos( configFile.branding ? configFile.branding.bottom_logos_enabled : false ); + setFavicon( + configFile.branding ? configFile.branding.favicon : 'favicon.svg' + ); } }, [configFile]); @@ -95,6 +99,9 @@ function Branding() { setBottomLogos( configFile.branding ? configFile.branding.bottom_logos_enabled : false ); + setFavicon( + configFile.branding ? configFile.branding.favicon : 'favicon.svg' + ); } }; @@ -110,6 +117,7 @@ function Branding() { home_banner: homeBanner, footer_message: footerMessage, top_logos_enabled: topLogos, + favicon: favicon, }); }; @@ -246,7 +254,19 @@ function Branding() { onChange={(e) => setHomeBanner(e.target.value)} /> - + + setFavicon(e.target.value)} + /> +