Skip to content

Commit 9bc7231

Browse files
authored
srink the version and align to left (#950)
1 parent cb7b3b1 commit 9bc7231

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

frontend/src/app.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { V2 } from "./openapi";
22
import { EventListenerJobStatus } from "./types/data";
33

44
interface Config {
5+
appVersion: string;
56
hostname: string;
67
apikey: string;
78
GHIssueBaseURL: string;
@@ -34,7 +35,7 @@ const hostname =
3435

3536
// TODO when add auth piece remove this env
3637
const apikey = process.env.APIKEY || "";
37-
38+
config["appVersion"] = "v2.0.0-beta.2";
3839
config["hostname"] = hostname;
3940
config["apikey"] = apikey;
4041

frontend/src/components/Layout.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@ import ListItem from "@mui/material/ListItem";
1616
import ListItemButton from "@mui/material/ListItemButton";
1717
import ListItemIcon from "@mui/material/ListItemIcon";
1818
import ListItemText from "@mui/material/ListItemText";
19-
import {
20-
Badge,
21-
Link,
22-
Menu,
23-
MenuItem,
24-
MenuList,
25-
Typography,
26-
} from "@mui/material";
19+
import { Badge, Link, Menu, MenuItem, MenuList } from "@mui/material";
2720
import { Link as RouterLink, useLocation } from "react-router-dom";
2821
import { useDispatch, useSelector } from "react-redux";
2922
import { RootState } from "../types/data";
@@ -45,6 +38,7 @@ import {
4538
import { AdminPanelSettings } from "@mui/icons-material";
4639
import ManageAccountsIcon from "@mui/icons-material/ManageAccounts";
4740
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
41+
import { AppVersion } from "./versions/AppVersion";
4842

4943
const drawerWidth = 240;
5044

@@ -423,18 +417,7 @@ export default function PersistentDrawerLeft(props) {
423417
<Main open={open}>
424418
<DrawerHeader />
425419
{children}
426-
<Box
427-
sx={{
428-
position: "fixed",
429-
bottom: "0px",
430-
minHeight: "30px",
431-
width: "100%",
432-
}}
433-
>
434-
<Typography variant="body2" color="primary.light">
435-
v2.0.0-beta.2
436-
</Typography>
437-
</Box>
420+
<AppVersion />
438421
</Main>
439422
</Box>
440423
);

frontend/src/components/PublicLayout.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import ListItem from "@mui/material/ListItem";
1616
import ListItemButton from "@mui/material/ListItemButton";
1717
import ListItemIcon from "@mui/material/ListItemIcon";
1818
import ListItemText from "@mui/material/ListItemText";
19-
import { Link, Menu, MenuItem, MenuList, Typography } from "@mui/material";
19+
import { Link, Menu, MenuItem, MenuList } from "@mui/material";
2020
import { Link as RouterLink, useLocation } from "react-router-dom";
2121
import { useSelector } from "react-redux";
2222
import { RootState } from "../types/data";
@@ -25,6 +25,7 @@ import PersonIcon from "@mui/icons-material/Person";
2525
import VpnKeyIcon from "@mui/icons-material/VpnKey";
2626
import LogoutIcon from "@mui/icons-material/Logout";
2727
import { EmbeddedSearch } from "./search/EmbeddedSearch";
28+
import { AppVersion } from "./versions/AppVersion";
2829

2930
const drawerWidth = 240;
3031

@@ -239,18 +240,7 @@ export default function PersistentDrawerLeft(props) {
239240
<Main open={open}>
240241
<DrawerHeader />
241242
{children}
242-
<Box
243-
sx={{
244-
position: "fixed",
245-
bottom: "0px",
246-
minHeight: "30px",
247-
width: "100%",
248-
}}
249-
>
250-
<Typography variant="body2" color="primary.light">
251-
v2.0.0-beta.2
252-
</Typography>
253-
</Box>
243+
<AppVersion />
254244
</Main>
255245
</Box>
256246
);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import Box from "@mui/material/Box";
3+
import Tooltip from "@mui/material/Tooltip";
4+
import IconButton from "@mui/material/IconButton";
5+
import InfoIcon from "@mui/icons-material/Info";
6+
import { theme } from "../../theme";
7+
import config from "../../app.config";
8+
9+
export function AppVersion() {
10+
return (
11+
<Box
12+
sx={{
13+
position: "fixed",
14+
bottom: 0,
15+
right: 0,
16+
width: "100%",
17+
textAlign: "right", // Centers the icon button
18+
}}
19+
>
20+
<Tooltip title={config.appVersion} placement="top" arrow>
21+
<IconButton>
22+
<InfoIcon sx={{ color: theme.palette.primary.main }} />
23+
</IconButton>
24+
</Tooltip>
25+
</Box>
26+
);
27+
}

0 commit comments

Comments
 (0)