Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd76533

Browse files
committed
Add refresh button
1 parent 00ebe2e commit cd76533

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

site/src/components/DeploymentBanner/DeploymentBannerView.tsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { TerminalIcon } from "components/Icons/TerminalIcon"
1919
import dayjs from "dayjs"
2020
import CollectedIcon from "@material-ui/icons/Compare"
2121
import RefreshIcon from "@material-ui/icons/Refresh"
22+
import Button from "@material-ui/core/Button"
2223

2324
export const bannerHeight = 36
2425

@@ -192,11 +193,20 @@ export const DeploymentBannerView: FC<DeploymentBannerViewProps> = ({
192193
</div>
193194
</Tooltip>
194195

195-
<Tooltip title="A countdown until stats are refetched">
196-
<div className={styles.value}>
196+
<Tooltip title="A countdown until stats are fetched again. Click to refresh!">
197+
<Button
198+
className={`${styles.value} ${styles.refreshButton}`}
199+
title="Refresh"
200+
onClick={() => {
201+
if (fetchStats) {
202+
fetchStats()
203+
}
204+
}}
205+
variant="text"
206+
>
197207
<RefreshIcon />
198208
{timeUntilRefresh}s
199-
</div>
209+
</Button>
200210
</Tooltip>
201211
</div>
202212
</div>
@@ -314,4 +324,18 @@ const useStyles = makeStyles((theme) => ({
314324
alignItems: "center",
315325
gap: theme.spacing(2),
316326
},
327+
refreshButton: {
328+
margin: 0,
329+
padding: "0px 8px",
330+
height: "unset",
331+
minHeight: "unset",
332+
fontSize: "unset",
333+
color: "unset",
334+
border: 0,
335+
minWidth: "unset",
336+
337+
"& svg": {
338+
marginRight: theme.spacing(0.5),
339+
},
340+
},
317341
}))

0 commit comments

Comments
 (0)