From 24d64baa537678ccbe42423be4b7b17d5e9b14ab Mon Sep 17 00:00:00 2001 From: zlrkw11 <64724157+zlrkw11@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:17:31 +1200 Subject: [PATCH] 618 events card (#627) * set up files * set up story * ran yarn * interface 4 props * structure of display * destructure * prettier * test * title style * margin for all, date * location * divider made * styled * spacing * top margin for location * removed divs * divider style * example text * title * responsive width * text centered for phones * button added * button + onClick handler * fixed according to BENSON's comment * optional prop set * styling padding --- .../generic/EventsCard/EventsCard.story.tsx | 19 ++++++++++ .../generic/EventsCard/EventsCard.tsx | 35 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 client/src/components/generic/EventsCard/EventsCard.story.tsx create mode 100644 client/src/components/generic/EventsCard/EventsCard.tsx diff --git a/client/src/components/generic/EventsCard/EventsCard.story.tsx b/client/src/components/generic/EventsCard/EventsCard.story.tsx new file mode 100644 index 000000000..796e4c5c3 --- /dev/null +++ b/client/src/components/generic/EventsCard/EventsCard.story.tsx @@ -0,0 +1,19 @@ +/* eslint-disable no-irregular-whitespace */ +import type { Meta, StoryObj } from "@storybook/react" + +import EventsCard from "./EventsCard" +const meta: Meta = { + component: EventsCard +} +export default meta +type Story = StoryObj + +export const DefaultEventsCard: Story = { + tags: ["autodocs"], + args: { + title: "Outdoor Clubs Welcome Party", + date: "THU 18/7 • 6pm", + location: "Shadows Bar - 8 Alfred St, CBD, Auckland", + content: `Get ready to kick off Re-O-Week with a bang!  Join us at Shadows Bar for the ultimate Outdoor Clubs Welcome Party, hosted by UoA Snowsports Club! Whether you're into hiking, biking, skiing, or just having a good time, this is the place to be!` + } +} diff --git a/client/src/components/generic/EventsCard/EventsCard.tsx b/client/src/components/generic/EventsCard/EventsCard.tsx new file mode 100644 index 000000000..fe4baea35 --- /dev/null +++ b/client/src/components/generic/EventsCard/EventsCard.tsx @@ -0,0 +1,35 @@ +import Button from "../FigmaButtons/FigmaButton" + +interface EventsCardProps { + date?: string + title: string + location?: string + content: React.ReactNode + onClick: () => void +} + +type props = EventsCardProps + +const EventsCard = ({ date, title, location, content, onClick }: props) => { + const Divider = () => { + return
+ } + return ( +
+
{date}
+ +

{title}

+ +
{location}
+ + +
{content}
+ +
+ +
+
+ ) +} + +export default EventsCard