Skip to content

Commit

Permalink
docs: Add landing page for React Native Screens (software-mansion#2240)
Browse files Browse the repository at this point in the history
This PR adds landing page for React Native Screens with the use of
@swmansion/t-rex-ui component library.

The mobile view right now is done without proper design - let me know
have some ideas on it!

It's open for testing but keep in mind mentioned to-be-fixed things.

- [x] Add favicon
- [x] Add og-image
- [x] Add hero animation
- [x] Add Multiplatform tile animation
- [ ] (optional) Waiting for proper mobile designs
- [x] Bump @swmansion/t-rex-ui to latest

Laptop:



https://github.com/software-mansion/react-native-screens/assets/59940332/486b82cd-e2c6-4e33-b72e-cfc3de44a08c



Mobile:


https://github.com/software-mansion/react-native-screens/assets/59940332/af8cd946-b814-4071-97a8-8650de139312

Animacja na hero:


https://github.com/user-attachments/assets/fe506eb7-098d-4c70-b403-1a70e4374f2b
  • Loading branch information
patrycjakalinska authored and ja1ns committed Oct 9, 2024
1 parent 0a4ea2a commit 45849d2
Show file tree
Hide file tree
Showing 74 changed files with 14,451 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
19 changes: 19 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Screens Documentation

👉 Landing: [https://docs.swmansion.com/react-native-screens/](https://docs.swmansion.com/react-native-screens/)
👉 Documentation: [https://reactnavigation.org/docs/native-stack-navigator/](https://reactnavigation.org/docs/native-stack-navigator/)

## How can I help?

Glad you asked! You can help the project in many ways e.g. by:

- _Reading and sharing_ the docs with friends and co-workers
- _Sending feedback_ in the discussion or issues on GitHub
- _Submitting PRs_ with fixes and improvements to the docs content and styles

All feedback in all forms ranging from general to tiny fixes is highly appreciated!

## Meet the docs team

- [Balbina Fabia](https://dribbble.com/balbina): design
- [Patrycja Kalińska](https://x.com/patkalinska): site development
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Empty file added docs/docs/intro.md
Empty file.
80 changes: 80 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'React Native Screens',
favicon: 'img/favicon.ico',

url: 'https://docs.swmansion.com',

baseUrl: '/react-native-screens/',

organizationName: 'software-mansion',
projectName: 'react-native-screens',

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',

i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
breadcrumbs: false,
sidebarPath: require.resolve('./sidebars.js'),
sidebarCollapsible: false,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/og-image.png',
metadata: [
{ name: 'og:image:width', content: '1200' },
{ name: 'og:image:height', content: '630' },
],
navbar: {
hideOnScroll: true,
logo: {
alt: 'React Native Screens logo',
src: 'img/logo.svg',
srcDark: 'img/logo-dark.svg',
},
items: [
{
to: 'https://reactnavigation.org/docs/7.x/native-stack-navigator/',
activeBasePath: 'docs',
label: 'Docs',
position: 'right',
},
{
href: 'https://github.com/software-mansion/react-native-screens/',
position: 'right',
className: 'header-github',
'aria-label': 'GitHub repository',
},
],
},
footer: {
style: 'light',
links: [],
copyright:
'All trademarks and copyrights belong to their respective owners.',
},
}),
};

module.exports = config;
48 changes: 48 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mdx-js/react": "^1.6.22",
"@mui/material": "^5.16.0",
"@swmansion/t-rex-ui": "^0.0.13",
"clsx": "^1.2.1",
"prettier": "^2.8.4",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.3"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=16.14"
}
}
33 changes: 33 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
};

module.exports = sidebars;
24 changes: 24 additions & 0 deletions docs/src/components/Downloads/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import styles from './styles.module.css';

const Downloads = () => {
return (
<div className={styles.downloadsWrapper}>
<div className={styles.downloadsContainer}>
<h2 className={styles.title}>+1 000 000 / week</h2>
<p className={styles.content}>
React Native Screens is directly used in the React Navigation and Expo
Router libraries, some of the most popular libraries in the React
Native ecosystem. That's why nearly every second project uses React
Native Screens in React Native applications.
</p>
<div className={styles.brandContainer}>
<img src="img/react-navigation.svg" />
<img src="img/expo-router.svg" />
</div>
</div>
</div>
);
};

export default Downloads;
63 changes: 63 additions & 0 deletions docs/src/components/Downloads/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.title {
font-size: 48px;
font-weight: 700;
text-align: center;
color: var(--swm-navy-light-100);
}

.content {
font-size: 20px;
line-height: 32px;
color: var(--swm-navy-light-100);
text-align: center;
text-wrap: balance;
}

.brandContainer {
display: flex;
flex-direction: row;
justify-content: center;
gap: 4rem;
}

.brandContainer img {
width: 100px;
height: auto;
}

.downloadsWrapper {
background-color: var(--swm-blue-light-40);
margin: 6.5rem 0;
}

[data-theme='dark'] .downloadsWrapper {
background-color: var(--swm-blue-dark-80);
}

.downloadsContainer {
width: 60%;
margin: 5rem auto 7.5rem;
position: relative;
display: flex;
flex-direction: column;
gap: 2rem;
}

@media (max-width: 1440px) {
.downloadsContainer {
width: 75%;
}
}

@media (max-width: 996px) {
.downloadsContainer {
width: 85%;
gap: 3.5rem;
}
.title {
font-size: 40px;
}
.brandContainer {
gap: 2.5rem;
}
}
12 changes: 12 additions & 0 deletions docs/src/components/FooterBackground/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import styles from './styles.module.css';

const FooterBackground = () => {
return (
<div className={styles.container}>
<div className={styles.footerBackground} />
</div>
);
};

export default FooterBackground;
75 changes: 75 additions & 0 deletions docs/src/components/FooterBackground/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.footerBackground {
position: absolute;
bottom: 0;
left: 0;

background: linear-gradient(
180deg,
var(--swm-white) 0%,
rgba(252, 252, 255, 0) 150.5%
),
linear-gradient(
180deg,
var(--swm-blue-light-40) 35%,
var(--swm-blue-light-60) 100%
);
width: 100%;
height: 50vh;
overflow: hidden;

z-index: -100;
}

.container {
position: relative;
margin-top: 107px;
}

footer {
margin-top: -107px;
}

@media (max-width: 996px) {
.container {
margin-top: 122px;
}
footer {
margin-top: -122px;
}
}

@media (max-width: 700px) {
.container {
margin-top: 147px;
}
footer {
margin-top: -147px;
}
}

@media (max-width: 375px) {
.container {
margin-top: 173px;
}
footer {
margin-top: -173px;
}
}

[data-theme='dark'] .footerBackground {
background: linear-gradient(
180deg,
var(--swm-white) 0%,
rgba(252, 252, 255, 0) 150.5%
),
linear-gradient(
180deg,
var(--swm-blue-dark-120) 35%,
var(--swm-navy-dark-140) 100%
);
background: linear-gradient(
180deg,
var(--swm-navy-dark-140) 0%,
var(--swm-blue-dark-120) 100%
);
}
Loading

0 comments on commit 45849d2

Please sign in to comment.