mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-13 12:00:18 +08:00
Summary: Continuation of #24687 > Issue: [Polish the "new app screen"](https://github.com/react-native-community/discussions-and-proposals/issues/122) > This is the pull request for the new intro screen proposal in react native as directed by cpojer This PR was created because the previous one could not be pushed to for some reason. I cleaned up a few small things and added the component as an example to RNTester so we can keep iterating. My plan is to land this, and then polish it and make it the default in a follow-up. [General][Added] - New Intro screen, Icons Removed Lottie Integration 100% React Native 💥 Pull Request resolved: https://github.com/facebook/react-native/pull/24737 Differential Revision: D15259092 Pulled By: cpojer fbshipit-source-id: bc141fb1425cf354f29deffd907c37f83fd92c75
110 lines
2.8 KiB
JavaScript
110 lines
2.8 KiB
JavaScript
/**
|
|
* 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
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import React from 'react';
|
|
import {View, Text, StyleSheet, TouchableOpacity, Linking} from 'react-native';
|
|
import Colors from './Colors';
|
|
|
|
const links = [
|
|
{
|
|
title: 'The Basics',
|
|
link: 'https://facebook.github.io/react-native/docs/tutorial',
|
|
description:
|
|
'Read the docs on what to do once seen how to work in React Native.',
|
|
},
|
|
{
|
|
title: 'Style',
|
|
link: 'https://facebook.github.io/react-native/docs/style',
|
|
description: 'All of the core components accept a prop named style.',
|
|
},
|
|
{
|
|
title: 'Layout',
|
|
link: 'https://facebook.github.io/react-native/docs/flexbox',
|
|
description:
|
|
'A component can specify the layout of its children using the flexbox specification.',
|
|
},
|
|
{
|
|
title: 'Components',
|
|
link: 'https://facebook.github.io/react-native/docs/components-and-apis',
|
|
description: 'The full list of components and APIs inside React Native.',
|
|
},
|
|
{
|
|
title: 'Navigation',
|
|
link: 'https://facebook.github.io/react-native/docs/navigation',
|
|
description:
|
|
'How to handle moving between screens inside your application.',
|
|
},
|
|
{
|
|
title: 'Networking',
|
|
link: 'https://facebook.github.io/react-native/docs/network',
|
|
description: 'How to use the Fetch API in React Native.',
|
|
},
|
|
{
|
|
title: 'Help',
|
|
link: 'https://facebook.github.io/react-native/help',
|
|
description:
|
|
'Need more help? There are many other React Native developers who may have the answer.',
|
|
},
|
|
];
|
|
|
|
const LinkList = () => (
|
|
<View style={styles.container}>
|
|
{links.map((item, index) => {
|
|
return (
|
|
<React.Fragment key={index}>
|
|
<View style={styles.separator} />
|
|
<TouchableOpacity
|
|
accessibilityRole={'button'}
|
|
onPress={() => Linking.openURL(item.link)}
|
|
style={styles.linkContainer}>
|
|
<Text style={styles.link}>{item.title}</Text>
|
|
<Text style={styles.description}>{item.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;
|