Skip to content

Commit 5f31bd4

Browse files
committed
fix: mobile spacings
1 parent 0d9ab1e commit 5f31bd4

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

packages/audiodocs/src/components/Layout/Spacer/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import React, { memo } from "react";
22

33
interface SpacerProps {
44
size?: number | string;
5+
className?: string;
56
}
67

7-
const H: React.FC<SpacerProps> = memo(({ size }) => (
8-
<div style={size ? { width: size } : { flex: 1 }} />
8+
const H: React.FC<SpacerProps> = memo(({ size, className }) => (
9+
<div style={size ? { width: size } : { flex: 1 }} className={className} />
910
));
1011

11-
const V: React.FC<SpacerProps> = memo(({ size }) => (
12-
<div style={size ? { height: size } : { flex: 1 }} />
12+
const V: React.FC<SpacerProps> = memo(({ size, className }) => (
13+
<div style={size ? { height: size } : { flex: 1 }} className={className} />
1314
))
1415

1516
const Spacer = {

packages/audiodocs/src/pages/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,24 @@ function Home() {
3030
<div className={styles.container}>
3131
<Hero />
3232
</div>
33-
<Spacer.V size="120px" />
33+
<Spacer.V size="120px" className={styles.hideOnMobile} />
3434
<div className={styles.container}>
3535
<LandingWidget />
3636
</div>
37-
<Spacer.V size="120px" />
37+
<Spacer.V size="120px" className={styles.hideOnMobile} />
38+
<Spacer.V size="56px" className={styles.visibleOnMobile} />
3839
<div className={styles.container}>
3940
<LandingFeatures />
4041
<LandingBlog />
4142
{/* <LandingExamples /> */}
4243
</div>
43-
<Spacer.V size="10rem" />
44+
<Spacer.V size="10rem" className={styles.hideOnMobile} />
45+
<Spacer.V size="6rem" className={styles.visibleOnMobile} />
4446
<div className={styles.container}>
4547
<Testimonials />
4648
</div>
47-
<Spacer.V size="12rem" />
49+
<Spacer.V size="12rem" className={styles.hideOnMobile} />
50+
<Spacer.V size="6rem" className={styles.visibleOnMobile} />
4851
<div className={styles.container}>
4952
<HireUsSection
5053
href={

packages/audiodocs/src/pages/styles.module.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
display: flex;
55
flex-direction: column;
66
gap: 3rem;
7-
/* position: relative; */
87
}
98

109
.waveContainer {
1110
position: relative;
1211
}
1312

13+
.visibleOnMobile {
14+
display: none;
15+
}
16+
1417
@media (max-width: 1440px) {
1518
.container {
1619
width: 75%;
@@ -23,3 +26,13 @@
2326
gap: 3.5rem;
2427
}
2528
}
29+
30+
@media (max-width: 768px) {
31+
.hideOnMobile {
32+
display: none;
33+
}
34+
35+
.visibleOnMobile {
36+
display: block;
37+
}
38+
}

0 commit comments

Comments
 (0)