Skip to content

Home: tweaks and fixes #4709

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
*/

import React from 'react';

import useBaseUrl from '@docusaurus/useBaseUrl';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

import Section from '../components/Section';
import SectionTitle from '../components/SectionTitle';
import Section from '../Section';
import SectionTitle from '../SectionTitle';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

import React from 'react';

import ThemeImage from '../components/ThemeImage';
import Section from '../components/Section';
import SectionTitle from '../components/SectionTitle';
import useBaseUrl from '@docusaurus/useBaseUrl';
import ThemedImage from '@theme/ThemedImage';

import Section from '../Section';
import SectionTitle from '../SectionTitle';

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

Expand All @@ -30,9 +32,11 @@ function Framework() {
/>
<div className={styles.cardContainer}>
<div className={styles.card}>
<ThemeImage
lightSrc="/img/homepage/file-based-routing.png"
darkSrc="/img/homepage/file-based-routing-dark.png"
<ThemedImage
sources={{
light: '/img/homepage/file-based-routing.png',
dark: '/img/homepage/file-based-routing-dark.png',
}}
className={styles.cardImage}
alt="File system with folders and files representing screens and navigation"
/>
Expand All @@ -45,11 +49,13 @@ function Framework() {
</div>
</div>
<div className={styles.card}>
<ThemeImage
lightSrc="/img/homepage/libraries.png"
darkSrc="/img/homepage/libraries-dark.png"
className={styles.cardImage}
<ThemedImage
sources={{
light: useBaseUrl('/img/homepage/libraries.png'),
dark: useBaseUrl('/img/homepage/libraries-dark.png'),
}}
alt="Grid of icons representing libraries, SDKs, and native code"
className={styles.cardImage}
/>
<div className={styles.cardContent}>
<h4 className={styles.cardTitle}>
Expand All @@ -62,9 +68,11 @@ function Framework() {
</div>
</div>
<div className={styles.card}>
<ThemeImage
lightSrc="/img/homepage/tools.png"
darkSrc="/img/homepage/tools-dark.png"
<ThemedImage
sources={{
light: useBaseUrl('/img/homepage/tools.png'),
dark: useBaseUrl('/img/homepage/tools-dark.png'),
}}
className={styles.cardImage}
alt="List of developer tool toggles for debugging, performance, and more"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@

.cardContent {
padding: 16px 24px;
border-top: 1px solid var(--home-border);
}

.cardImage {
aspect-ratio: 284/148;
}

.cardTitle {
Expand All @@ -40,7 +45,7 @@
line-height: 150%;
}

@media only screen and (max-width: 900px) {
@media only screen and (max-width: 996px) {
.cardContainer {
display: flex;
flex-direction: column;
Expand All @@ -51,9 +56,13 @@
text-align: start;
}

.cardContent {
border-top: 0;
}

.cardImage {
width: auto;
height: 150px;
max-height: 150px;
margin: 1rem;
border-radius: 0.5rem;
border: 1px solid var(--home-border);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import React from 'react';
import GitHubButton from 'react-github-btn';

import Logo from '../Logo';

import GridBackground from './GridBackground';
import FloorBackground from './FloorBackground';
import Devices from './Devices';

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

function Hero() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
.content {
position: relative;
top: 120px;
padding-inline: 24px;
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

import React from 'react';

import Section from '../components/Section';
import SectionTitle from '../components/SectionTitle';
import ThemeImage from '../components/ThemeImage';
import ThemedImage from '@theme/ThemedImage';

import Section from '../Section';
import SectionTitle from '../SectionTitle';

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

Expand All @@ -28,9 +29,11 @@ function Native() {
</>
}
/>
<ThemeImage
lightSrc="/img/homepage/dissection.png"
darkSrc="/img/homepage/dissection-dark.png"
<ThemedImage
sources={{
light: '/img/homepage/dissection.png',
dark: '/img/homepage/dissection-dark.png',
}}
className={styles.flyoutIllustration}
alt="A React Native UI pointing out native elements like Views, ScrollViews, and more"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,29 @@

import React from 'react';

import Section from '../components/Section';
import SectionTitle from '../components/SectionTitle';
import ThemeImage from '../components/ThemeImage';
import useBaseUrl from '@docusaurus/useBaseUrl';
import ThemedImage from '@theme/ThemedImage';

import Section from '../Section';
import SectionTitle from '../SectionTitle';
import FoxFact from './FoxFact';

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

function Platforms() {
return (
<Section>
<SectionTitle
title="Create native apps for Android, iOS, and more using React"
description="React Native brings the best parts of developing with React to native development. It's a best-in-class JavaScript library for building user interfaces."
description={
<>
React Native brings the best parts of developing with React to
native development.
<br />
It's a best-in-class JavaScript library for building user
interfaces.
</>
}
/>
<div className={styles.platformsContainer}>
<div className={styles.featureContainer}>
Expand Down Expand Up @@ -54,9 +64,11 @@ function Platforms() {
</div>
</div>
<div className={styles.deviceContainer}>
<ThemeImage
lightSrc="/img/homepage/devices.png"
darkSrc="/img/homepage/devices-dark.png"
<ThemedImage
sources={{
light: useBaseUrl('/img/homepage/devices.png'),
dark: useBaseUrl('/img/homepage/devices-dark.png'),
}}
className={styles.devices}
alt="Android device and iOS device"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@
font-weight: normal;
max-width: 850px;
}

@media only screen and (max-width: 996px) {
.title {
font-size: 40px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import React from 'react';

import Section from '../components/Section';
import SectionTitle from '../components/SectionTitle';
import Section from '../Section';
import SectionTitle from '../SectionTitle';

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

Expand All @@ -20,7 +20,12 @@ function Watch() {
description={
<>
Watch talks by the React team and learn how to get the most out of
React Native. Find the latest on{' '}
React Native.
<br />
Find the latest on{' '}
<a href="https://bsky.app/profile/reactnative.dev">
Bluesky
</a> and{' '}
<a href="https://twitter.com/intent/follow?screen_name=reactnative&region=follow_link">
X
</a>
Expand Down
File renamed without changes.
43 changes: 0 additions & 43 deletions website/src/pages/Home/components/ThemeImage/index.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions website/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import React from 'react';

import Head from '@docusaurus/Head';

import Layout from '@theme/Layout';

import Home from './Home';
import Home from '../components/Home';

const Index = () => {
return (
Expand Down