Skip to content

Commit

Permalink
feat: implemented InfoCard
Browse files Browse the repository at this point in the history
  • Loading branch information
knownotunknown authored and doprz committed Mar 6, 2024
1 parent 7dec3c0 commit 21b6430
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/stories/components/InfoCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Meta, StoryObj } from '@storybook/react';
import { InfoCard } from 'src/views/components/common/InfoCard/InfoCard';

const meta = {
title: 'Components/Common/InfoCard',
component: InfoCard,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
titleText: { control: 'text' },
bodyText: { control: 'text' },
},
} satisfies Meta<typeof InfoCard>;
export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
titleText: 'WAITLIST SIZE',
bodyText: '14 Students',
},
};
53 changes: 53 additions & 0 deletions src/views/components/common/InfoCard/InfoCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import Text from '../Text/Text';

interface Props {
titleText: string;
bodyText: string;
}

/**
* A maybe reusable InfoCard component that follows the design system of the extension.
* @returns
*/
export function InfoCard({
titleText,
bodyText
}: React.PropsWithChildren<Props>): JSX.Element {
return (
<div style = {{
display: "flex",
width: "200px",
minWidth: "200px",
maxWidth: "200px",
padding: "15px",
flexDirection: "column",
justifyContent: "center",
alignItems: "flex-start",
borderRadius: "4px",
border: "1px solid #D6D2C4",
background: "#FFF" //White
}}>
<div style = {{
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
gap: "7px",
alignSelf: "stretch",
}}>
<Text variant = "h4" as = 'span'
style = {{
color: '#F8971F', //Orange
}}>
{titleText}
</Text>
<Text variant = "small" as = 'span'
style = {{
color: '#333F48', //Black
}}>
{bodyText}
</Text>
</ div>
</div>
);
}

0 comments on commit 21b6430

Please sign in to comment.