|
1 | 1 | import React from 'react';
|
2 | 2 | import Link from 'gatsby-link';
|
3 | 3 |
|
4 |
| -import mainLogo from '../images/logo_big.png'; |
5 | 4 | import './index.scss';
|
6 | 5 | import Layout from '../components/layout';
|
| 6 | +import mainLogo from '../images/logo_big.png'; |
| 7 | +import datePicker from '../images/examples/datepicker.png'; |
| 8 | +import actionSheet from '../images/examples/actionSheet.png'; |
| 9 | +import rtl from '../images/examples/rtl.png'; |
7 | 10 |
|
8 |
| -const IndexPage = (props) => { |
| 11 | +const IndexPage = props => { |
9 | 12 | return (
|
10 | 13 | <Layout {...props}>
|
11 | 14 | <div className="main-page">
|
12 |
| - <div className="logo-box"> |
13 |
| - <img className="logo" src={mainLogo} alt="main-logo"/> |
| 15 | + <div className="main-section"> |
| 16 | + <div className="logo-box"> |
| 17 | + <img className="logo" src={mainLogo} alt="main-logo"/> |
14 | 18 |
|
15 |
| - <Link className="docs-button" to="/docs/"> |
16 |
| - Enter Docs |
17 |
| - </Link> |
| 19 | + <Link className="docs-button" to="/docs/"> |
| 20 | + Enter Docs |
| 21 | + </Link> |
| 22 | + |
| 23 | + <p className="description">UI Toolset & Components Library for React Native</p> |
| 24 | + </div> |
18 | 25 | </div>
|
| 26 | + <PlatformSection/> |
| 27 | + <ToolsetSection/> |
| 28 | + <NativeSection/> |
| 29 | + <OthersSection/> |
19 | 30 | </div>
|
20 | 31 | </Layout>
|
21 | 32 | );
|
22 | 33 | };
|
23 | 34 |
|
| 35 | +const PlatformSection = () => { |
| 36 | + return ( |
| 37 | + <div className="platforms-section"> |
| 38 | + <div> |
| 39 | + <img height="500" src={datePicker} style={{zIndex: 10}}/> |
| 40 | + <img height="400" src={actionSheet}/> |
| 41 | + </div> |
| 42 | + <div> |
| 43 | + <h1>A Cross-Platform Components Library</h1> |
| 44 | + <p> |
| 45 | + Building a cross-platform app can be time consuming especially when one needs to find solutions that suit each |
| 46 | + platform. While React Native solve this issue, still, some components originated from one platform and don't |
| 47 | + exist in the other. |
| 48 | + </p> |
| 49 | + <p> |
| 50 | + <b>ActionSheet</b> is a good example of an iOS component that just does not exist on Android.{' '} |
| 51 | + <b>DatePicker</b> has a different API and behavior for each platform instead of unified component. |
| 52 | + </p> |
| 53 | + <p>The UILIB aims to solve that.</p> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + ); |
| 57 | +}; |
| 58 | + |
| 59 | +const ToolsetSection = () => { |
| 60 | + return ( |
| 61 | + <div className="toolset-section"> |
| 62 | + <h1>Toolset for Building Amazing Apps with No Effort</h1> |
| 63 | + <p> |
| 64 | + <h3>Step 1</h3> Define your app base foundation. Things like colors, typography and spacings. |
| 65 | + </p> |
| 66 | + <div className="code-examples"> |
| 67 | + <code> |
| 68 | + {`import {Colors} from 'react-native-ui-lib';\n |
| 69 | +Colors.loadColors({\n primaryColor: '#2364AA',\n secondaryColor: '#81C3D7',\n textColor: '#221D23',\n errorColor: '#E63B2E',\n successColor: '#ADC76F',\n warnColor: '#FF963C'\n});`} |
| 70 | + </code> |
| 71 | + <code> |
| 72 | + {`import {Typography} from 'react-native-ui-lib';\n\nTypography.loadTypographies({\n heading: {fontSize: 36, fontWeight: '600'},\n subheading: {fontSize: 28, fontWeight: '500'},\n body: {fontSize: 18, fontWeight: '400'} \n});`} |
| 73 | + </code> |
| 74 | + <code>{`import {Spacings} from 'react-native-ui-lib';\n\nSpacings.loadSpacings({\n page: 20,\n card: 12,\n gridGutter: 16 \n});`}</code> |
| 75 | + </div> |
| 76 | + <p> |
| 77 | + <h3>Step 2</h3> Set a theme for your components. |
| 78 | + </p> |
| 79 | + <div className="code-examples"> |
| 80 | + <code> |
| 81 | + {`import {ThemeManager} from 'react-native-ui-lib';\n |
| 82 | +// with plain object \nThemeManager.setComponentTheme('Card', {\n borderRadius: 8,\n activeOpacity: 0.9 \n});`} |
| 83 | + </code> |
| 84 | + <code> |
| 85 | + {`// with a dynamic function |
| 86 | +ThemeManager.setComponentTheme('Button', (props, context) => { |
| 87 | + // 'square' is not an original Button prop, but a custom prop that can |
| 88 | + // be used to create different variations of buttons in your app |
| 89 | + if (props.square) { |
| 90 | + return { |
| 91 | + borderRadius: 0 |
| 92 | + }; |
| 93 | + } |
| 94 | +});`} |
| 95 | + </code> |
| 96 | + </div> |
| 97 | + <p> |
| 98 | + <h3>Step 3</h3> Build your app. With our auto-generated modifiers, it's a matter of minutes till you create your |
| 99 | + first beautiful screen. |
| 100 | + </p> |
| 101 | + <div className="code-examples"> |
| 102 | + <code> |
| 103 | + {`import React, {Component} from 'react'; |
| 104 | +import {View, Text, Card, Button} from 'react-native-ui-lib'; |
| 105 | +
|
| 106 | +class MyScreen extends Component { |
| 107 | + render() { |
| 108 | + return ( |
| 109 | + <View flex padding-page> |
| 110 | + <Text heading marginB-s4>My Screen</Text> |
| 111 | + <Card height={100} center padding-card marginB-s4> |
| 112 | + <Text body>This is an example card </Text> |
| 113 | + </Card> |
| 114 | + |
| 115 | + <Button label="Button" body bg-primaryColor square></Button> |
| 116 | + </View> |
| 117 | + ); |
| 118 | + } |
| 119 | +}`} |
| 120 | + </code> |
| 121 | + </div> |
| 122 | + </div> |
| 123 | + ); |
| 124 | +}; |
| 125 | + |
| 126 | +const NativeSection = () => { |
| 127 | + return ( |
| 128 | + <div className="native-section"> |
| 129 | + <h2>True, Beautiful components</h2> |
| 130 | + <p> |
| 131 | + Basic components like <b>Button</b>, <b>Avatar</b> and <b>Card</b> and more sophisticated ones like <b>Hints</b> |
| 132 | + , <b>ColorPicker</b> and <b>Drawer</b> |
| 133 | + </p> |
| 134 | + <div className="image-examples"> |
| 135 | + <img src="https://user-images.githubusercontent.com/1780255/72094962-3044b280-3320-11ea-8e41-aa83743bafb9.gif"/> |
| 136 | + <img src="https://user-images.githubusercontent.com/1780255/72094961-3044b280-3320-11ea-95e2-9aa745c8b07d.gif"/> |
| 137 | + <img src="https://user-images.githubusercontent.com/1780255/72094959-2fac1c00-3320-11ea-952b-53f864fd7ea4.gif"/> |
| 138 | + <img src="https://user-images.githubusercontent.com/1780255/72094958-2fac1c00-3320-11ea-8f67-9d759cfa4ae1.gif"/> |
| 139 | + <img src="https://user-images.githubusercontent.com/1780255/72094957-2fac1c00-3320-11ea-86a6-e47cf78093ec.gif"/> |
| 140 | + <img src="https://user-images.githubusercontent.com/1780255/72094955-2f138580-3320-11ea-811e-a808d90e7ff0.gif"/> |
| 141 | + </div> |
| 142 | + </div> |
| 143 | + ); |
| 144 | +}; |
| 145 | + |
| 146 | +const OthersSection = () => { |
| 147 | + return ( |
| 148 | + <div className="support-section"> |
| 149 | + <div> |
| 150 | + <h2>RTL and Accessibility in Mind</h2> |
| 151 | + <p>We provide full out-of-the-box support to RTL and Accessibility</p> |
| 152 | + </div> |
| 153 | + <div> |
| 154 | + <img src={rtl} height="500"/> |
| 155 | + </div> |
| 156 | + </div> |
| 157 | + ); |
| 158 | +}; |
| 159 | + |
24 | 160 | export default IndexPage;
|
0 commit comments