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

🔘 Add Button Component #15

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 7 additions & 5 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import "./App.css";
import Event from "./Event/Event";
import { Keyword, KeywordOptions } from "./Keyword/Keyword";
import bbq from "./assets/bbq.png";
import NavBar from './NavBar/NavBar';
import NavBar from "./NavBar/NavBar";
import Button, { ButtonOptions } from "./Button/Button";

function App() {
return (
Expand All @@ -26,11 +27,12 @@ function App() {
<Keyword type={KeywordOptions.Delete}>Frunk Dwindleward</Keyword>
<Keyword type={KeywordOptions.Delete}>Frunk Dwindleward</Keyword>
<Keyword type={KeywordOptions.Delete}>Frunk Dwindleward</Keyword>
<NavBar
profileImage="https://i.redd.it/white-pharaoh-in-school-textbook-v0-fgr8oliazlkd1.jpg?width=225&format=pjpg&auto=webp&s=04dc4c2c8a0170c4e161091673352cd966591475"
></NavBar>
<Button type={ButtonOptions.Plus}></Button>
<Button type={ButtonOptions.Bookmark}></Button>
<Button type={ButtonOptions.String}>Log in</Button>
<NavBar profileImage="https://i.redd.it/white-pharaoh-in-school-textbook-v0-fgr8oliazlkd1.jpg?width=225&format=pjpg&auto=webp&s=04dc4c2c8a0170c4e161091673352cd966591475"></NavBar>
</>
);
}

export default App;
export default App;
28 changes: 28 additions & 0 deletions frontend/src/Button/Button.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.button {
background: hsl(203, 88%, 27%);
border: 0px;
border-radius: 8px;
width: fit-content;
font-size: 24px;
color: hsl(202, 49%, 90%);
display: flex;
align-items: center;
justify-content: center;
padding: 0px;
margin: 0px;
box-shadow: 0px 0px 4px hsla(0, 0%, 0%, 0.25);
}

.button:hover {
background-color: hsl(202, 49%, 90%);
color: hsla(0, 0%, 0%);
}

.icon {
height: 64px;
padding: 16px;
}

.string {
padding: 12px 28px;
}
34 changes: 34 additions & 0 deletions frontend/src/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { PlusIcon } from "@heroicons/react/24/solid";
import classes from "./Button.module.css";
import { BookmarkIcon } from "@heroicons/react/24/outline";

export enum ButtonOptions {
String,
Plus,
Bookmark,
}

type ButtonProps = {
children?: string;
type: ButtonOptions;
};

function Button(props: ButtonProps) {
return (
<button className={classes.button}>
{props.type === ButtonOptions.Plus && (
<PlusIcon className={classes.icon}></PlusIcon>
)}

{props.type === ButtonOptions.Bookmark && (
<BookmarkIcon className={classes.icon}></BookmarkIcon>
)}

{props.type === ButtonOptions.String && (
<span className={classes.string}>{props.children}</span>
)}
</button>
);
}

export default Button;
Loading