Skip to content

Commit fde27a9

Browse files
committed
Refactoring name of custom hook file, and using theme colouring spacing etc
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
1 parent 9bce0b2 commit fde27a9

File tree

5 files changed

+58
-60
lines changed

5 files changed

+58
-60
lines changed

app/src/gui/components/notebook/datagrid_toolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import React, {useEffect} from 'react';
2222
import {Divider, Box, Grid, TextField, Button} from '@mui/material';
2323
import {GridToolbarContainer, GridToolbarFilterButton} from '@mui/x-data-grid';
2424
import SearchIcon from '@mui/icons-material/Search';
25-
import {usePrevious} from '../../../utils/custom_hooks';
25+
import {usePrevious} from '../../../utils/customHooks';
2626
interface ToolbarProps {
2727
handleQueryFunction: any;
2828
}

app/src/gui/components/ui/exampleOnlineOnlyComponent.tsx renamed to app/src/gui/components/ui/ExampleOnlineOnlyComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useIsOnline} from '../../../utils/custom_hooks';
1+
import {useIsOnline} from '../../../utils/customHooks';
22
import {Typography, Button, Box} from '@mui/material';
33
import RefreshIcon from '@mui/icons-material/Refresh';
44

app/src/gui/components/ui/OfflineFallback.tsx

Lines changed: 55 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,65 @@ import SignalWifiConnectedNoInternet4Icon from '@mui/icons-material/SignalWifiCo
44
import {Box, Button, CircularProgress, Typography} from '@mui/material';
55
import {useState} from 'react';
66
import {createUseStyles as makeStyles} from 'react-jss';
7+
import {theme} from '../../themes';
78

8-
const useStyles = makeStyles((theme: any) => {
9-
console.log(JSON.stringify(theme));
10-
return {
11-
root: {
12-
display: 'flex',
13-
flexDirection: 'column',
14-
alignItems: 'center',
15-
justifyContent: 'center',
16-
minHeight: '100vh',
17-
backgroundColor: '#f5f5f5',
9+
const useStyles = makeStyles({
10+
root: {
11+
display: 'flex',
12+
flexDirection: 'column',
13+
alignItems: 'center',
14+
justifyContent: 'center',
15+
minHeight: '100vh',
16+
backgroundColor: theme.palette.background.default,
17+
},
18+
container: {
19+
padding: theme.spacing(4),
20+
backgroundColor: theme.palette.background.paper,
21+
borderRadius: theme.shape.borderRadius,
22+
boxShadow: theme.shadows[1],
23+
textAlign: 'center',
24+
},
25+
logo: {
26+
width: theme.spacing(12),
27+
height: theme.spacing(12),
28+
marginBottom: theme.spacing(3),
29+
color: theme.palette.text.secondary,
30+
},
31+
title: {
32+
color: theme.palette.text.primary,
33+
marginBottom: theme.spacing(1),
34+
},
35+
subtitle: {
36+
color: theme.palette.text.secondary,
37+
marginBottom: theme.spacing(3),
38+
},
39+
buttonContainer: {
40+
'& > :not(:last-child)': {
41+
marginRight: theme.spacing(2),
1842
},
19-
container: {
20-
padding: '32px',
21-
backgroundColor: '#ffffff',
22-
borderRadius: '8px',
23-
boxShadow: '0 3px 6px rgba(0,0,0,0.1)',
24-
textAlign: 'center',
43+
},
44+
primaryButton: {
45+
backgroundColor: theme.palette.primary.main,
46+
color: theme.palette.primary.contrastText,
47+
'&:hover': {
48+
backgroundColor: theme.palette.primary.dark,
2549
},
26-
logo: {
27-
width: 100,
28-
height: 100,
29-
marginBottom: '24px',
30-
color: '#9E9E9E',
50+
},
51+
secondaryButton: {
52+
color: theme.palette.text.primary,
53+
borderColor: theme.palette.text.primary,
54+
'&:hover': {
55+
backgroundColor: theme.palette.action.hover,
3156
},
32-
title: {
33-
color: '#333333',
34-
marginBottom: '8px',
35-
},
36-
subtitle: {
37-
color: '#666666',
38-
marginBottom: '24px',
39-
},
40-
buttonContainer: {
41-
'& > :not(:last-child)': {
42-
marginRight: '16px',
43-
},
44-
},
45-
primaryButton: {
46-
backgroundColor: '#4a4a4a',
47-
color: '#ffffff',
48-
'&:hover': {
49-
backgroundColor: '#333333',
50-
},
51-
},
52-
secondaryButton: {
53-
color: '#4a4a4a',
54-
borderColor: '#4a4a4a',
55-
'&:hover': {
56-
backgroundColor: 'rgba(74, 74, 74, 0.04)',
57-
},
58-
},
59-
buttonProgress: {
60-
color: '#ffffff',
61-
position: 'absolute',
62-
top: '50%',
63-
left: '50%',
64-
marginTop: -12,
65-
marginLeft: -12,
66-
},
67-
};
57+
},
58+
buttonProgress: {
59+
color: theme.palette.primary.contrastText,
60+
position: 'absolute',
61+
top: '50%',
62+
left: '50%',
63+
marginTop: -12,
64+
marginLeft: -12,
65+
},
6866
});
6967

7068
export interface OfflineFallbackComponentProps {

app/src/gui/pages/workspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Notebooks from '../components/workspace/notebooks';
2424
import Breadcrumbs from '../components/ui/breadcrumbs';
2525
import {NOTEBOOK_NAME_CAPITALIZED} from '../../buildconfig';
2626
import {projectListVerbose} from '../themes';
27-
import ExampleOnlineComponent from '../components/ui/exampleOnlineOnlyComponent';
27+
import ExampleOnlineComponent from '../components/ui/ExampleOnlineOnlyComponent';
2828

2929
export default function Workspace() {
3030
const breadcrumbs = [{title: 'Workspace'}];
File renamed without changes.

0 commit comments

Comments
 (0)