Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect bid now button and modal #70

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions backend/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
Expand All @@ -80,10 +80,7 @@

CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"http://auctions.microvaninc.com",
"http://www.auctions.microvaninc.com",
"https://auctions.microvaninc.com",
"https://www.auctions.microvaninc.com",
"https://www.auction.microvaninc.com",
]

CORS_ALLOW_CREDENTIALS = True
Expand Down Expand Up @@ -165,11 +162,6 @@

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"django_cognito_jwt.backend.JWTBackend",
]

REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
"django_cognito_jwt.JSONWebTokenAuthentication",
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/components/buttons/AddToListButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ export default function AddToListButton({ onClick, size = 'sm' }) {
<button
type="button"
className={`bg-mv-white border-mv-green border-solid border rounded-[5px] shadow-searchBarShadow w-full flex items-center justify-center whitespace-nowrap ${
size === 'sm' ? 'px-[20px] py-[10px]' : 'px-[64.5px] py-4'
size === 'sm' ? 'px-[20px] py-[10px]' : 'py-[16px]'
}`}
onClick={onClick}
>
<div className="flex items-center justify-center gap-x-[5px]">
<AddIcon
className={`text-mv-black ${
size === 'sm' ? 'w-[20px] h-[20px]' : 'w-[24px] h-[24px]'
}`}
sx={{ fontSize: size === 'sm' ? 20 : 24 }}
className="text-mv-black"
/>
<p
className={`text-mv-black font-medium leading-5 tracking-[0.1px] ${
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/components/buttons/BidNowButton.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React from 'react';

export default function BidNowButton({ onClick, size = 'sm' }) {
const sizeButtonClass = {
sm: 'px-5 py-3',
md: 'px-[79px] py-5',
lg: 'py-[19px]',
};

return (
<button
type="button"
className={`bg-mv-green rounded-[5px] shadow-searchBarShadow w-full flex items-center justify-center ${
size === 'sm' ? 'px-5 py-3' : 'px-[89px] py-[19px]'
}`}
className={`bg-mv-green rounded-[5px] shadow-searchBarShadow w-full flex items-center justify-center ${sizeButtonClass[size]}`}
onClick={onClick}
>
<div className="flex items-center justify-center">
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/components/buttons/CancelButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

export default function CancelButton({ onClick }) {
return (
<button
type="button"
className="bg-mv-white border-mv-green border-solid border rounded-[5px] shadow-searchBarShadow w-full flex items-center justify-center whitespace-nowrap px-[79px] py-5"
onClick={onClick}
>
<p className="text-mv-black font-medium leading-5 tracking-[0.1px] text-lg">
Cancel
</p>
</button>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function NextSimilarVehicleButton({
}`}
>
<p className="text-base font-normal">Next</p>
<ArrowForwardIcon className="w-[20px] h-[20px]" />
<ArrowForwardIcon sx={{ fontSize: 20 }} />
</button>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function PreviousSimilarVehicleButton({
: 'text-mv-button-dark-grey border-button-dark-grey'
}`}
>
<ArrowBackIcon className="w-[20px] h-[20px]" />
<ArrowBackIcon sx={{ fontSize: 20 }} />
<p className="text-base font-normal">Prev</p>
</button>
);
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/components/buttons/RemoveFromListButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ export default function RemoveFromListButton({ size, onClick }) {
large: 'text-[18px]',
};

const sizeIconClass = {
small: 'w-[20px] h-[20px]',
large: 'w-[24px] h-[24px]',
};

return (
<button
type="button"
className={`${sizeButtonClass[size]} whitespace-nowrap bg-mv-white px-[24px] py-[10px] flex gap-[5px] items-center justify-center rounded-[5px] border border-solid border-mv-green shadow-buttonShadow `}
onClick={onClick}
>
<DeleteOutlinedIcon className={`${sizeIconClass[size]} text-mv-black`} />
<DeleteOutlinedIcon
sx={{ fontSize: size === 'small' ? 20 : 24 }}
className="text-mv-black"
/>
<div
className={`${sizeTextClass[size]} leading-5 font-medium text-mv-black`}
>
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/components/cards/VehicleItemCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@ export default function VehicleItemCard({
<div className="flex flex-col text-mv-black text-base mr-[50px] gap-y-[20px]">
<div className="flex flex-row justify-between">
<div className="flex flex-row items-center justify-center gap-x-[19px]">
<DirectionsBusIcon className="text-dark-grey w-[25px] h-[25px]" />
<DirectionsBusIcon
className="text-dark-grey"
sx={{ fontSize: 25 }}
/>
<div className="flex flex-col leading-6 tracking-[0.5px]">
<p className="font-medium">Model</p>
<p className="font-normal">{modelNumber}</p>
</div>
</div>
<div className="flex flex-row items-center justify-center gap-x-[19px]">
<StarsOutlinedIcon className="text-dark-grey w-[25px] h-[25px]" />
<StarsOutlinedIcon
className="text-dark-grey"
sx={{ fontSize: 25 }}
/>
<div className="flex flex-col leading-6 tracking-[0.5px]">
<p className="font-medium">Engine no.</p>
<p className="font-normal">{engineNumber}</p>
Expand All @@ -68,7 +74,10 @@ export default function VehicleItemCard({
</div>
<div className="flex flex-row justify-between">
<div className="flex flex-row items-center justify-center gap-x-[19px]">
<AgricultureIcon className="text-dark-grey w-[25px] h-[25px]" />
<AgricultureIcon
className="text-dark-grey"
sx={{ fontSize: 25 }}
/>
<div className="flex flex-col leading-6 tracking-[0.5px]">
<p className="font-medium">Chassis</p>
<p className="font-normal">{chassisNumber}</p>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/dropdowns/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Dropdown({ title, items, onValueChange }) {
</span>
<KeyboardArrowDownIcon
className="text-mv-black"
style={{ width: 24, height: 24 }}
sx={{ fontSize: 24 }}
/>
</button>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/dropdowns/FilterDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function FilterDropdown({ title, items, onValueChange }) {
</span>
<KeyboardArrowDownIcon
className="text-mv-black"
style={{ width: 24, height: 24 }}
sx={{ fontSize: 24 }}
/>
</button>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/footers/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Footer() {
{ day: 'Saturday', hours: '8am-4pm' },
{ day: 'Sunday', hours: 'Closed' },
].map((schedule) => (
<div className="flex gap-x-10">
<div key={schedule.day} className="flex gap-x-10">
<p className="text-base font-normal flex-1 text-left pr-4">
{schedule.day}
</p>
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/components/imageSlideshows/ImageSlideshow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,29 @@ export default function ImageSlideshow({ images }) {

return (
<div className="flex flex-col w-full">
<div className="relative">
<div className="relative h-[440px]">
<img
src={images[currentIndex]}
alt={`Vehicle ${currentIndex + 1}`}
className="w-full max-h-[440px] object-contain"
className="w-full h-full object-cover"
/>
{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]" />
<NavigateNextIcon className="text-mv-white" sx={{ fontSize: 25 }} />
</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]" />
<NavigateBeforeIcon
className="text-mv-white"
sx={{ fontSize: 25 }}
/>
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ export default function SimilarVehicleImageSlideshow({ images }) {
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]" />
<NavigateNextIcon className="text-mv-white" sx={{ fontSize: 25 }} />
</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]" />
<NavigateBeforeIcon
className="text-mv-white"
sx={{ fontSize: 25 }}
/>
</div>
)}
</div>
Expand Down
Loading
Loading