Skip to content

Commit 05f9fdd

Browse files
committed
added delete issue button
1 parent 1de23e6 commit 05f9fdd

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Button } from "@radix-ui/themes";
2+
import React from "react";
3+
4+
const DeleteIssueButton = ({ issueId }: { issueId: number }) => {
5+
return <Button color="red">Delete Issue</Button>;
6+
};
7+
8+
export default DeleteIssueButton;

app/issues/[id]/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import prisma from "@/prisma/client";
2-
import { Box, Grid } from "@radix-ui/themes";
2+
import { Box, Flex, Grid } from "@radix-ui/themes";
33
import { notFound } from "next/navigation";
44
import EditIssueButton from "./EditIssueButton";
55
import IssueDetails from "./IssueDetails";
6+
import DeleteIssueButton from "./DeleteIssueButton";
67

78
interface Props {
89
params: Promise<{
@@ -21,12 +22,15 @@ const IssueDetailPage = async ({ params }: Props) => {
2122
if (!issue) notFound();
2223

2324
return (
24-
<Grid columns={{ initial: "1", sm: "2" }} gap="4">
25-
<Box>
25+
<Grid columns={{ initial: "1", sm: "5" }} gap="5">
26+
<Box className="md:col-span-4">
2627
<IssueDetails issue={issue} />
2728
</Box>
2829
<Box>
29-
<EditIssueButton issueId={issue.id} />
30+
<Flex direction="column" gap="4">
31+
<EditIssueButton issueId={issue.id} />
32+
<DeleteIssueButton issueId={issue.id} />
33+
</Flex>
3034
</Box>
3135
</Grid>
3236
);

app/layout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Metadata } from "next";
44
import { Geist, Geist_Mono } from "next/font/google";
55
import "./globals.css";
66
import NavBar from "./NavBar";
7-
import { Theme } from "@radix-ui/themes";
7+
import { Container, Theme } from "@radix-ui/themes";
88

99
const geistSans = Geist({
1010
variable: "--font-geist-sans",
@@ -33,7 +33,9 @@ export default function RootLayout({
3333
>
3434
<Theme accentColor="plum" radius="large">
3535
<NavBar />
36-
<main className="p-5">{children}</main>
36+
<main className="p-5">
37+
<Container>{children}</Container>
38+
</main>
3739
</Theme>
3840
</body>
3941
</html>

0 commit comments

Comments
 (0)