mirror of
https://github.com/Alvin-Zilverstand/challenge-11.git
synced 2026-03-06 13:21:54 +01:00
Refactor CarModifications component to use SVG icons instead of placeholder images for better visual representation of car modifications. Update icon imports and adjust rendering logic accordingly.
This commit is contained in:
7
client/src/assets/icons/brakes.svg
Normal file
7
client/src/assets/icons/brakes.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" fill="currentColor"/>
|
||||||
|
<path d="M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z" fill="currentColor"/>
|
||||||
|
<path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" fill="currentColor"/>
|
||||||
|
<path d="M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" fill="currentColor"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 678 B |
5
client/src/assets/icons/engine.svg
Normal file
5
client/src/assets/icons/engine.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M7 4v2h3v2H7l-2 2v3H3v-3H1v8h2v-3h2v3h3l2 2h8v-4h2v3h3V9h-3v3h-2V8h-6V6h3V4H7z" fill="currentColor"/>
|
||||||
|
<path d="M18 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z" fill="currentColor"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 368 B |
6
client/src/assets/icons/exhaust.svg
Normal file
6
client/src/assets/icons/exhaust.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M3 12h2v2H3v-2zm4 0h2v2H7v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2z" fill="currentColor"/>
|
||||||
|
<path d="M3 8h2v2H3V8zm4 0h2v2H7V8zm4 0h2v2h-2V8zm4 0h2v2h-2V8zm4 0h2v2h-2V8z" fill="currentColor"/>
|
||||||
|
<path d="M3 16h2v2H3v-2zm4 0h2v2H7v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2z" fill="currentColor"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 463 B |
6
client/src/assets/icons/suspension.svg
Normal file
6
client/src/assets/icons/suspension.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" fill="currentColor"/>
|
||||||
|
<path d="M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z" fill="currentColor"/>
|
||||||
|
<path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" fill="currentColor"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 593 B |
8
client/src/assets/icons/wheels.svg
Normal file
8
client/src/assets/icons/wheels.svg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" fill="currentColor"/>
|
||||||
|
<path d="M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z" fill="currentColor"/>
|
||||||
|
<path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" fill="currentColor"/>
|
||||||
|
<path d="M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" fill="currentColor"/>
|
||||||
|
<path d="M12 12c0 0-2-2-2-2s-2 2-2 2 2 2 2 2 2-2 2-2-2-2-2-2z" fill="currentColor"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 765 B |
@@ -6,14 +6,19 @@ import {
|
|||||||
Paper,
|
Paper,
|
||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
CardMedia,
|
|
||||||
Button,
|
|
||||||
Box,
|
Box,
|
||||||
TextField,
|
TextField,
|
||||||
InputAdornment,
|
InputAdornment,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import SearchIcon from '@mui/icons-material/Search';
|
import SearchIcon from '@mui/icons-material/Search';
|
||||||
|
|
||||||
|
// Import SVG icons
|
||||||
|
import engineIcon from '../assets/icons/engine.svg';
|
||||||
|
import exhaustIcon from '../assets/icons/exhaust.svg';
|
||||||
|
import suspensionIcon from '../assets/icons/suspension.svg';
|
||||||
|
import brakesIcon from '../assets/icons/brakes.svg';
|
||||||
|
import wheelsIcon from '../assets/icons/wheels.svg';
|
||||||
|
|
||||||
const CarModifications = () => {
|
const CarModifications = () => {
|
||||||
const [searchTerm, setSearchTerm] = useState('');
|
const [searchTerm, setSearchTerm] = useState('');
|
||||||
|
|
||||||
@@ -24,7 +29,7 @@ const CarModifications = () => {
|
|||||||
name: 'Performance Chip',
|
name: 'Performance Chip',
|
||||||
description: 'Increase engine power and torque with our custom ECU tuning',
|
description: 'Increase engine power and torque with our custom ECU tuning',
|
||||||
price: '€299',
|
price: '€299',
|
||||||
image: 'https://via.placeholder.com/300x200?text=Performance+Chip',
|
icon: engineIcon,
|
||||||
category: 'Engine',
|
category: 'Engine',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -32,7 +37,7 @@ const CarModifications = () => {
|
|||||||
name: 'Sport Exhaust System',
|
name: 'Sport Exhaust System',
|
||||||
description: 'High-flow exhaust system for better sound and performance',
|
description: 'High-flow exhaust system for better sound and performance',
|
||||||
price: '€599',
|
price: '€599',
|
||||||
image: 'https://via.placeholder.com/300x200?text=Exhaust+System',
|
icon: exhaustIcon,
|
||||||
category: 'Exhaust',
|
category: 'Exhaust',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -40,7 +45,7 @@ const CarModifications = () => {
|
|||||||
name: 'Lowering Springs',
|
name: 'Lowering Springs',
|
||||||
description: 'Sport suspension lowering springs for improved handling',
|
description: 'Sport suspension lowering springs for improved handling',
|
||||||
price: '€399',
|
price: '€399',
|
||||||
image: 'https://via.placeholder.com/300x200?text=Lowering+Springs',
|
icon: suspensionIcon,
|
||||||
category: 'Suspension',
|
category: 'Suspension',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -48,7 +53,7 @@ const CarModifications = () => {
|
|||||||
name: 'Cold Air Intake',
|
name: 'Cold Air Intake',
|
||||||
description: 'Improved air flow for better engine performance',
|
description: 'Improved air flow for better engine performance',
|
||||||
price: '€199',
|
price: '€199',
|
||||||
image: 'https://via.placeholder.com/300x200?text=Cold+Air+Intake',
|
icon: engineIcon,
|
||||||
category: 'Engine',
|
category: 'Engine',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -56,7 +61,7 @@ const CarModifications = () => {
|
|||||||
name: 'Sport Brake Kit',
|
name: 'Sport Brake Kit',
|
||||||
description: 'Upgraded brake system for better stopping power',
|
description: 'Upgraded brake system for better stopping power',
|
||||||
price: '€899',
|
price: '€899',
|
||||||
image: 'https://via.placeholder.com/300x200?text=Brake+Kit',
|
icon: brakesIcon,
|
||||||
category: 'Brakes',
|
category: 'Brakes',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -64,7 +69,7 @@ const CarModifications = () => {
|
|||||||
name: 'Wheel Spacers',
|
name: 'Wheel Spacers',
|
||||||
description: 'Improve stance and handling with wheel spacers',
|
description: 'Improve stance and handling with wheel spacers',
|
||||||
price: '€149',
|
price: '€149',
|
||||||
image: 'https://via.placeholder.com/300x200?text=Wheel+Spacers',
|
icon: wheelsIcon,
|
||||||
category: 'Wheels',
|
category: 'Wheels',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -112,12 +117,26 @@ const CarModifications = () => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CardMedia
|
<Box
|
||||||
component="img"
|
sx={{
|
||||||
height="200"
|
p: 3,
|
||||||
image={mod.image}
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor: 'primary.main',
|
||||||
|
color: 'white',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={mod.icon}
|
||||||
alt={mod.name}
|
alt={mod.name}
|
||||||
|
style={{
|
||||||
|
width: '64px',
|
||||||
|
height: '64px',
|
||||||
|
filter: 'brightness(0) invert(1)',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
</Box>
|
||||||
<CardContent sx={{ flexGrow: 1 }}>
|
<CardContent sx={{ flexGrow: 1 }}>
|
||||||
<Typography gutterBottom variant="h5" component="h2">
|
<Typography gutterBottom variant="h5" component="h2">
|
||||||
{mod.name}
|
{mod.name}
|
||||||
|
|||||||
Reference in New Issue
Block a user