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

Update to Pages and flow for Saas #12

Open
wants to merge 3 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
8 changes: 8 additions & 0 deletions src/components/CardSaas/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.card {
flex-direction: column;
width: 250px;
max-width: 250px;
box-shadow: 0px 0px 27px 6px rgba(229, 9, 20, 0.6);
border-radius: 11px;
padding: 15px 10px;
}
111 changes: 111 additions & 0 deletions src/components/CardSaas/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { Flex, Button, Image, Spacer, Tooltip, FormControl, FormLabel, Link } from "@chakra-ui/react";

import "./index.css";

type CardProps = {
isUser?: boolean;
primaryLabel: string;
secondaryLabel: string;
description?: string;
descriptionLink?: string;
imageSrc?: string;
primaryButtonLabel: string;
primaryButtonAction: () => void;
secondaryButtonLabel?: string;
secondaryButtonAction?: () => void;
};

function Card({
isUser,
primaryLabel,
secondaryLabel,
description,
imageSrc,
primaryButtonLabel,
primaryButtonAction,
secondaryButtonLabel,
secondaryButtonAction,
}: CardProps) {
return (
<Flex className="card">
<Flex className="card-header" justifyContent="space-between">
<FormControl mb={2}>
<FormLabel
className="status"
size="ml"
fontSize={40}
borderRadius={25}
>
{secondaryLabel}
</FormLabel>
<Link
className="action"
size="sm"
borderRadius={25}
>
{primaryLabel}
</Link>

<Spacer />

</FormControl>
</Flex>

<Flex className="card-body" flexDirection="column" py={5}>
{description && (
<Tooltip label={description}>View owner guidelines</Tooltip>
)}

{imageSrc && (
<Image src={imageSrc} height="64px" objectFit={"contain"} />
)}
</Flex>

<Flex className="card-footer" justifyContent="space-between">
{isUser ? (
<>
<Button
className="action"
size="sm"
borderRadius={25}
color="white"
backgroundColor="#266011"
onClick={primaryButtonAction}
>
{primaryButtonLabel}
</Button>

<Spacer />

<Button
className="action"
size="sm"
borderRadius={25}
color="white"
backgroundColor="#266011"
onClick={secondaryButtonAction}
>
{secondaryButtonLabel}
</Button>
</>
) : (
<Flex justifyContent="center" width="100%">
<Button
className="action"
size="sm"
borderRadius={25}
color="white"
backgroundColor="#266011"
width="90%"
onClick={primaryButtonAction}
>
{primaryButtonLabel}
</Button>
</Flex>
)}
</Flex>
</Flex>
);
}

export default Card;
Loading