Skip to content

Commit

Permalink
chore: add rules to events
Browse files Browse the repository at this point in the history
  • Loading branch information
Shurtu-gal committed Oct 27, 2023
1 parent 0e16d9c commit 82958be
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
33 changes: 26 additions & 7 deletions src/components/EventCard/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Front,
KnowButton,
} from './styles';
import { Body2 } from '../shared';
import { Body2, ButtonText } from '../shared';
import { AuthContext } from '../../utils/Auth';
import Api from '../../utils/Api';

Expand Down Expand Up @@ -60,7 +60,7 @@ const EventCard = ({ event, registered }) => {
);
};

const { title, club, venue, time, date, month, prizes, description, contact, poster } = event;
const { title, club, time, date, month, prizes, description, contact, poster, rules } = event;

const flipCard = () => {
setIsFlipped(!isFlipped);
Expand All @@ -80,7 +80,17 @@ const EventCard = ({ event, registered }) => {
{date} {month}
<Circle />
{time}
<Circle />
{rules ? (
<>
{' '}
<Circle />{' '}
<ButtonText outline>
<a href={rules} target='_blank' rel='noreferrer'>
Rules
</a>
</ButtonText>
</>
) : null}
</EventTimeVenue>
</CardTitleContainer>
<CardTitleContainer>
Expand All @@ -105,19 +115,28 @@ const EventCard = ({ event, registered }) => {
<EventClub>{club}</EventClub>
</CardTitleContainer>
<CardTitleContainer>
Prize - {prizes}
{prizes ? `Prize - ${prizes}` : null}
<EventTimeVenue style={{ paddingTop: '0.1rem' }}>
{date} {month}
<Circle />
{venue}
{rules ? (
<>
{' '}
<Circle />{' '}
<ButtonText outline>
<a href={rules} target='_blank' rel='noreferrer'>
Rules
</a>
</ButtonText>
</>
) : null}
</EventTimeVenue>
</CardTitleContainer>
<BackDescriptionContainer>
{description?.map(({ id, desc }) => (
<BackDescription key={id}>{desc}</BackDescription>
))}
</BackDescriptionContainer>
{contact ? <Body2>Contact: {contact?.join(', ')}</Body2> : null}
{contact.length ? <Body2>Contact: {contact?.join(', ')}</Body2> : null}
<CardButtonContainer>
<KnowButton text='Back' onClick={bringToFront} />
<EventRegisterButton
Expand Down
1 change: 1 addition & 0 deletions src/utils/useEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const useEvents = (eventName) => {
contact: event.contact,
venue: 'LA',
prizes: event.prizeMoney,
rules: event.rules,
poster: event.poster ? event.poster : 'TODO://link',
priority: event.priority,
};
Expand Down

0 comments on commit 82958be

Please sign in to comment.