-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
688 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
frontend/src/components/buttons/NextSimilarVehicleButton.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; | ||
|
||
export default function NextSimilarVehicleButton({ | ||
onClick, | ||
isDisabled = false, | ||
}) { | ||
return ( | ||
<button | ||
type="button" | ||
onClick={onClick} | ||
className={`flex py-2.5 px-3.5 gap-x-1 rounded-[50px] border border-solid items-center ${ | ||
isDisabled | ||
? 'text-dark-grey border-dark-grey' | ||
: 'text-mv-button-dark-grey border-button-dark-grey' | ||
}`} | ||
> | ||
<p className="text-base font-normal">Next</p> | ||
<ArrowForwardIcon className="w-[20px] h-[20px]" /> | ||
</button> | ||
); | ||
} |
23 changes: 23 additions & 0 deletions
23
frontend/src/components/buttons/PreviousSimilarVehicleButton.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import ArrowBackIcon from '@mui/icons-material/ArrowBack'; | ||
|
||
export default function PreviousSimilarVehicleButton({ | ||
onClick, | ||
isDisabled = false, | ||
}) { | ||
return ( | ||
<button | ||
type="button" | ||
onClick={onClick} | ||
disabled={isDisabled} | ||
className={`flex py-2.5 px-3.5 gap-x-1 rounded-[50px] border border-solid items-center ${ | ||
isDisabled | ||
? 'text-dark-grey border-dark-grey' | ||
: 'text-mv-button-dark-grey border-button-dark-grey' | ||
}`} | ||
> | ||
<ArrowBackIcon className="w-[20px] h-[20px]" /> | ||
<p className="text-base font-normal">Prev</p> | ||
</button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import truck from '../../assets/truck.png'; | ||
import truck2 from '../../assets/truck2.png'; | ||
import truck3 from '../../assets/truck3.png'; | ||
import truck4 from '../../assets/truck4.png'; | ||
import truck5 from '../../assets/truck5.png'; | ||
import SimilarVehicleImageSlideshow from '../imageSlideshows/SimilarVehicleImageSlideshow'; | ||
import AddToListButton from '../buttons/AddToListButton'; | ||
import ViewModelButton from '../buttons/ViewModelButton'; | ||
|
||
export default function SimilarVehicleCard() { | ||
return ( | ||
<div className="flex flex-col w-full rounded-[20px] shadow-buttonShadow"> | ||
<SimilarVehicleImageSlideshow | ||
images={[truck, truck2, truck3, truck4, truck5]} | ||
/> | ||
<div className="flex flex-col w-full h-1/2 px-[22px] mt-[23px] pb-[28px] grow"> | ||
<h1 className="text-mv-black text-[15px] font-semibold leading-[25px]"> | ||
VOLVO 6W Tractor Head W/ 8 SP. HI/LO T/M. W/ Windbreaker Projector | ||
Light 2003 air bag suspension | ||
</h1> | ||
<div className="w-full items-center justify-between text-mv-black flex mt-[16px]"> | ||
<p className="text-sm font-base leading-5 tracking-[0.1px]"> | ||
Current bid: | ||
</p> | ||
<p className="text-xl font-medium leading-5">₱78,000</p> | ||
</div> | ||
<div className="flex mt-[27px] gap-x-[25px]"> | ||
<ViewModelButton onClick={() => {}} /> | ||
<AddToListButton size="sm" onClick={() => {}} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 0 additions & 106 deletions
106
frontend/src/components/image-slideshow/ImageSlideshow.jsx
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
frontend/src/components/imageSlideshows/ImageSlideshow.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React, { useState, useRef, useEffect } from 'react'; | ||
import NavigateNextIcon from '@mui/icons-material/NavigateNext'; | ||
import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore'; | ||
|
||
export default function ImageSlideshow({ images }) { | ||
const [currentIndex, setCurrentIndex] = useState(0); | ||
const imageRefs = useRef([]); | ||
const ids = [0, 1, 2, 3, 4, 5]; | ||
|
||
const handleImageClick = (index) => { | ||
setCurrentIndex(index); | ||
}; | ||
|
||
const goToNextImage = () => { | ||
if (currentIndex < images.length - 1) { | ||
setCurrentIndex(currentIndex + 1); | ||
} | ||
}; | ||
|
||
const goToPrevImage = () => { | ||
if (currentIndex > 0) { | ||
setCurrentIndex(currentIndex - 1); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
if (imageRefs.current[currentIndex]) { | ||
imageRefs.current[currentIndex].scrollIntoView({ | ||
behavior: 'smooth', | ||
block: 'nearest', | ||
inline: 'start', | ||
}); | ||
} | ||
}, [currentIndex]); | ||
|
||
return ( | ||
<div className="flex flex-col w-full"> | ||
<div className="relative"> | ||
<img | ||
src={images[currentIndex]} | ||
alt={`Vehicle ${currentIndex + 1}`} | ||
className="w-full max-h-[440px] object-contain" | ||
/> | ||
{currentIndex < images.length - 1 && ( | ||
<div | ||
onClick={goToNextImage} | ||
className="absolute top-1/2 right-[10px] transform -translate-y-1/2 border border-solid border-mv-white rounded-full p-2 hover:cursor-pointer" | ||
> | ||
<NavigateNextIcon className="text-mv-white w-[25px] h-[25px]" /> | ||
</div> | ||
)} | ||
{currentIndex > 0 && ( | ||
<div | ||
onClick={goToPrevImage} | ||
className="absolute top-1/2 left-[10px] transform -translate-y-1/2 border border-solid border-mv-white rounded-full p-2 hover:cursor-pointer" | ||
> | ||
<NavigateBeforeIcon className="text-mv-white w-[25px] h-[25px]" /> | ||
</div> | ||
)} | ||
</div> | ||
<div className="flex w-full mt-[24px] gap-x-[20px] overflow-x-auto items-center"> | ||
{images.map((image, index) => ( | ||
<img | ||
ref={(el) => (imageRefs.current[index] = el)} | ||
key={ids[index]} | ||
src={image} | ||
alt={`Thumbnail ${index + 1}`} | ||
className={`w-1/4 max-h-[110px] object-contain cursor-pointer ${ | ||
currentIndex === index | ||
? 'opacity-100' | ||
: 'opacity-50 hover:opacity-100' | ||
}`} | ||
onClick={() => handleImageClick(index)} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.