-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fetch accepted events and style upcoming events page (#14)
* Created EventListingCard & styled webpage * fixed ESLint error * created separate styling file for event card * created event display page * added menu icon, changed some styling --------- Co-authored-by: Celine Ji-Won Choi <[email protected]>
- Loading branch information
1 parent
7ba463c
commit 3296bd8
Showing
8 changed files
with
261 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use client'; | ||
|
||
import NextImage from 'next/image'; | ||
import styled from 'styled-components'; | ||
import COLORS from '@/styles/colors'; | ||
import { H3, H6 } from '@/styles/text'; | ||
|
||
export const Image = styled(NextImage)` | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
margin: 1rem; | ||
`; | ||
|
||
export const Page = styled.main` | ||
background-color: ${COLORS.gray1}; | ||
flex-direction: column; | ||
min-width: 100%; | ||
min-height: 100svh; | ||
overflow: hidden; | ||
`; | ||
|
||
export const AllEventsHolder = styled.main` | ||
padding-left: 1.5rem; | ||
padding-right: 1.5rem; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.5rem; | ||
`; | ||
|
||
export const Title = styled(H3)` | ||
font-style: normal; | ||
line-height: normal; | ||
`; | ||
|
||
export const MonthYear = styled(H6)` | ||
font-style: normal; | ||
line-height: normal; | ||
gap: 1.5rem; | ||
display: flex; | ||
margin-top: 1.25rem; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from 'react'; | ||
import BPLogo from '@/assets/images/bp-logo.png'; | ||
import COLORS from '@/styles/colors'; | ||
import { Event } from '@/types/schema'; | ||
import * as styles from './style'; | ||
|
||
export default function MyEventCard(eventData: Event) { | ||
const eventStart = new Date(eventData.start_date_time); | ||
const eventEnd = new Date(eventData.end_date_time); | ||
|
||
// function to remove 00 from time if time is on the hour, ex: 4:00 PM -> 4 PM | ||
const formatTime = (date: Date) => { | ||
const minutes = date.getMinutes(); | ||
|
||
return minutes === 0 | ||
? date.toLocaleTimeString([], { hour: 'numeric', hour12: true }) | ||
: date.toLocaleTimeString([], { | ||
hour: 'numeric', | ||
minute: '2-digit', | ||
hour12: true, | ||
}); | ||
}; | ||
|
||
const startTime = formatTime(eventStart); | ||
const endTime = formatTime(eventEnd); | ||
|
||
const monthNames = [ | ||
'Jan', | ||
'Feb', | ||
'Mar', | ||
'Apr', | ||
'May', | ||
'Jun', | ||
'Jul', | ||
'Aug', | ||
'Sep', | ||
'Oct', | ||
'Nov', | ||
'Dec', | ||
]; | ||
const monthText = monthNames[eventStart.getMonth()]; | ||
|
||
return ( | ||
<styles.EventContainer> | ||
<styles.EventCardContainer> | ||
<styles.BPImage src={BPLogo} alt="Blueprint Logo" /> | ||
<div> | ||
<styles.TimeText $fontWeight="400" $color="#000" $align="left"> | ||
{monthText} {eventStart.getDate()}, {startTime} - {endTime} | ||
</styles.TimeText> | ||
<styles.EventDescriptionText | ||
$fontWeight="500" | ||
$color="#000" | ||
$align="left" | ||
> | ||
placeholder | ||
</styles.EventDescriptionText> | ||
<styles.LocationText | ||
$fontWeight="400" | ||
$color={COLORS.gray10} | ||
$align="left" | ||
> | ||
placeholder | ||
</styles.LocationText> | ||
</div> | ||
</styles.EventCardContainer> | ||
</styles.EventContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
'use client'; | ||
|
||
import NextImage from 'next/image'; | ||
import styled from 'styled-components'; | ||
import { P, SMALLER } from '@/styles/text'; | ||
import COLORS from '../../styles/colors'; | ||
|
||
export const BPImage = styled(NextImage)` | ||
layout: responsive; | ||
width: 20%; | ||
height: 90%; | ||
`; | ||
|
||
export const EventContainer = styled.main` | ||
margin: auto; | ||
width: 100%; | ||
padding-top: 1.5rem; | ||
`; | ||
export const EventCardContainer = styled.main` | ||
width: 100%; | ||
padding: 1rem; | ||
background: ${COLORS.bread1}; | ||
border-radius: 8px; | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
box-shadow: 4px 4px 4px 0px rgba(0, 0, 0, 0.15); | ||
gap: 1.5rem; | ||
`; | ||
|
||
export const TimeText = styled(SMALLER)` | ||
font-style: normal; | ||
line-height: normal; | ||
`; | ||
|
||
export const EventDescriptionText = styled(P)` | ||
font-style: normal; | ||
line-height: normal; | ||
`; | ||
|
||
export const LocationText = styled(SMALLER)` | ||
color: ${COLORS.gray10}; | ||
font-style: normal; | ||
line-height: normal; | ||
`; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters