Skip to content

Commit a84f3d6

Browse files
committed
embedded mode link to CC home
1 parent 9ef2f47 commit a84f3d6

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/client/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Navigate, Outlet, useLocation, useParams } from 'react-router-dom'
99
import { initShibbolethPinger } from 'unfuck-spa-shibboleth-session'
1010
import { PUBLIC_URL } from '../config'
1111
import { Feedback } from './components/Feedback'
12-
import NavBar from './components/NavBar'
12+
import NavBar, { EmbeddedNavBar } from './components/NavBar'
1313
import { AppContext } from './contexts/AppContext'
1414
import { EmbeddedProvider, useIsEmbedded } from './contexts/EmbeddedContext'
1515
import useCurrentUser from './hooks/useCurrentUser'
@@ -111,7 +111,7 @@ const Layout = () => {
111111
}}
112112
ref={appRef}
113113
>
114-
{!isEmbedded && <NavBar />}
114+
{isEmbedded ? <EmbeddedNavBar /> : <NavBar />}
115115
<Box sx={{ flex: 1, mt: '4rem' }}>
116116
<Content />
117117
</Box>

src/client/components/NavBar/index.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,33 @@ import {
2121
useMediaQuery,
2222
} from '@mui/material'
2323
import { useTheme } from '@mui/material/styles'
24-
import { Language, AdminPanelSettingsOutlined, BookmarksOutlined, GradeOutlined } from '@mui/icons-material'
24+
import { Language, AdminPanelSettingsOutlined, BookmarksOutlined, GradeOutlined, OpenInNew } from '@mui/icons-material'
2525
import { useTranslation } from 'react-i18next'
2626
import MenuIcon from '@mui/icons-material/Menu'
2727

2828
import useCurrentUser from '../../hooks/useCurrentUser'
2929
import hyLogo from '../../assets/hy_logo.svg'
3030
import styles from './styles'
3131

32+
export const EmbeddedNavBar = () => {
33+
const { t } = useTranslation()
34+
35+
return (
36+
<MuiLink
37+
to="/"
38+
sx={{ display: 'flex', alignItems: 'center', color: 'inherit', textDecoration: 'none', position: 'fixed', top: 0, left: 0, p: 1, zIndex: 1000 }}
39+
component={Link}
40+
target="_blank"
41+
>
42+
<img src={hyLogo} alt="University of Helsinki" width="18" />
43+
<Box mx="1rem">
44+
<Typography sx={{ ...styles.appName, fontSize: '1.1rem' }}>{t('appName')}</Typography>
45+
</Box>
46+
<OpenInNew sx={{ fontSize: '1.1rem' }} />
47+
</MuiLink>
48+
)
49+
}
50+
3251
const NavBar = () => {
3352
const { t, i18n } = useTranslation()
3453

0 commit comments

Comments
 (0)