This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

View File

@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
export default {
primary: '#1292B4',
white: '#FFF',
lighter: '#F3F3F3',
light: '#DAE1E7',
dark: '#444',
black: '#000',
};

View File

@ -0,0 +1,38 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {Node} from 'react';
import {Platform, StyleSheet, Text} from 'react-native';
import React from 'react';
const styles = StyleSheet.create({
highlight: {
fontWeight: '700',
},
});
const DebugInstructions: () => Node = Platform.select({
ios: () => (
<Text>
Press <Text style={styles.highlight}>Cmd + D</Text> in the simulator or{' '}
<Text style={styles.highlight}>Shake</Text> your device to open the React
Native debug menu.
</Text>
),
default: () => (
<Text>
Press <Text style={styles.highlight}>Cmd or Ctrl + M</Text> or{' '}
<Text style={styles.highlight}>Shake</Text> your device to open the React
Native debug menu.
</Text>
),
});
export default DebugInstructions;

View File

@ -0,0 +1,55 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import Colors from './Colors';
import type {Node} from 'react';
import {Text, StyleSheet, ImageBackground} from 'react-native';
import React from 'react';
const Header = (): Node => (
<ImageBackground
accessibilityRole={'image'}
source={require('./logo.png')}
style={styles.background}
imageStyle={styles.logo}>
<Text style={styles.text}>Welcome to React</Text>
</ImageBackground>
);
const styles = StyleSheet.create({
background: {
paddingBottom: 40,
paddingTop: 96,
paddingHorizontal: 32,
backgroundColor: Colors.lighter,
},
logo: {
opacity: 0.2,
overflow: 'visible',
resizeMode: 'cover',
/*
* These negative margins allow the image to be offset similarly across screen sizes and component sizes.
*
* The source logo.png image is 512x512px, so as such, these margins attempt to be relative to the
* source image's size.
*/
marginLeft: -128,
marginBottom: -192,
},
text: {
fontSize: 40,
fontWeight: '600',
textAlign: 'center',
color: Colors.black,
},
});
export default Header;

View File

@ -0,0 +1,123 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import Colors from './Colors';
import type {Node} from 'react';
import openURLInBrowser from 'react-native/Libraries/Core/Devtools/openURLInBrowser';
import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
import React from 'react';
const links = [
{
id: 1,
title: 'The Basics',
link: 'https://reactnative.dev/docs/tutorial',
description: 'Explains a Hello World for React Native.',
},
{
id: 2,
title: 'Style',
link: 'https://reactnative.dev/docs/style',
description:
'Covers how to use the prop named style which controls the visuals.',
},
{
id: 3,
title: 'Layout',
link: 'https://reactnative.dev/docs/flexbox',
description: 'React Native uses flexbox for layout, learn how it works.',
},
{
id: 4,
title: 'Components',
link: 'https://reactnative.dev/docs/components-and-apis',
description: 'The full list of components and APIs inside React Native.',
},
{
id: 5,
title: 'Navigation',
link: 'https://reactnative.dev/docs/navigation',
description:
'How to handle moving between screens inside your application.',
},
{
id: 6,
title: 'Networking',
link: 'https://reactnative.dev/docs/network',
description: 'How to use the Fetch API in React Native.',
},
{
id: 7,
title: 'Help',
link: 'https://reactnative.dev/help',
description:
'Need more help? There are many other React Native developers who may have the answer.',
},
{
id: 8,
title: 'Follow us on Twitter',
link: 'https://twitter.com/reactnative',
description:
'Stay in touch with the community, join in on Q&As and more by following React Native on Twitter.',
},
];
const LinkList = (): Node => (
<View style={styles.container}>
{links.map(({id, title, link, description}) => {
return (
<React.Fragment key={id}>
<View style={styles.separator} />
<TouchableOpacity
accessibilityRole={'button'}
onPress={() => openURLInBrowser(link)}
style={styles.linkContainer}>
<Text style={styles.link}>{title}</Text>
<Text style={styles.description}>{description}</Text>
</TouchableOpacity>
</React.Fragment>
);
})}
</View>
);
const styles = StyleSheet.create({
container: {
marginTop: 32,
paddingHorizontal: 24,
},
linkContainer: {
flexWrap: 'wrap',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
paddingVertical: 8,
},
link: {
flex: 2,
fontSize: 18,
fontWeight: '400',
color: Colors.primary,
},
description: {
flex: 3,
paddingVertical: 16,
fontWeight: '400',
fontSize: 18,
color: Colors.dark,
},
separator: {
backgroundColor: Colors.light,
height: 1,
},
});
export default LinkList;

View File

@ -0,0 +1,36 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
import type {Node} from 'react';
import {Platform, StyleSheet, Text} from 'react-native';
import React from 'react';
const styles = StyleSheet.create({
highlight: {
fontWeight: '700',
},
});
const ReloadInstructions: () => Node = Platform.select({
ios: () => (
<Text>
Press <Text style={styles.highlight}>Cmd + R</Text> in the simulator to
reload your app's code.
</Text>
),
default: () => (
<Text>
Double tap <Text style={styles.highlight}>R</Text> on your keyboard to
reload your app's code.
</Text>
),
});
export default ReloadInstructions;

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,19 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import Header from './components/Header';
import LearnMoreLinks from './components/LearnMoreLinks';
import Colors from './components/Colors';
import DebugInstructions from './components/DebugInstructions';
import ReloadInstructions from './components/ReloadInstructions';
export {Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions};