Skip to content

Commit 5df31a9

Browse files
author
Test
committed
Fix dark mode styling for wishlist item overview page
- Added dark mode support to ItemOverview component with darker backgrounds (#0f1629, #0a0f1a) - Improved text contrast with brighter white colors (#ffffff, #e8eaed) for better visibility - Updated ImageCarousel component to accept and handle darkMode prop - Fixed dark mode styling for: - Main content area (darker background) - All text elements (headings, descriptions, amenities, form labels) - Input fields (date, text, number) with dark backgrounds and proper calendar popup styling - Buttons (Save, Chat with Host) with darker backgrounds - Links with brighter blue for visibility - Image carousel navigation arrows and indicators - Added dark mode CSS classes with !important flags to ensure proper override
1 parent aa14246 commit 5df31a9

6 files changed

Lines changed: 488 additions & 73 deletions

File tree

src/components/LBDashboard/Components/ImageCarousel.jsx

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import { useState } from 'react';
2+
import PropTypes from 'prop-types';
23
import styles from './ImageCarousel.module.css';
34

4-
export default function ImageCarousel({ images }) {
5+
const getClassNames = (baseClass, darkClass, darkMode) =>
6+
`${baseClass} ${darkMode ? darkClass : ''}`;
7+
8+
export default function ImageCarousel({ images, darkMode = false }) {
59
const [currentIndex, setCurrentIndex] = useState(0);
610

7-
if (!images || images.length === 0) return <p>No images available</p>;
11+
if (!images || images.length === 0)
12+
return (
13+
<p className={getClassNames('', styles['no-images--dark'], darkMode)}>No images available</p>
14+
);
815

916
const handleNext = () => {
1017
setCurrentIndex(prev => (prev + 1) % images.length);
@@ -19,7 +26,13 @@ export default function ImageCarousel({ images }) {
1926
};
2027

2128
return (
22-
<div className={styles.carouselContainer}>
29+
<div
30+
className={getClassNames(
31+
styles.carouselContainer,
32+
styles['carouselContainer--dark'],
33+
darkMode,
34+
)}
35+
>
2336
<div className={styles.carouselWrapper}>
2437
<div
2538
className={styles.carouselTrack}
@@ -35,10 +48,22 @@ export default function ImageCarousel({ images }) {
3548
))}
3649
</div>
3750
</div>
38-
<button type="button" className={`${styles.imgArrow} ${styles.left}`} onClick={handlePrev}>
51+
<button
52+
type="button"
53+
className={`${getClassNames(styles.imgArrow, styles['imgArrow--dark'], darkMode)} ${
54+
styles.left
55+
}`}
56+
onClick={handlePrev}
57+
>
3958
4059
</button>
41-
<button type="button" className={`${styles.imgArrow} ${styles.right}`} onClick={handleNext}>
60+
<button
61+
type="button"
62+
className={`${getClassNames(styles.imgArrow, styles['imgArrow--dark'], darkMode)} ${
63+
styles.right
64+
}`}
65+
onClick={handleNext}
66+
>
4267
4368
</button>
4469
<div className={styles.carouselIndicators}>
@@ -47,7 +72,11 @@ export default function ImageCarousel({ images }) {
4772
key={image}
4873
role="button"
4974
tabIndex={0}
50-
className={`${styles.indicator} ${index === currentIndex ? styles.active : ''}`}
75+
className={`${getClassNames(styles.indicator, styles['indicator--dark'], darkMode)} ${
76+
index === currentIndex
77+
? getClassNames(styles.active, styles['active--dark'], darkMode)
78+
: ''
79+
}`}
5180
onClick={() => handleIndicatorClick(index)}
5281
onKeyDown={e => {
5382
if (e.key === 'Enter' || e.key === ' ') {
@@ -60,3 +89,8 @@ export default function ImageCarousel({ images }) {
6089
</div>
6190
);
6291
}
92+
93+
ImageCarousel.propTypes = {
94+
images: PropTypes.arrayOf(PropTypes.string),
95+
darkMode: PropTypes.bool,
96+
};

src/components/LBDashboard/Components/ImageCarousel.module.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,34 @@
6565

6666
.indicator.active {
6767
background-color: #333;
68+
}
69+
70+
/* Dark mode styles */
71+
.carouselContainer--dark {
72+
/* Container dark mode styles if needed */
73+
}
74+
75+
.imgArrow--dark {
76+
background-color: rgba(255, 255, 255, 0.7) !important;
77+
color: #000 !important;
78+
}
79+
80+
.imgArrow--dark:hover {
81+
background-color: rgba(255, 255, 255, 0.9) !important;
82+
}
83+
84+
.indicator--dark {
85+
background-color: #666 !important;
86+
}
87+
88+
.indicator--dark:hover {
89+
background-color: #888 !important;
90+
}
91+
92+
.active--dark {
93+
background-color: #fff !important;
94+
}
95+
96+
.no-images--dark {
97+
color: #e1e1e1 !important;
6898
}

0 commit comments

Comments
 (0)