diff --git a/src/components/DevSiteHeader/DevSiteHeader.tsx b/src/components/DevSiteHeader/DevSiteHeader.tsx index bc9b3cad4a..3c92a32348 100644 --- a/src/components/DevSiteHeader/DevSiteHeader.tsx +++ b/src/components/DevSiteHeader/DevSiteHeader.tsx @@ -1,61 +1,96 @@ import { SITE, VERSION, DEV_SITE_ROLE } from 'src/config/config' import Text from 'src/components/Text' -import theme from 'src/themes/styled.theme' import { UserRole } from 'src/models' import { Flex, Box } from 'rebass/styled-components' import Select from 'react-select' +import { observer } from 'mobx-react-lite' +import { useCommonStores } from 'src/index' /** * A simple header component that reminds developers that they are working on a dev * version of the platform, and provide the option to toggle between different dev sites */ -const DevSiteHeader = () => ( - <> - {devSites.find(s => s.value === SITE) && ( - - - This is a dev version of the platform (v{VERSION}) - - - - View as: +const DevSiteHeader = observer(() => { + const { themeStore } = useCommonStores().stores + const theme = themeStore.currentTheme.styles + return ( + <> + {showDevSiteHeader() && ( + + + This is a dev version of the platform (v{VERSION}) - - s.value === DEV_SITE_ROLE) || siteRoles[0] + } + onChange={(s: any) => setSiteRole(s.value)} + /> + + + + + Site: + + + s.value === SITE)} + onChange={(selectedElement: any) => { + const theme = selectedElement?.value || '' + localStorage.setItem('platformTheme', theme) + themeStore.setActiveTheme(theme) + }} + /> + + - - - Site: - - -