Skip to content

Commit

Permalink
fix duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Feb 21, 2024
1 parent 066310e commit 84b322e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 36 deletions.
18 changes: 18 additions & 0 deletions packages/shared-ui/src/cards/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styles from "./cards.module.css";

interface CardProps {
href: string;
title: string;
description: string;
}

export function Card({ href, title, description }: CardProps) {
return (
<a className={styles.card} href={href} rel="noopener noreferrer" target="_blank">
<h2>
{title} <span>-&gt;</span>
</h2>
<p>{description}</p>
</a>
);
}
16 changes: 0 additions & 16 deletions packages/shared-ui/src/cards/docs-card.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions packages/shared-ui/src/cards/examples-card.tsx

This file was deleted.

21 changes: 17 additions & 4 deletions packages/shared-ui/src/cards/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import { ExamplesCard } from "./examples-card";
import styles from "./cards.module.css";
import { StarMeCard } from "./star-me-card";
import { DocsCard } from "./docs-card";
import { Card } from "./card";

const cards = [
{
href: "https://react18-tools.github.io/r18gs/",
title: "Docs",
description: "Explore the official docs.",
},
{
href: "https://github.com/react18-tools/r18gs",
title: "More Examples",
description: "Explore more examples on official GitHub Repo.",
},
];

export function Cards() {
return (
<div className={styles.cards}>
<DocsCard />
<ExamplesCard />
{cards.map(card => (
<Card key={card.href} {...card} />
))}
<StarMeCard />
</div>
);
Expand Down

0 comments on commit 84b322e

Please sign in to comment.