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

Task 20 event tag desktop #35

Merged
merged 7 commits into from
Mar 19, 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
27 changes: 27 additions & 0 deletions src/assets/css/events/EventTag.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.container {
display: flex;
margin: 5px;
padding: 5px;
border-radius: 10px;
}

.container:hover {
cursor: pointer;
}

.font {
font-family: "DM Sans";
font-size: 10px;
font-style: normal;
font-weight: bold;
line-height: normal;
}

.fontBlack {
color: #151515;

}

.fontWhite {
color: #ffffff;
}
10 changes: 10 additions & 0 deletions src/components/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ export const BREAKPOINTS = {
XL: 1200,
XXL: 1400
}

export const EVENT_TAG_COLORS = {
SD: '#528EE8',
ML: '#8BCA80',
BC: '#EA5959',
Q: '#C179B9',
IA: '#7DCACF',
ER: '#FDCE55',
PC: '#0C1747',
}
29 changes: 29 additions & 0 deletions src/components/events/EventTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import styles from "css/events/EventTag.module.css";
import { EVENT_TAG_COLORS } from "../constants";

interface EventTagProps {
name: string;
datetime: Date;
backgroundColor: string;
}

const EventTag = ({
name,
backgroundColor,
}: EventTagProps) => {
return (
<div className={`${styles.container} ${styles.font}`} style={{ backgroundColor }}>
<span
className={
backgroundColor == EVENT_TAG_COLORS.PC
? styles.fontWhite
: styles.fontBlack
}
>
{name}
</span>
</div>
);
};

export default EventTag;
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ enableMocking().then(() => {
</QueryClientProvider>
</React.StrictMode>,
)
})
})
18 changes: 18 additions & 0 deletions src/routes/events/EventPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { EVENT_TAG_COLORS } from "@/components/constants";
import EventTag from "@/components/events/EventTag";

function EventPage() {
return (
<>
<EventTag name={'Event Test 1 - Software Development'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.SD} />
<EventTag name={'Event Test 2 - Machine Learning'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.ML} />
<EventTag name={'Event Test 3 - Blockchain'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.BC} />
<EventTag name={'Event Test 4 - Quant'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.Q} />
<EventTag name={'Event Test 5 - Internal Affairs'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.IA} />
<EventTag name={'Event Test 6 - External Relations'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.ER} />
<EventTag name={'Event Test 7 - Presidential Cell'} datetime={new Date()} backgroundColor={EVENT_TAG_COLORS.PC} />
</>
)
}

export default EventPage
5 changes: 5 additions & 0 deletions src/routes/router.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createBrowserRouter } from "react-router-dom";
import TestPage from "./shared/TestPage.tsx";
import App from "./App.tsx"
import EventPage from "./events/EventPage.tsx";


const router = createBrowserRouter([
Expand All @@ -11,6 +12,10 @@ const router = createBrowserRouter([
{
path: "/test",
Component: TestPage,
},
{
path: "/events",
Component: EventPage,
}
])

Expand Down
Loading