Skip to content

Commit c10c142

Browse files
committed
feat(frontend): improve dashboard cards
1 parent e18d177 commit c10c142

File tree

1 file changed

+109
-35
lines changed

1 file changed

+109
-35
lines changed

frontend/dashboard/src/routes/DashboardPage.tsx

Lines changed: 109 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,28 @@ import React from "react";
1010
import { Link } from "react-router-dom";
1111
import { WorkflowsNavbar } from "workflows-lib";
1212

13+
const cardHeight = 160;
14+
1315
const workflowsCard = (
1416
<React.Fragment>
1517
<CardActionArea component={Link} to="/workflows">
16-
<CardContent>
17-
<Typography gutterBottom variant="h5" component="div">
18-
Workflows
18+
<CardContent style={{ height: cardHeight }}>
19+
<Typography
20+
gutterBottom
21+
variant="h5"
22+
component="div"
23+
sx={{ textAlign: "center" }}
24+
>
25+
Submitted Workflows
1926
</Typography>
20-
<Typography variant="body2" sx={{ color: "text.secondary" }}>
21-
Provides an overview of current and past workflows for a given visit.
27+
<Typography
28+
variant="body2"
29+
sx={{
30+
color: "text.secondary",
31+
textAlign: "center",
32+
}}
33+
>
34+
View current and past workflows for a given visit.
2235
</Typography>
2336
</CardContent>
2437
</CardActionArea>
@@ -28,12 +41,23 @@ const workflowsCard = (
2841
const templatesCard = (
2942
<React.Fragment>
3043
<CardActionArea component={Link} to="/templates">
31-
<CardContent>
32-
<Typography gutterBottom variant="h5" component="div">
33-
Templates
44+
<CardContent style={{ height: cardHeight }}>
45+
<Typography
46+
gutterBottom
47+
variant="h5"
48+
component="div"
49+
sx={{ textAlign: "center" }}
50+
>
51+
Run New Workflow
3452
</Typography>
35-
<Typography variant="body2" sx={{ color: "text.secondary" }}>
36-
Provides an overview of all available workflowTemplates and Sensors.
53+
<Typography
54+
variant="body2"
55+
sx={{
56+
color: "text.secondary",
57+
textAlign: "center",
58+
}}
59+
>
60+
Submit a new workflow from a template.
3761
</Typography>
3862
</CardContent>
3963
</CardActionArea>
@@ -46,12 +70,23 @@ const documentationCard = (
4670
href="https://diamondlightsource.github.io/workflows/docs"
4771
target="_blank"
4872
>
49-
<CardContent>
50-
<Typography gutterBottom variant="h5" component="div">
73+
<CardContent style={{ height: cardHeight }}>
74+
<Typography
75+
gutterBottom
76+
variant="h5"
77+
component="div"
78+
sx={{ textAlign: "center" }}
79+
>
5180
Documentation
5281
</Typography>
53-
<Typography variant="body2" sx={{ color: "text.secondary" }}>
54-
Full user documentation with tutorials, how-tos, explanations and
82+
<Typography
83+
variant="body2"
84+
sx={{
85+
color: "text.secondary",
86+
textAlign: "center",
87+
}}
88+
>
89+
Full user documentation with tutorials, explanations, how-tos, and
5590
references.
5691
</Typography>
5792
</CardContent>
@@ -65,12 +100,23 @@ const helpCard = (
65100
href="https://diamondlightsource.slack.com/archives/C08NYJSGMFD"
66101
target="_blank"
67102
>
68-
<CardContent>
69-
<Typography gutterBottom variant="h5" component="div">
103+
<CardContent style={{ height: cardHeight }}>
104+
<Typography
105+
gutterBottom
106+
variant="h5"
107+
component="div"
108+
sx={{ textAlign: "center" }}
109+
>
70110
Help/Feedback
71111
</Typography>
72-
<Typography variant="body2" sx={{ color: "text.secondary" }}>
73-
Get help from the workflows team and leave feedback.
112+
<Typography
113+
variant="body2"
114+
sx={{
115+
color: "text.secondary",
116+
textAlign: "center",
117+
}}
118+
>
119+
Get help and leave feedback via Slack.
74120
</Typography>
75121
</CardContent>
76122
</CardActionArea>
@@ -83,12 +129,23 @@ const reportCard = (
83129
href="https://github.com/DiamondLightSource/workflows/issues/new"
84130
target="_blank"
85131
>
86-
<CardContent>
87-
<Typography gutterBottom variant="h5" component="div">
88-
Report an issue
132+
<CardContent style={{ height: cardHeight }}>
133+
<Typography
134+
gutterBottom
135+
variant="h5"
136+
component="div"
137+
sx={{ textAlign: "center" }}
138+
>
139+
Report an Issue
89140
</Typography>
90-
<Typography variant="body2" sx={{ color: "text.secondary" }}>
91-
Report an issue on the workflows GitHub page.
141+
<Typography
142+
variant="body2"
143+
sx={{
144+
color: "text.secondary",
145+
textAlign: "center",
146+
}}
147+
>
148+
Report an issue via GitHub.
92149
</Typography>
93150
</CardContent>
94151
</CardActionArea>
@@ -99,33 +156,50 @@ function DashboardPage() {
99156
return (
100157
<>
101158
<WorkflowsNavbar />
102-
<Container maxWidth="sm" sx={{ mt: 5, mb: 4 }}>
159+
<Container maxWidth="lg" sx={{ mt: 5, mb: 4 }}>
103160
<Grid
104161
container
105162
alignItems="stretch"
163+
justifyContent="center"
106164
spacing={{ xs: 2, sm: 2, md: 3 }}
107-
columns={{ xs: 2, sm: 4, md: 6 }}
165+
columns={{ xs: 2, sm: 8, md: 12 }}
166+
sx={{ mt: 5, mb: 4 }}
108167
>
109168
<Grid key={"workflows"} size={{ xs: 2, sm: 2, md: 3 }}>
110-
<Card style={{ height: "100%", minHeight: 150 }}>
111-
{workflowsCard}
112-
</Card>
169+
<Card style={{ height: "100%" }}>{workflowsCard}</Card>
113170
</Grid>
114-
<Grid key={"templates"} size={{ xs: 2, sm: 4, md: 3 }}>
115-
<Card style={{ height: "100%", minHeight: 150 }}>
171+
<Grid key={"templates"} size={{ xs: 2, sm: 2, md: 3 }}>
172+
<Card
173+
style={{ height: "100%" }}
174+
sx={{
175+
height: "100%",
176+
transition: "all 0.3s ease",
177+
"&:hover .card-description": {
178+
opacity: 1,
179+
maxHeight: 200,
180+
},
181+
}}
182+
>
116183
{templatesCard}
117184
</Card>
118185
</Grid>
186+
</Grid>
187+
<Grid
188+
container
189+
alignItems="stretch"
190+
justifyContent="center"
191+
spacing={{ xs: 2, sm: 2, md: 3 }}
192+
columns={{ xs: 2, sm: 8, md: 12 }}
193+
sx={{ mt: 5, mb: 4 }}
194+
>
119195
<Grid key={"documentation"} size={{ xs: 2, sm: 2, md: 3 }}>
120-
<Card style={{ height: "100%", minHeight: 150 }}>
121-
{documentationCard}
122-
</Card>
196+
<Card style={{ height: "100%" }}>{documentationCard}</Card>
123197
</Grid>
124198
<Grid key={"help"} size={{ xs: 2, sm: 2, md: 3 }}>
125-
<Card style={{ height: "100%", minHeight: 150 }}>{helpCard}</Card>
199+
<Card style={{ height: "100%" }}>{helpCard}</Card>
126200
</Grid>
127201
<Grid key={"report"} size={{ xs: 2, sm: 2, md: 3 }}>
128-
<Card style={{ height: "100%", minHeight: 150 }}>{reportCard}</Card>
202+
<Card style={{ height: "100%" }}>{reportCard}</Card>
129203
</Grid>
130204
</Grid>
131205
</Container>

0 commit comments

Comments
 (0)