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

Event card #25

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 13 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
"use client";
import React from "react";
import EventCard from "@components/EventCard";

export default function Home() {
return <div className="flex items-center justify-center h-screen"></div>;
return (
<div className="flex items-center justify-center h-screen">
<EventCard
title="Dewick Community Meal"
date="12:30 PM - 9:30 PM"
address="25 Latin Way, Medford, MA 02155"
volunteers={25}
maxVolunteers={25}
/>
</div>
);
}
74 changes: 74 additions & 0 deletions src/components/EventCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from "react";
import { Icon } from "@iconify/react/dist/iconify.js";

interface EventCardProps {
title: string;
date: string;
address: string;
volunteers: number;
maxVolunteers: number;
}

const EventCard = ({
title,
date,
address,
volunteers,
maxVolunteers,
}: EventCardProps) => {
const isFull = volunteers === maxVolunteers ? true : false;
const volunteerText = volunteers + "/" + maxVolunteers + " volunteers";
return (
<div className="w-[360px] h-auto px-5 py-5 bg-white rounded-lg shadow border-1 border-[#e4e7ec] flex-col justify-start items-start gap-4 inline-flex">
<div className="self-stretch justify-start items-center inline-flex">
<div className="grow shrink basis-0 flex-col justify-start items-start gap-4 inline-flex">
<div className="self-stretch justify-start items-start gap-2 inline-flex">
<div className="w-full grow shrink basis-0 text-[#101828] text-base font-semibold font-['Sofia Pro'] leading-[18px] ">
{title}
</div>
</div>
<div className="self-stretch justify-start items-end gap-4 inline-flex">
<div className="grow shrink basis-0 flex-col justify-start items-start gap-3 inline-flex">
<div className="w-full self-stretch flex flex-row items-center text-[#344054] text-sm font-medium font-['Sofia Pro'] text-[14px] leading-[20px]">
<Icon
icon="mdi:clock-outline"
width="12"
height="12"
className="mr-2"
/>
{date}
</div>
<div className="w-full self-stretch flex flex-row items-center text-[#344054] text-sm font-medium font-['Sofia Pro'] text-[14px] leading-[20px]">
<Icon
icon="mingcute:location-line"
width="12"
height="12"
className="mr-2"
/>
{address}
</div>
<div className="w-full border-b border-0.5 border-[#F2F4F7]">
{" "}
</div>
<div className="self-stretch justify-start items-center inline-flex">
<div
className={`w-[153px] h-[20px] grow shrink basis-0 text-[#475466] text-sm font-medium font-['Sofia Pro'] pr-3 text-[14px] font-semibold leading-[20px] ${
isFull ? "text-[#E61932]" : "text-[#558D22]"
}`}
>
{volunteerText}
</div>
<button className="flex justify-end flex-row gap-x-2 bg-teal-600 px-3.5 py-1 text-white rounded-lg place-items-center text-[14px] font-semibold leading-[20px]">
See details
<Icon icon="formkit:arrowright" width="20" height="21" />
</button>
</div>
</div>
</div>
</div>
</div>
</div>
);
};

export default EventCard;
4 changes: 2 additions & 2 deletions src/components/StatsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ interface StatsCardProps {

const StatsCard = ({ heading, value, icon, date }: StatsCardProps) => {
return (
<div className="w-[360px] h-[160px] px-6 py-4 bg-white rounded-lg shadow border border-[#e4e7ec] flex-col justify-start items-start gap-4 inline-flex">
<div className="self-stretch justify-start items-center gap-2 inline-flex">
<div className="w-[360px] h-[188px] px-6 py-4 bg-white rounded-lg shadow border border-[#e4e7ec] flex-col justify-start items-start gap-4 inline-flex">
<div className="self-stretch justify-start items-center gap-2 inline-flex">
<div className="grow shrink basis-0 flex-col justify-start items-start gap-4 inline-flex">
<div className="self-stretch justify-start items-start gap-2 inline-flex">
<div className="grow shrink basis-0 text-[#344053] text-base font-semibold font-['Sofia Pro'] leading-normal">
Expand Down