Skip to content

Commit 95919b9

Browse files
authored
Merge pull request #10 from piclane/develop
v1.0.8
2 parents 3fbdf08 + 36a6aae commit 95919b9

8 files changed

Lines changed: 103 additions & 7 deletions

File tree

.idea/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fal-plus-ui",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"license": "MIT",
55
"homepage": "/falp",
66
"dependencies": {
@@ -53,8 +53,8 @@
5353
"@types/react": "^17.0.43"
5454
},
5555
"scripts": {
56-
"start": "craco start",
57-
"build": "craco build",
56+
"start": "REACT_APP_VERSION=\"$npm_package_version\" REACT_APP_COMMIT_DATETIME=\"$(git log --pretty='format:%ad' --date=iso-strict -n 1)\" craco start",
57+
"build": "REACT_APP_VERSION=\"$npm_package_version\" REACT_APP_COMMIT_DATETIME=\"$(git log --pretty='format:%ad' --date=iso-strict -n 1)\" craco build",
5858
"test": "craco test",
5959
"eject": "craco eject",
6060
"package": "./package.sh",

src/App.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {ApolloProvider} from "@apollo/client";
99
import RecordingDetail from "@/components/pages/recording/detail/RecordingDetail";
1010
import AppTopHeader from "@/components/atoms/AppTopHeader";
1111
import Cleaner from "@/components/pages/cleaner/Cleaner";
12+
import AppBottomFooter from "@/components/atoms/AppBottomFooter";
1213

1314
const baseName = '/falp';
1415

@@ -47,16 +48,23 @@ function AppContent() {
4748
const appHeaderBounds = useBounds(appHeaderRef);
4849
const appFooterRef = useRef<HTMLElement>(null);
4950
const appFooterBounds = useBounds(appFooterRef);
51+
const appBottomFooterRef = useRef<HTMLDivElement>(null);
52+
const appBottomFooterBounds = useBounds(appBottomFooterRef);
5053
return (
5154
<>
5255
<AppTopHeader ref={appTopHeaderRef} />
53-
<Box sx={{ flexGrow: 1, paddingTop: appTopHeaderBounds.height }}>
56+
<Box sx={{
57+
flexGrow: 1,
58+
paddingTop: appTopHeaderBounds.height,
59+
paddingBottom: appBottomFooterBounds.height,
60+
}}>
5461
<Box id="app-header" sx={{ top: appTopHeaderBounds.height }} ref={appHeaderRef} />
5562
<Box id="app-header-spacer" sx={{height: appHeaderBounds.height }} />
5663
{routes}
5764
<Box id="app-footer" ref={appFooterRef} />
5865
<Box id="app-footer-spacer" sx={{height: appFooterBounds.height }} />
5966
</Box>
67+
<AppBottomFooter ref={appBottomFooterRef} />
6068
</>
6169
);
6270
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import React from "react";
2+
import {AppBar, AppBarProps, createTheme, ThemeProvider, Toolbar, Typography} from "@mui/material";
3+
import {DateTime} from "luxon";
4+
import {gql, useQuery} from "@apollo/client";
5+
6+
const FETCH_API_VERSION = gql`
7+
query {
8+
version
9+
}
10+
`;
11+
12+
const theme = createTheme({
13+
components: {
14+
MuiAppBar: {
15+
styleOverrides: {
16+
root: {
17+
top: 'auto',
18+
bottom: 0,
19+
backgroundColor: 'rgba(0,0,0,.5)',
20+
backdropFilter: 'saturate(5) blur(10px)'
21+
}
22+
}
23+
},
24+
MuiToolbar: {
25+
styleOverrides: {
26+
root: {
27+
minHeight: 'auto !important',
28+
}
29+
}
30+
},
31+
MuiTypography: {
32+
styleOverrides: {
33+
root: {
34+
color: 'rgba(220,220,220,.9)',
35+
fontSize: '12px',
36+
fontWeight: "400",
37+
fontFamily: "'Akshar', sans-serif",
38+
marginRight: '0.5em'
39+
}
40+
}
41+
}
42+
}
43+
});
44+
45+
interface AppBottomFooterProps extends AppBarProps {
46+
47+
}
48+
49+
const AppBottomFooter = React.forwardRef<HTMLDivElement, AppBottomFooterProps>((props: AppBottomFooterProps, ref) => {
50+
const {
51+
position = 'fixed',
52+
color = 'transparent',
53+
...restProps
54+
} = props;
55+
const {data: apiVersionData} = useQuery<{version: string}>(FETCH_API_VERSION);
56+
const commitDateTime = process.env.REACT_APP_COMMIT_DATETIME;
57+
const crYear = (commitDateTime ? DateTime.fromISO(commitDateTime) : DateTime.now()).toFormat("yyyy");
58+
const crUiVersion = `v${process.env.REACT_APP_VERSION}`;
59+
const crApiVersion = apiVersionData ? `v${apiVersionData?.version}` : '...';
60+
61+
return (
62+
<ThemeProvider theme={theme}>
63+
<AppBar
64+
{...restProps}
65+
className="app-bottom-footer"
66+
position={position}
67+
color={color}
68+
sx={{ zIndex: (theme) => theme.zIndex.drawer + 1 }}
69+
ref={ref}
70+
component="footer"
71+
>
72+
<Toolbar className="app-bottom-footer-tool-bar">
73+
<Typography variant="body1">&copy; { crYear } piclane.</Typography>
74+
<Typography variant="body1">FAL+UI { crUiVersion }</Typography>
75+
<Typography variant="body1">FAL+API { crApiVersion }</Typography>
76+
</Toolbar>
77+
</AppBar>
78+
</ThemeProvider>
79+
);
80+
});
81+
82+
export default AppBottomFooter;

src/components/atoms/AppTopHeader.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface AppTopHeaderProps extends AppBarProps {
88
backTo?: () => To
99
}
1010

11-
const AppTopHeader = React.forwardRef((props: AppTopHeaderProps, ref) => {
11+
const AppTopHeader = React.forwardRef<HTMLDivElement, AppTopHeaderProps>((props: AppTopHeaderProps, ref) => {
1212
const navigate = useNavigate();
1313
const location = useLocation();
1414
const {
@@ -34,7 +34,6 @@ const AppTopHeader = React.forwardRef((props: AppTopHeaderProps, ref) => {
3434
position={position}
3535
color={color}
3636
sx={{ zIndex: (theme) => theme.zIndex.drawer + 1 }}
37-
// @ts-ignore
3837
ref={ref}
3938
>
4039
<Toolbar className="app-top-header-tool-bar">

0 commit comments

Comments
 (0)