Skip to content

Commit

Permalink
added examples page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasank123k committed Jun 23, 2024
1 parent 94c9bd5 commit 0e8be42
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Home from './pages/Home/Home';
import Components from './pages/Components/Components';
import Utilities from './pages/Utilities';
import Documentation from './pages/Documentation';
import Examples from './pages/Examples';
import Examples from './pages/Examples/Examples';
import SignUp from './pages/SignUp/SignUp';
import Login from './pages/Login/Login';

Expand Down
7 changes: 0 additions & 7 deletions src/pages/Examples.tsx

This file was deleted.

79 changes: 79 additions & 0 deletions src/pages/Examples/Examples.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.examplesPage {
padding: 20px;
text-align: center;
}

.heading {
font-size: 2.5rem;
margin-bottom: 20px;
}

.examplesGrid {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
}

.exampleBox {
width: 300px;
border: 1px solid #ddd;
border-radius: 8px;
padding: 16px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}

.exampleBox:hover {
transform: translateY(-10px);
}

.image {
width: 100%;
height: auto;
border-radius: 4px;
}

.title {
font-size: 1.5rem;
margin: 16px 0;
}

.description {
font-size: 1rem;
color: #555;
margin-bottom: 16px;
}

.buttons {
display: flex;
justify-content: space-between;
}

.demoButton,
.downloadButton {
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}

.demoButton {
background-color: #007bff;
color: #fff;
}

.demoButton:hover {
background-color: #0056b3;
}

.downloadButton {
background-color: #28a745;
color: #fff;
}

.downloadButton:hover {
background-color: #218838;
}

77 changes: 77 additions & 0 deletions src/pages/Examples/Examples.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import React from 'react';

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

'React' is declared but its value is never read.

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'title' implicitly has an 'any' type.

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'description' implicitly has an 'any' type.

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'demoLink' implicitly has an 'any' type.

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'downloadLink' implicitly has an 'any' type.

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

Binding element 'imageUrl' implicitly has an 'any' type.

Check failure on line 1 in src/pages/Examples/Examples.tsx

View workflow job for this annotation

GitHub Actions / Build

'navigate' is declared but its value is never read.
import styles from './Examples.module.css';
import { useNavigate } from 'react-router-dom';

const Example = ({ title, description, demoLink, downloadLink, imageUrl }) => (
<div className={styles.exampleBox}>
<img src={imageUrl} alt={`${title} screenshot`} className={styles.image} />
<h2 className={styles.title}>{title}</h2>
<p className={styles.description}>{description}</p>
<div className={styles.buttons}>
<button onClick={() => window.location.href = demoLink} className={styles.demoButton}>Show Demo</button>
<button onClick={() => window.location.href = downloadLink} className={styles.downloadButton}>Download</button>
</div>
</div>
);

const Examples = () => {
const navigate = useNavigate();

const examples = [
{
title: 'Template 1',
description: 'A modern and responsive template for businesses.',
demoLink: '/examples/template1',
downloadLink: '/downloads/template1.zip',
imageUrl: 'https://via.placeholder.com/400x300',
},
{
title: 'Template 2',
description: 'A clean and minimalist template for portfolios.',
demoLink: '/examples/template2',
downloadLink: '/downloads/template2.zip',
imageUrl: 'https://via.placeholder.com/400x300',
},
{
title: 'Template 3',
description: 'A vibrant and dynamic template for startups.',
demoLink: '/examples/template3',
downloadLink: '/downloads/template3.zip',
imageUrl: 'https://via.placeholder.com/400x300',
},
{
title: 'Template 4',
description: 'A professional template for corporate websites.',
demoLink: '/examples/template4',
downloadLink: '/downloads/template4.zip',
imageUrl: 'https://via.placeholder.com/400x300',
},
{
title: 'Template 5',
description: 'An elegant template for blogs and magazines.',
demoLink: '/examples/template5',
downloadLink: '/downloads/template5.zip',
imageUrl: 'https://via.placeholder.com/400x300',
},
];

return (
<div className={styles.examplesPage}>
<h1 className={styles.heading}>Examples</h1>
<div className={styles.examplesGrid}>
{examples.map((example, index) => (
<Example
key={index}
title={example.title}
description={example.description}
demoLink={example.demoLink}
downloadLink={example.downloadLink}
imageUrl={example.imageUrl}
/>
))}
</div>
</div>
);
};

export default Examples;

0 comments on commit 0e8be42

Please sign in to comment.