From 5dd9dcb584231e6c84463a708b37e1e384f3817c Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Tue, 28 Nov 2023 21:56:44 +0000 Subject: [PATCH] feat: add delete tag support Signed-off-by: Ramkumar Chinchani --- src/components/Repo/RepoDetails.jsx | 34 ++++++++++++++++++++++++++++- src/components/Repo/Tabs/Tags.jsx | 3 ++- src/components/Shared/TagCard.jsx | 21 ++++++++++++++---- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/components/Repo/RepoDetails.jsx b/src/components/Repo/RepoDetails.jsx index f6d50f8b..b726e2c6 100644 --- a/src/components/Repo/RepoDetails.jsx +++ b/src/components/Repo/RepoDetails.jsx @@ -11,10 +11,11 @@ import { host } from '../../host'; import { useParams, useNavigate, createSearchParams } from 'react-router-dom'; // components -import { Card, CardContent, CardMedia, Chip, Grid, Stack, Tooltip, Typography, IconButton } from '@mui/material'; +import { Button, Card, CardContent, CardMedia, Chip, Dialog, DialogTitle, DialogContent, DialogActions, Grid, Stack, Tooltip, Typography, IconButton } from '@mui/material'; import BookmarkIcon from '@mui/icons-material/Bookmark'; import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder'; import makeStyles from '@mui/styles/makeStyles'; +import DeleteIcon from '@mui/icons-material'; // placeholder images import repocube1 from '../../assets/repocube-1.png'; @@ -338,3 +339,34 @@ function RepoDetails() { ); } export default RepoDetails; + +function DeleteTagConfirmDialog(props) { + const { title, children, open, setOpen, onConfirm } = props; + + const handleClose = () => { + onClose(selectedValue); + }; + + const handleListItemClick = (value) => { + onClose(value); + }; + + return ( + + + Delete {repo}:{tag}? + + + {children} + + + + + + + ); +} diff --git a/src/components/Repo/Tabs/Tags.jsx b/src/components/Repo/Tabs/Tags.jsx index 808d55f5..ca5139ce 100644 --- a/src/components/Repo/Tabs/Tags.jsx +++ b/src/components/Repo/Tabs/Tags.jsx @@ -43,7 +43,7 @@ const useStyles = makeStyles(() => ({ export default function Tags(props) { const classes = useStyles(); - const { tags } = props; + const { tags, repo } = props; const [tagsFilter, setTagsFilter] = useState(''); const [sortFilter, setSortFilter] = useState(tagsSortByCriteria.updateTimeDesc.value); @@ -59,6 +59,7 @@ export default function Tags(props) { return ( ({ card: { @@ -99,9 +101,20 @@ export default function TagCard(props) { return ( - - Tag - + + + + Tag + + + + + + + + + + goToTags()}> {repoName && `${repoName}:`} {tag}