Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added outline variant for cancel button #72

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/global/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
interface ButtonProps {
children: string | number;
onClick: () => void;
variant?: "default" | "outline";
}

const Button = ({ children, onClick }: ButtonProps) => {
const Button = ({ children, onClick, variant = "default" }: ButtonProps) => {
return (
<button
className="rounded-md bg-starlight-blue px-8 py-2 font-serif text-white hover:opacity-80"
className={`rounded-md px-8 py-2 font-serif hover:opacity-80 ${
variant === "outline"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outline wont be the only variant we have, so it should be able to handle multiple variants nicely

? "border border-starlight-blue bg-white text-starlight-blue"
: "bg-starlight-blue text-white"
}`}
onClick={onClick}
>
{children}
Expand Down
4 changes: 3 additions & 1 deletion src/components/programs/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ const Add = () => {
/>
<AlertDialogFooter>
<AlertDialogCancel asChild>
<Button onClick={() => {}}>Cancel</Button>
<Button onClick={() => {}} variant="outline">
Cancel
</Button>
</AlertDialogCancel>
<AlertDialogAction asChild>
<Button onClick={() => {}}>Add</Button>
Expand Down
Loading