Skip to content
Snippets Groups Projects
Commit c50e39c4 authored by Maximilian Sjöström's avatar Maximilian Sjöström
Browse files

start of the categories page made

parent 4228cf85
No related branches found
No related tags found
1 merge request!4Categories
......@@ -5,6 +5,8 @@ import About from './About';
import Profile from './Profile';
import Charts from './Charts';
import ResponsiveAppBar from './components/ResponsiveAppBar';
import CategoriesPage from './CategoriesPage';
function App() {
const [user, setUser] = useState(null);
......@@ -32,6 +34,7 @@ function App() {
<Route path="/" element={<Home />} />
<Route path="/news" element={<About />} />
<Route path="/Topplistan" element={<Charts />} />
<Route path="/Categories" element={<CategoriesPage />} />
</Routes>
</div>
......
/* CategoriesPage.css */
.categories-container {
padding: 20px;
}
.categories-title {
font-size: 24px;
margin-bottom: 20px;
}
.category-item {
font-size: 18px;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
\ No newline at end of file
import React from 'react';
const categories = [
{ name: 'Men', link: '/category/men' },
{ name: 'Women', link: '/category/women' },
{ name: 'Kids', link: '/category/kids' },
];
const CategoriesPage = () => {
return (
<div style={{ padding: '20px' }}>
<h1 style={{ fontSize: '24px', marginBottom: '20px' }}>Categories</h1>
<div>
{categories.map((category, index) => (
<div
key={index}
style={{
fontSize: '18px',
padding: '10px',
marginBottom: '10px',
border: '1px solid #ccc',
borderRadius: '4px',
cursor: 'pointer' // Add cursor pointer for better UX
}}
onClick={() => { // Navigate to the category link on click
window.location.href = category.link;
}}
>
{category.name}
</div>
))}
</div>
</div>
);
};
export default CategoriesPage;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment