diff --git a/ui/src/pages/repos.tsx b/ui/src/pages/repos.tsx index 9a7d1432..0eede0e6 100644 --- a/ui/src/pages/repos.tsx +++ b/ui/src/pages/repos.tsx @@ -25,17 +25,20 @@ import { Button, Card, CardActions, + CardContent, CardHeader, Dialog, DialogActions, DialogContent, DialogTitle, Stack, + Typography, } from "@mui/material"; import { useAuth } from "../lib/auth"; import { GoogleSignin } from "./login"; import { timeDifference } from "../lib/utils"; import { useSnackbar } from "notistack"; +import { useTheme } from "@mui/material/styles"; function CreateRepoForm(props) { const [createRepo] = useMutation( @@ -68,7 +71,7 @@ function CreateRepoForm(props) { ); } -const Star = ({ repo }) => { +const StarButton = ({ repo }) => { const { me } = useMe(); const [star, { loading: starLoading }] = useMutation( gql` @@ -95,55 +98,34 @@ const Star = ({ repo }) => { <> {isStarred ? ( - + + {repo.stargazers.length} + ) : ( - + + {repo.stargazers.length} + )} @@ -170,6 +152,7 @@ const KillRuntimeButton = ({ repo }) => { refetchQueries: ["ListAllRuntimes"], } ); + const theme = useTheme(); if (loading) return null; const info = data.listAllRuntimes.find( @@ -177,6 +160,7 @@ const KillRuntimeButton = ({ repo }) => { ); if (!info) return null; if (!info.lastActive) return null; + return ( {/* last active: {getUpTime(info.lastActive)} */} @@ -186,6 +170,11 @@ const KillRuntimeButton = ({ repo }) => { { killRuntime({ variables: { @@ -226,12 +215,18 @@ const DeleteRepoButton = ({ repo }) => { }, } ); + const theme = useTheme(); return ( { setOpen(true); }} @@ -280,58 +275,50 @@ const RepoCard = ({ repo }) => { }, [counter]); return ( - - {repo.userId !== me.id ? ( - - - - ) : repo.public ? ( - - - - ) : ( - - - - )} - - } - action={ - // TODO replace with a drop-down menu. - - - - } - title={ - + + + - + - {repo.name || "Untitled"} + {repo.name || "Untitled"} - - } - subheader={ + + + + + + Viewed{" "} {timeDifference(new Date(), new Date(parseInt(repo.accessedAt)))} - } - /> - {/* */} + + - + + {repo.userId !== me.id && ( + + + + )} + {repo.public && ( + + + + )} +