Skip to content

Commit c521676

Browse files
authored
Home: fix auto theme assets issue, other tweaks (#4709)
1 parent 56e71a7 commit c521676

File tree

26 files changed

+80
-79
lines changed

26 files changed

+80
-79
lines changed

website/src/pages/Home/Community/index.tsx renamed to website/src/components/Home/Community/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
*/
77

88
import React from 'react';
9+
910
import useBaseUrl from '@docusaurus/useBaseUrl';
1011
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
1112

12-
import Section from '../components/Section';
13-
import SectionTitle from '../components/SectionTitle';
13+
import Section from '../Section';
14+
import SectionTitle from '../SectionTitle';
1415

1516
import styles from './styles.module.css';
1617

website/src/pages/Home/Framework/index.tsx renamed to website/src/components/Home/Framework/index.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
import React from 'react';
99

10-
import ThemeImage from '../components/ThemeImage';
11-
import Section from '../components/Section';
12-
import SectionTitle from '../components/SectionTitle';
10+
import useBaseUrl from '@docusaurus/useBaseUrl';
11+
import ThemedImage from '@theme/ThemedImage';
12+
13+
import Section from '../Section';
14+
import SectionTitle from '../SectionTitle';
1315

1416
import styles from './styles.module.css';
1517

@@ -30,9 +32,11 @@ function Framework() {
3032
/>
3133
<div className={styles.cardContainer}>
3234
<div className={styles.card}>
33-
<ThemeImage
34-
lightSrc="/img/homepage/file-based-routing.png"
35-
darkSrc="/img/homepage/file-based-routing-dark.png"
35+
<ThemedImage
36+
sources={{
37+
light: '/img/homepage/file-based-routing.png',
38+
dark: '/img/homepage/file-based-routing-dark.png',
39+
}}
3640
className={styles.cardImage}
3741
alt="File system with folders and files representing screens and navigation"
3842
/>
@@ -45,11 +49,13 @@ function Framework() {
4549
</div>
4650
</div>
4751
<div className={styles.card}>
48-
<ThemeImage
49-
lightSrc="/img/homepage/libraries.png"
50-
darkSrc="/img/homepage/libraries-dark.png"
51-
className={styles.cardImage}
52+
<ThemedImage
53+
sources={{
54+
light: useBaseUrl('/img/homepage/libraries.png'),
55+
dark: useBaseUrl('/img/homepage/libraries-dark.png'),
56+
}}
5257
alt="Grid of icons representing libraries, SDKs, and native code"
58+
className={styles.cardImage}
5359
/>
5460
<div className={styles.cardContent}>
5561
<h4 className={styles.cardTitle}>
@@ -62,9 +68,11 @@ function Framework() {
6268
</div>
6369
</div>
6470
<div className={styles.card}>
65-
<ThemeImage
66-
lightSrc="/img/homepage/tools.png"
67-
darkSrc="/img/homepage/tools-dark.png"
71+
<ThemedImage
72+
sources={{
73+
light: useBaseUrl('/img/homepage/tools.png'),
74+
dark: useBaseUrl('/img/homepage/tools-dark.png'),
75+
}}
6876
className={styles.cardImage}
6977
alt="List of developer tool toggles for debugging, performance, and more"
7078
/>

website/src/pages/Home/Framework/styles.module.css renamed to website/src/components/Home/Framework/styles.module.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424

2525
.cardContent {
2626
padding: 16px 24px;
27+
border-top: 1px solid var(--home-border);
28+
}
29+
30+
.cardImage {
31+
aspect-ratio: 284/148;
2732
}
2833

2934
.cardTitle {
@@ -40,7 +45,7 @@
4045
line-height: 150%;
4146
}
4247

43-
@media only screen and (max-width: 900px) {
48+
@media only screen and (max-width: 996px) {
4449
.cardContainer {
4550
display: flex;
4651
flex-direction: column;
@@ -51,9 +56,13 @@
5156
text-align: start;
5257
}
5358

59+
.cardContent {
60+
border-top: 0;
61+
}
62+
5463
.cardImage {
5564
width: auto;
56-
height: 150px;
65+
max-height: 150px;
5766
margin: 1rem;
5867
border-radius: 0.5rem;
5968
border: 1px solid var(--home-border);

website/src/pages/Home/Hero/index.tsx renamed to website/src/components/Home/Hero/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import React from 'react';
99
import GitHubButton from 'react-github-btn';
1010

1111
import Logo from '../Logo';
12-
1312
import GridBackground from './GridBackground';
1413
import FloorBackground from './FloorBackground';
1514
import Devices from './Devices';
15+
1616
import styles from './styles.module.css';
1717

1818
function Hero() {

0 commit comments

Comments
 (0)