Skip to content

Commit d396744

Browse files
committed
fix: inset images
1 parent 3d15e9d commit d396744

2 files changed

Lines changed: 3 additions & 58 deletions

File tree

sites/public/src/components/browse/map/MapListingCard.module.scss

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,9 @@
33
margin-block-end: var(--seeds-s4);
44
}
55

6-
@media (--md-and-up) {
7-
display: flex;
8-
flex-direction: column;
9-
}
10-
11-
.listing-card-outer-container {
12-
@media (--md-and-up) {
13-
flex: 1;
14-
display: flex;
15-
flex-direction: column;
16-
}
17-
}
18-
196
.listing-card-container {
207
--card-spacing: 0;
218

22-
@media (--md-and-up) {
23-
flex: 1;
24-
25-
:global(.seeds-card-section) {
26-
flex: 1;
27-
display: flex;
28-
flex-direction: column;
29-
}
30-
}
31-
329
.name,
3310
a {
3411
color: var(--seeds-color-blue-500);
@@ -47,9 +24,6 @@
4724
color: var(--seeds-text-color);
4825
font-family: var(--seeds-font-alt-sans);
4926
width: 100%;
50-
@media (--md-and-up) {
51-
flex: 1;
52-
}
5327
@media (--md-down) {
5428
flex-direction: column;
5529
}
@@ -64,6 +38,7 @@
6438

6539
.image-background {
6640
height: 100%;
41+
max-height: var(--seeds-s48);
6742
background-size: cover;
6843
background-position: center;
6944
@media (--md-down) {
@@ -79,8 +54,8 @@
7954
order: 1;
8055
width: calc(100% / 7 * 4);
8156
padding: var(--seeds-s3);
82-
display: flex;
83-
flex-direction: column;
57+
// display: flex;
58+
// flex-direction: column;
8459

8560
@media (--md-down) {
8661
width: 100%;
@@ -117,9 +92,6 @@
11792

11893
.unit-table {
11994
margin-block-start: var(--seeds-s3);
120-
@media (--md-and-up) {
121-
margin-block-start: auto;
122-
}
12395
}
12496
}
12597

@@ -196,10 +168,6 @@
196168
.name {
197169
font-size: var(--seeds-type-heading-size-lg);
198170
}
199-
200-
.unit-table {
201-
margin-block-start: var(--seeds-s3);
202-
}
203171
}
204172
}
205173
}

sites/public/src/components/browse/map/MapListingCard.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -159,31 +159,8 @@ export const MapListingCard = ({
159159
)
160160
}
161161

162-
const DESKTOP_MIN_WIDTH = 768
163-
164162
export const MapListingCardList = ({ children }: { children: React.ReactNode }) => {
165163
const listRef = useRef<HTMLUListElement>(null)
166164

167-
useLayoutEffect(() => {
168-
const equalize = () => {
169-
const ul = listRef.current
170-
if (!ul) return
171-
172-
const items = Array.from(ul.querySelectorAll<HTMLLIElement>(":scope > li"))
173-
items.forEach((li) => (li.style.minHeight = ""))
174-
175-
if (items.length <= 1 || window.innerWidth < DESKTOP_MIN_WIDTH) return
176-
177-
const max = Math.max(...items.map((li) => li.getBoundingClientRect().height))
178-
if (isFinite(max) && max > 0) {
179-
items.forEach((li) => (li.style.minHeight = `${max}px`))
180-
}
181-
}
182-
183-
equalize()
184-
window.addEventListener("resize", equalize)
185-
return () => window.removeEventListener("resize", equalize)
186-
})
187-
188165
return <ul ref={listRef}>{children}</ul>
189166
}

0 commit comments

Comments
 (0)