Skip to content

Commit

Permalink
SRO/ZO: Add footer to SR and ZZZ (#2833)
Browse files Browse the repository at this point in the history
* Show commit hash in header for dev mode

* Revert "Show commit hash in header for dev mode"

This reverts commit 2083ab7.

* Add footer to zzz and sr

* Update strings
  • Loading branch information
nguyentvan7 authored Mar 9, 2025
1 parent 1b7e95f commit 92c66b9
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/sr-frontend/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '@mui/material'
import { Suspense, lazy } from 'react'
import { HashRouter, Route, Routes } from 'react-router-dom'
import Footer from './Footer'
import Header from './Header'
import PageHome from './PageHome'

Expand Down Expand Up @@ -83,6 +84,9 @@ function Content() {
</Routes>
</Suspense>
</Container>
{/* make sure footer is always at bottom */}
<Box flexGrow={1} />
<Footer />
</Box>
)
}
45 changes: 45 additions & 0 deletions apps/sr-frontend/src/app/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { AppBar, Box, Skeleton, Typography } from '@mui/material'
import { Suspense } from 'react'

export default function Footer() {
return (
<Suspense fallback={<Skeleton variant="rectangular" height={64} />}>
<FooterContent />
</Suspense>
)
}
function FooterContent() {
return (
<AppBar
component="footer"
position="static"
sx={{ bgcolor: 'neutral800.main' }}
elevation={0}
>
<Box
display="flex"
justifyContent="space-between"
sx={{ px: 2, py: 1 }}
gap={2}
>
<Typography variant="caption" sx={{ color: 'neutral400.main' }}>
Build:
<a
href={
process.env.NX_URL_GITHUB_GO_CURRENT_VERSION ||
`${process.env.NX_URL_GITHUB_GO}/releases`
}
target="_blank"
rel="noreferrer"
style={{ color: 'inherit' }}
>
{process.env.NX_URL_GITHUB_GO_CURRENT_VERSION?.replace(
/.*commit\//,
''
).substring(0, 7)}
</a>
</Typography>
</Box>
</AppBar>
)
}
4 changes: 4 additions & 0 deletions apps/zzz-frontend/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { Suspense, lazy } from 'react'
import { HashRouter, Route, Routes } from 'react-router-dom'
import '../styles.scss'
import Footer from './Footer'
import Header from './Header'
const PageDiscs = lazy(() => import('@genshin-optimizer/zzz/page-discs'))
const PageOptimize = lazy(() => import('@genshin-optimizer/zzz/page-optimize'))
Expand Down Expand Up @@ -78,6 +79,9 @@ function Content() {
</Routes>
</Suspense>
</Container>
{/* make sure footer is always at bottom */}
<Box flexGrow={1} />
<Footer />
</Box>
)
}
45 changes: 45 additions & 0 deletions apps/zzz-frontend/src/app/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { AppBar, Box, Skeleton, Typography } from '@mui/material'
import { Suspense } from 'react'

export default function Footer() {
return (
<Suspense fallback={<Skeleton variant="rectangular" height={64} />}>
<FooterContent />
</Suspense>
)
}
function FooterContent() {
return (
<AppBar
component="footer"
position="static"
sx={{ bgcolor: 'neutral800.main' }}
elevation={0}
>
<Box
display="flex"
justifyContent="space-between"
sx={{ px: 2, py: 1 }}
gap={2}
>
<Typography variant="caption" sx={{ color: 'neutral400.main' }}>
Build:
<a
href={
process.env.NX_URL_GITHUB_GO_CURRENT_VERSION ||
`${process.env.NX_URL_GITHUB_GO}/releases`
}
target="_blank"
rel="noreferrer"
style={{ color: 'inherit' }}
>
{process.env.NX_URL_GITHUB_GO_CURRENT_VERSION?.replace(
/.*commit\//,
''
).substring(0, 7)}
</a>
</Typography>
</Box>
</AppBar>
)
}

0 comments on commit 92c66b9

Please sign in to comment.