mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-08-16 02:56:22 +00:00
docs: add documentation (#14)
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import Heading from '@theme/Heading';
|
||||
import clsx from 'clsx';
|
||||
import type { ReactNode } from 'react';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
type FeatureItem = {
|
||||
title: string;
|
||||
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
|
||||
description: ReactNode;
|
||||
};
|
||||
|
||||
const FeatureList: FeatureItem[] = [
|
||||
{
|
||||
title: 'React Native First',
|
||||
Svg: require('@site/static/img/reactjs-icon.svg').default,
|
||||
description: (
|
||||
<>
|
||||
React Native Video is a video player created for React Native.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Multi Subtitles & Audio Tracks',
|
||||
Svg: require('@site/static/img/download-icon.svg').default,
|
||||
description: (
|
||||
<>
|
||||
React Native Video supports multiple subtitles and audio tracks.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'DRM Protected Content',
|
||||
Svg: require('@site/static/img/drm-content-icon.svg').default,
|
||||
description: (
|
||||
<>
|
||||
React Native Video supports DRM protected content.
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
function Feature({title, Svg, description}: FeatureItem) {
|
||||
return (
|
||||
<div className={clsx('col col--4')}>
|
||||
<div className="text--center">
|
||||
<Svg className={styles.featureSvg} role="img" />
|
||||
</div>
|
||||
<div className="text--center padding-horiz--md">
|
||||
<Heading as="h3">{title}</Heading>
|
||||
<p>{description}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function HomepageFeatures(): ReactNode {
|
||||
return (
|
||||
<section className={styles.features}>
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
{FeatureList.map((props, idx) => (
|
||||
<Feature key={idx} {...props} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
.features {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2rem 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.featureSvg {
|
||||
height: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Any CSS included here will be global. The classic template
|
||||
* bundles Infima by default. Infima is a CSS framework designed to
|
||||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-code-font-size: 95%;
|
||||
--ifm-color-primary: #96c9eb;
|
||||
--ifm-color-primary-dark: #76b8e5;
|
||||
--ifm-color-primary-darker: #65b0e2;
|
||||
--ifm-color-primary-darkest: #3597d9;
|
||||
--ifm-color-primary-light: #b6daf1;
|
||||
--ifm-color-primary-lighter: #c7e2f4;
|
||||
--ifm-color-primary-lightest: #f7fbfd;
|
||||
--ifm-color-secondary: #f4d970;
|
||||
--ifm-color-secondary-dark: #f1d04f;
|
||||
--ifm-color-secondary-darker: #f0cc3e;
|
||||
--ifm-color-secondary-darkest: #e7bc12;
|
||||
--ifm-color-secondary-light: #f7e291;
|
||||
--ifm-color-secondary-lighter: #f8e6a2;
|
||||
--ifm-color-secondary-lightest: #fcf3d3;
|
||||
--ifm-background-color: #171717;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
||||
* and scoped locally.
|
||||
*/
|
||||
|
||||
.heroBanner {
|
||||
padding: 4rem 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 996px) {
|
||||
.heroBanner {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 240px;
|
||||
height: 160px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import Link from '@docusaurus/Link';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import HomepageFeatures from '@site/src/components/HomepageFeatures';
|
||||
import Heading from '@theme/Heading';
|
||||
import Layout from '@theme/Layout';
|
||||
import clsx from 'clsx';
|
||||
import type { ReactNode } from 'react';
|
||||
import styles from './index.module.css';
|
||||
|
||||
function HomepageHeader() {
|
||||
const {siteConfig} = useDocusaurusContext();
|
||||
return (
|
||||
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
||||
<div className="container">
|
||||
<img src="./img/twg-logo.png" alt="TheWidlarzGroup Logo" className={styles.logo} />
|
||||
<Heading as="h1" className="hero__title">
|
||||
{siteConfig.title}
|
||||
</Heading>
|
||||
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
||||
<div className={styles.buttons}>
|
||||
<Link
|
||||
className="button button--secondary button--lg"
|
||||
to="/docs/intro">
|
||||
Get Started
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Home(): ReactNode {
|
||||
const {siteConfig} = useDocusaurusContext();
|
||||
return (
|
||||
<Layout
|
||||
title={`${siteConfig.title}`}
|
||||
description="Video player for React Native.">
|
||||
<HomepageHeader />
|
||||
<main>
|
||||
<HomepageFeatures />
|
||||
</main>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user