diff --git a/frontend/src/appConfig.ts b/frontend/src/appConfig.ts index a28e40c6f014a24348b22673c91f00823f17b435..4af122b83bf0d65b3d035d5b1cab3c01f937db48 100644 --- a/frontend/src/appConfig.ts +++ b/frontend/src/appConfig.ts @@ -16,14 +16,9 @@ export const appTimezone: string = 'Europe/Oslo' export const appVersion: string = process.env.REACT_APP_VERSION as string export const appName: string = process.env.REACT_APP_NAME as string -/* Institution */ +/* Institution (used for features and theming */ export const appInst: string = env.REACT_APP_INST as string -/* Theming */ -export const appTheme: string = env.REACT_APP_THEME - ? (env.REACT_APP_THEME as string) - : 'default' - /* Show warning in the footer about this being a staging/test system */ export const appStagingWarning: boolean = env.REACT_APP_STAGING_WARNING === 'true' diff --git a/frontend/src/components/debug/index.tsx b/frontend/src/components/debug/index.tsx index ef0ec0073217e7ce3d8ef1d4080e036edd8fba9c..3b781fd5ab4deed8a5b8ec564ccf920135468084 100644 --- a/frontend/src/components/debug/index.tsx +++ b/frontend/src/components/debug/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import { useState } from 'react' import { useTranslation } from 'react-i18next' import CheckIcon from '@mui/icons-material/Check' @@ -15,7 +15,7 @@ import { Divider, } from '@mui/material' -import { appTheme, appTimezone, appVersion, appInst } from 'appConfig' +import { appInst, appTimezone, appVersion, appInst } from 'appConfig' import { Link } from 'react-router-dom' const Yes = () => <CheckIcon color="success" /> @@ -139,7 +139,7 @@ export const Debug = () => { ['Version', appVersion], ['Timezone', appTimezone], ['Language', i18n.language], - ['Theme', appTheme], + ['Theme', appInst], ['Institution', appInst], ['API reachable?', apiHealth === 'yes' ? <Yes /> : apiHealth], ['Authenticated?', isAuthenticated ? <Yes /> : <No />], diff --git a/frontend/src/components/logobars/LogoBar.tsx b/frontend/src/components/logobars/LogoBar.tsx index 2af512f339f8742d8428050f52ea4753ea82c047..7d1f0fa914f72791551b74122325f5641d4116ea 100644 --- a/frontend/src/components/logobars/LogoBar.tsx +++ b/frontend/src/components/logobars/LogoBar.tsx @@ -1,11 +1,9 @@ -import React from 'react' -import { appTheme } from 'appConfig' +import { appInst } from 'appConfig' import UiOLogoBar from './UiO' import UiBLogoBar from './UiB' - function LogoBar() { - switch (appTheme) { + switch (appInst) { case 'uio': return <UiOLogoBar /> case 'uib': @@ -15,4 +13,4 @@ function LogoBar() { } } -export default LogoBar \ No newline at end of file +export default LogoBar diff --git a/frontend/src/themes/index.ts b/frontend/src/themes/index.ts index 08fe70e71acb5c0482a8da9c482c548ae9eb5e2d..ba7369c063672e70170bc952960aba05e7b1ca5d 100644 --- a/frontend/src/themes/index.ts +++ b/frontend/src/themes/index.ts @@ -5,7 +5,7 @@ import uibTheme from 'themes/uib' import uioTheme from 'themes/uio' import mainTheme from 'themes/main' -import { appTheme } from 'appConfig' +import { appInst } from 'appConfig' declare module '@mui/material/styles' { interface Theme { @@ -33,13 +33,11 @@ declare module '@mui/material/styles' { export const defaultTheme = createTheme(mainTheme) function getTheme() { - switch (appTheme) { + switch (appInst) { case 'uib': return createTheme(deepmerge(mainTheme, uibTheme)) case 'uio': return createTheme(deepmerge(mainTheme, uioTheme)) - case 'default': - return defaultTheme default: return defaultTheme }