Skip to content

Commit

Permalink
drop menu added
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeManSu committed Jul 9, 2024
1 parent 0db3280 commit 75337bc
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 66 deletions.
119 changes: 87 additions & 32 deletions mango-frontend/src/components/Create Issue/CreateIssue.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,122 @@

import { Button } from "@/components/ui/button"
import * as React from "react";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
DialogClose
} from "@/components/ui/dialog"
import { Input } from "@/components/ui/input"
import { Textarea } from "@/components/ui/textarea"
DialogClose,
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuLabel,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";

interface CreateIssueProps {
isOpen: boolean;
onClose: () => void;
}

export function CreateIssue({ isOpen, onClose }: CreateIssueProps) {
const StateDropdown: React.FC = () => {
const [position, setPosition] = React.useState("bottom");

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button className="border-2">Backlog</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56">
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuRadioGroup value={position} onValueChange={setPosition}>
<DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
);
};
const PriorityDropdown: React.FC = () => {
const [position, setPosition] = React.useState("bottom");

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button className="border-2">Low</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56">
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuRadioGroup value={position} onValueChange={setPosition}>
<DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
);
};

const AssigneesDropdown: React.FC = () => {
const [position, setPosition] = React.useState("bottom");

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button className="border-2">Low</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56">
<DropdownMenuLabel>Panel Position</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuRadioGroup value={position} onValueChange={setPosition}>
<DropdownMenuRadioItem value="top">Top</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="bottom">Bottom</DropdownMenuRadioItem>
<DropdownMenuRadioItem value="right">Right</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
);
};

export function CreateIssue({ isOpen, onClose }: CreateIssueProps) {
return (
<Dialog open={isOpen} onOpenChange={onClose}>
<DialogContent className="">
<DialogContent>
<DialogHeader>
<DialogTitle>Create Issue</DialogTitle>
</DialogHeader>
<div className="flex items-center space-x-2">
<div className="grid flex-1 gap-2">
<Input
type="text"
placeholder="Title"
/>
<Input type="text" placeholder="Title" />
</div>
</div>
<div>
<Textarea
placeholder="Click to add description"
/>
<Textarea placeholder="Click to add description" />
</div>
<div className="flex gap-5 justify-around">
<Button className="border-2">
Backlog
</Button>
<Button className="border-2">
Low
</Button>
<Button className="border-2">
Assignes
</Button>
<Button className="border-2">
Sprint
</Button>
<StateDropdown />
<PriorityDropdown />
<AssigneesDropdown />
<Button className="border-2">Sprint</Button>
</div>
<DialogFooter className="" >
<DialogFooter className="flex justify-between">
<DialogClose asChild>
<Button type="button" variant="secondary" onClick={onClose}>
Close
</Button>
</DialogClose>
<Button className="border-2">
Create Issue
</Button>
<Button className="border-2">Create Issue</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
);
}
34 changes: 0 additions & 34 deletions mango-frontend/src/components/Create Issue/State.tsx

This file was deleted.

0 comments on commit 75337bc

Please sign in to comment.