Skip to content

Commit

Permalink
init homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
salmad3 committed Sep 30, 2024
1 parent 43d677d commit 1935652
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 2 deletions.
47 changes: 47 additions & 0 deletions components/DocCard/DocCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { ExternalLinkIcon } from 'lucide-react';
import Image from 'next/image';

interface DocCardProps {
doc: {
name: string;
logo: {
url: string;
alt: string;
};
link: string;
'short-description': string;
};
}

const DocCard = ({ doc }: DocCardProps) => {
if (!doc) return null;
const { name, logo, link, 'short-description': shortDescription } = doc;

return (
<div className="group flex flex-col bg-gray-50 dark:bg-gray-800 rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-300">
<div className="relative w-full h-48 bg-gray-200 dark:bg-gray-700 flex items-center justify-center">
{logo?.url ? (
<Image src={logo.url} alt={logo.alt} layout="fill" objectFit="cover" className="transition-all duration-300 ease-in-out group-hover:scale-110" />
) : (
<span className="text-gray-400">No image available</span>
)}
</div>
<div className="p-4 flex flex-col flex-grow">
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">{name}</h3>
<p className="text-sm text-gray-600 dark:text-gray-400 mb-4">{shortDescription}</p>
<div className="mt-auto">
<a
href={link}
target="_blank"
rel="noopener noreferrer"
className="text-blue-600 dark:text-blue-400 inline-flex items-center font-medium hover:underline"
>
Learn more <ExternalLinkIcon className="ml-2 w-4 h-4" />
</a>
</div>
</div>
</div>
);
};

export default DocCard;
16 changes: 16 additions & 0 deletions components/DocCard/DocCardsGrid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { docsData } from '../../data/docsData';
import DocCard from './DocCard';

const DocCardsGrid = () => {
return (
<div className="container mx-auto px-4">
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8">
{docsData.map((doc) => (
<DocCard key={doc.id} doc={doc} />
))}
</div>
</div>
);
};

export default DocCardsGrid;
38 changes: 38 additions & 0 deletions data/docsData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export const docsData = [
{
id: 1,
name: "foo",
link: "/docs/deploy-contract",
'short-description': "Learn how to.",
},
{
id: 2,
name: "bar",
link: "/docs/setup-node",
'short-description': "Learn how to.",
},
{
id: 3,
name: "baz",
link: "/docs/stake-tokens",
'short-description': "Learn how to.",
},
{
id: 4,
name: "foo",
link: "/docs/deploy-contract",
'short-description': "Learn how to.",
},
{
id: 5,
name: "bar",
link: "/docs/setup-node",
'short-description': "Learn how to.",
},
{
id: 6,
name: "baz",
link: "/docs/stake-tokens",
'short-description': "Learn how to.",
},
];
4 changes: 3 additions & 1 deletion pages/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"index": "Home",
"start": {
"title": "Getting Started",
"type": "page"
Expand All @@ -23,4 +24,5 @@
"title": "Reference",
"type": "page"
}
}
}

7 changes: 7 additions & 0 deletions pages/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import DocCardsGrid from "../components/DocCard/DocCardsGrid";

# Welcome to Sei Network

<br /><br />

<DocCardsGrid />
2 changes: 1 addition & 1 deletion pages/start/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "separator",
"title": "Introduction"
},
"index": "Overview",
"overview": "Overview",
"user-quickstart": "Quickstart",

"-- Core Setup": {
Expand Down
File renamed without changes.

0 comments on commit 1935652

Please sign in to comment.