Skip to content
Snippets Groups Projects
Commit c2db2382 authored by Sivert Kronen Hatteberg's avatar Sivert Kronen Hatteberg
Browse files

Merge appTheme and appInst into appInst

No need for two config variables. Use the appInst config to get the
correct theme.
parent 3a1be273
No related branches found
No related tags found
1 merge request!174Updated header and footer
Pipeline #101211 failed
......@@ -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'
......
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 />],
......
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
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment