Skip to content

Commit

Permalink
Merge into feature/eventDetailsComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenttannos committed Dec 13, 2024
2 parents ee827ea + 908ef04 commit 4c74907
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap"
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
rel="stylesheet"
/>
<title>Pyramids</title>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type ButtonProps = {
icon?: ButtonIcons;
variant?: ButtonVariants;
className?: string;
type: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
type: React.ButtonHTMLAttributes<HTMLButtonElement>["type"];
};

function Button(props: ButtonProps) {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/EventDetails/EventDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
UserIcon,
} from "@heroicons/react/24/outline";
import Keyword from "../Keyword/Keyword";
import { KeywordOptions } from "../Keyword/KeywordTypes";

type EventDetailsProps = {
image: string;
Expand Down Expand Up @@ -99,7 +98,7 @@ function EventDetails(props: EventDetailsProps) {
{props.keywords && (
<section className={classes.keywords}>
{props.keywords?.map((keyword) => (
<Keyword type={KeywordOptions.None}>{keyword}</Keyword>
<Keyword>{keyword}</Keyword>
))}
</section>
)}
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/Keyword/Keyword.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
height: 24px;
}

.DeleteKeyword {
.keywordDelete {
background: hsl(0, 3%, 93%);
color: hsl(0, 0%, 25%);
}

.AddKeyword {
.keywordAdd {
background: hsl(209, 100%, 96%);
color: hsl(202, 15%, 25%);
}

.NoneKeyword {
.keywordNone {
background: hsl(0, 3%, 93%);
border-radius: 8px;
margin: 0;
Expand All @@ -44,12 +45,12 @@
}

.deleteButtonIcon {
color: hsl(0, 0%, 54%);
color: hsl(0, 0%, 44%);
width: 22px;
height: 22px;
margin-top: 1px;
}

.addButtonIcon {
color: hsl(202, 15%, 25%);
color: hsl(202, 14%, 31%);
}
25 changes: 10 additions & 15 deletions frontend/src/Keyword/Keyword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@ import { KeywordOptions } from "./KeywordTypes";

type KeywordProps = {
children: string;
type: KeywordOptions;
type?: KeywordOptions;
};

export default function Keyword(props: KeywordProps) {
return (
<div
className={`${classes.keyword} ${
props.type === KeywordOptions.Delete && classes.DeleteKeyword
}
${props.type === KeywordOptions.Add && classes.AddKeyword}
${props.type === KeywordOptions.None && classes.NoneKeyword}`}
props.type && props.type === KeywordOptions.Add
? classes.keywordAdd
: classes.keywordDelete
} ${!props.type && classes.keywordNone}`}
>
<div className={classes.keywordText}>{props.children}</div>
{props.type !== KeywordOptions.None && (
{props.type && (
<button className={classes.button}>
{props.type === KeywordOptions.Delete && (
<XMarkIcon
className={`${classes.deleteButtonIcon} ${classes.icon}`}
/>
)}
{props.type === KeywordOptions.Add && (
<PlusIcon
className={`${classes.deleteButtonIcon} ${classes.icon}`}
/>
{props.type === KeywordOptions.Add ? (
<PlusIcon className={`${classes.addButtonIcon} ${classes.icon}`} />
) : (
<XMarkIcon className={`${classes.deleteButtonIcon} ${classes.icon}`} />
)}
</button>
)}
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/Keyword/KeywordTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export enum KeywordOptions {
Delete,
Add,
None,
Delete = "delete",
Add = "add",
}

0 comments on commit 4c74907

Please sign in to comment.