Skip to content

Commit

Permalink
Merge pull request #288 from yohamta/feat/add-version
Browse files Browse the repository at this point in the history
admin-web: add version display
  • Loading branch information
yottahmd authored Aug 22, 2022
2 parents 95c70d3 + aca47c3 commit 34e7d28
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
return {
title: '',
navbarColor: '',
version: '',
};
}
</script>
Expand Down
1 change: 1 addition & 0 deletions admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import fetchJson from './lib/fetchJson';
export type Config = {
title: string;
navbarColor: string;
version: string;
};

type Props = {
Expand Down
23 changes: 20 additions & 3 deletions admin/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,28 @@ const Drawer = styled(MuiDrawer, {
const mdTheme = createTheme({
typography: {
fontFamily:
"'SF Pro Display','SF Compact Display',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol'",
"'SF Pro Display','SF Compact Display',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol'",
},
palette: {
primary: {
main: '#485fc7',
}
},
},
});

type DashboardContentProps = {
title: string;
navbarColor: string;
version: string;
children?: React.ReactElement | React.ReactElement[];
};

function Content({ title, navbarColor, children }: DashboardContentProps) {
function Content({
title,
navbarColor,
version,
children,
}: DashboardContentProps) {
const [open, setOpen] = React.useState(false);
const toggleDrawer = () => {
setOpen(!open);
Expand Down Expand Up @@ -118,6 +124,17 @@ function Content({ title, navbarColor, children }: DashboardContentProps) {
/>
</IconButton>
</Toolbar>
<Box
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
color: '#fff',
overflowWrap: 'break-word',
}}
>
{version}
</Box>
<List
component="nav"
sx={{
Expand Down
1 change: 1 addition & 0 deletions internal/admin/handlers/web/templates/base.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
return {
title: "{{ navbarTitle }}",
navbarColor: "{{ navbarColor }}",
version: "{{ version }}",
}
}
</script>
Expand Down

0 comments on commit 34e7d28

Please sign in to comment.