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

4 frontend statscard component #10

Merged
merged 7 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
22 changes: 19 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
"use client";

import ExampleButton from "@components/ExampleButton";
import StatsCard from "@components/StatsCard";

export default function Home() {
return (
<div className="flex items-center justify-center h-screen">
{/* Example Button (ExampleButton.tsx in components folder) */}
<ExampleButton buttonText="Add User" />
<StatsCard
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I forgot but can you remove the components from this file before you merge?

heading = "Total Volunteers"
value = "50"
icon = "formkit:people" //icon id
date = "October 5, 2024"
/>
<StatsCard
heading = "Total Volunteers hours"
value = "200"
icon = "bitcoin-icons:clock-outline" //icon id
date = "October 5, 2024"
/>
<StatsCard
heading = "Total Events"
value = "14"
icon = "mdi-light:calendar" //icon id
date = "October 5, 2024"
/>
</div>
);
}
39 changes: 39 additions & 0 deletions src/components/StatsCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import { Icon } from "@iconify/react/dist/iconify.js";

interface StatsCardProps {
heading: string;
value: number | string;
date: string;
icon: string;
}

const StatsCard = ({ heading, value, icon, date }: StatsCardProps) => {
return (
<div className="w-[360px] h-[160px] h-40 px-6 py-4 bg-white rounded-lg shadow border border-[#e4e7ec] flex-col justify-start items-start gap-4 inline-flex">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: h-[160px] and h-40 do the same thing so you can remove one

<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">{heading}</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-2 inline-flex">
<div className="self-stretch text-[#0f1728] text-5xl font-semibold font-['Kepler Std'] leading-[60px]">{value}</div>
<div className="self-stretch justify-start items-center gap-2 inline-flex">
<div className="grow shrink basis-0 text-[#475466] py-1 text-sm font-medium font-['Inter'] leading-tight">{date}</div>
</div>
</div>
</div>
</div>
<div className="w-[110px] h-[110px] relative">
<Icon icon={icon} className="size-full" style={{ color: '#33BDB5' }} />
</div>
</div>
</div>

);
};

export default StatsCard;