Skip to content

Commit 6f93363

Browse files
committed
Merge branch 'master' into feat/WheelPicker
2 parents 03ccb09 + 41d4917 commit 6f93363

File tree

104 files changed

+2532
-1316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+2532
-1316
lines changed

demo/src/demoApp.js

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import AsyncStorage from '@react-native-community/async-storage';
22
import {Navigation} from 'react-native-navigation';
33
import * as Animatable from 'react-native-animatable';
4-
import {
5-
AnimatableManager,
6-
ThemeManager,
7-
Constants,
8-
Colors,
9-
Typography
10-
} from 'react-native-ui-lib'; // eslint-disable-line
4+
import {AnimatableManager, Constants, Colors, Typography} from 'react-native-ui-lib'; // eslint-disable-line
115
import {registerScreens} from './screens';
126

7+
138
/** Examples - uncomment when needed */
149
// Typography.loadTypographies({
1510
// h1: {fontSize: 58, fontWeight: '300', lineHeight: 80},
@@ -21,16 +16,6 @@ import {registerScreens} from './screens';
2116
// gold: '#FFD700',
2217
// });
2318

24-
// ThemeManager.setTheme({
25-
// primaryColor: Colors.purple30,
26-
// CTA: {
27-
// backgroundColor: Colors.purple30,
28-
// textColor: Colors.dark10,
29-
// },
30-
// titleColor: Colors.blue10,
31-
// subtitleColor: Colors.blue40,
32-
// });
33-
3419
// ThemeManager.setComponentTheme('Picker', (props) => {
3520
// if (props.useNativePicker) {
3621
// return {
@@ -77,7 +62,7 @@ function getDefaultNavigationStyle() {
7762
statusBar: {
7863
visible: true,
7964
style: 'light',
80-
backgroundColor: ThemeManager.primaryColor // for Android
65+
backgroundColor: Colors.primary // for Android
8166
},
8267
layout: {
8368
backgroundColor: Colors.white,
@@ -88,7 +73,7 @@ function getDefaultNavigationStyle() {
8873
noBorder: true, // for iOS
8974
elevation: 0, // for Android
9075
background: {
91-
color: ThemeManager.primaryColor
76+
color: Colors.primary
9277
},
9378
title: {
9479
color: Colors.white,

demo/src/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ module.exports = {
4646
get DrawerScreen() {
4747
return require('./screens/componentScreens/DrawerScreen').default;
4848
},
49-
get TagsInputScreen() {
50-
return require('./screens/componentScreens/TagsInputScreen').default;
49+
get ExpandableSectionScreen() {
50+
return require('./screens/componentScreens/ExpandableSectionScreen').default;
51+
},
52+
get ChipsInputScreen() {
53+
return require('./screens/componentScreens/ChipsInputScreen').default;
5154
},
5255
get HintsScreen() {
5356
return require('./screens/componentScreens/HintsScreen').default;
@@ -103,7 +106,7 @@ module.exports = {
103106
get TextScreen() {
104107
return require('./screens/componentScreens/TextScreen').default;
105108
},
106-
// TODO: fix Expo issues (navigation) before un-commenting
109+
// TODO: fix Expo issues (navigation) before un-commenting
107110
// get TextFieldScreen() {
108111
// return require('./screens/componentScreens/TextFieldScreen').default;
109112
// },
@@ -157,7 +160,7 @@ module.exports = {
157160
get LoadingScreen() {
158161
return require('./screens/componentScreens/LoadingScreen').default;
159162
},
160-
// TODO: fix Expo issues (navigation) before un-commenting
163+
// TODO: fix Expo issues (navigation) before un-commenting
161164
// get ModalScreen() {
162165
// return require('./screens/componentScreens/ModalScreen').default;
163166
// },

demo/src/screens/CustomScreen.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

demo/src/screens/MenuStructure.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const navigationData = {
3131
{title: 'Cards', tags: 'cards feed', screen: 'unicorn.components.CardsScreen'},
3232
{title: 'Connection Status Bar', tags: 'connection status bar', screen: 'unicorn.components.ConnectionStatusBar'},
3333
{title: 'Chip', tags: 'chip', screen: 'unicorn.components.ChipScreen'},
34+
{title: 'ExpandableSection', tags: 'expandable section', screen: 'unicorn.components.ExpandableSectionScreen'},
3435
// {title: 'Overlays', tags: 'overlay image', screen: 'unicorn.components.OverlaysScreen'},
3536
{title: 'Page Control', tags: 'page', screen: 'unicorn.components.PageControlScreen'},
3637
{title: 'ProgressBar', tags: 'progress bar animated', screen: 'unicorn.animations.ProgressBarScreen'},
@@ -57,7 +58,7 @@ export const navigationData = {
5758
{title: 'Stepper', tags: 'stepper form', screen: 'unicorn.components.StepperScreen'},
5859
{title: 'Slider', tags: 'slider', screen: 'unicorn.components.SliderScreen'},
5960
{title: 'Switch', tags: 'switch toggle', screen: 'unicorn.components.SwitchScreen'},
60-
{title: 'TagsInput', tags: 'tags input form', screen: 'unicorn.components.TagsInputScreen'},
61+
{title: 'ChipsInput', tags: 'chips tags input form', screen: 'unicorn.components.ChipsInputScreen'},
6162
{title: 'Masked Inputs', tags: 'text input form mask', screen: 'unicorn.components.MaskedInputScreen'}
6263
]
6364
},

demo/src/screens/animationScreens/ListAnimationsScreen.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, {Component} from 'react';
22
import {Alert, StyleSheet, ScrollView, FlatList} from 'react-native';
33
import * as Animatable from 'react-native-animatable';
4-
import {AnimatableManager, ThemeManager, Colors, View, Button, ListItem, Text} from 'react-native-ui-lib';//eslint-disable-line
4+
import {AnimatableManager, Colors, View, Button, ListItem, Text} from 'react-native-ui-lib'; //eslint-disable-line
55

66

77
const listItems = [
@@ -31,7 +31,7 @@ export default class ListAnimationsScreen extends Component {
3131
entranceAnimation: true,
3232
addingAnimation: false,
3333
animation: animationType.ENTRANCE,
34-
counter: 0,
34+
counter: 0
3535
};
3636
}
3737

@@ -53,12 +53,14 @@ export default class ListAnimationsScreen extends Component {
5353
addItem() {
5454
const {items, counter} = this.state;
5555
const itemsCopy = [...items];
56+
5657
itemsCopy.splice(counter, 0, {id: `${itemsCopy.length}-new`, text: 'Item'});
5758
this.setState({items: itemsCopy, animation: animationType.ADDING});
5859
}
5960

6061
renderItem(item, index) {
6162
const {animation, counter} = this.state;
63+
6264
let animationProps;
6365
switch (animation) {
6466
case animationType.FADE_IN:
@@ -98,17 +100,17 @@ export default class ListAnimationsScreen extends Component {
98100
</View>
99101
<View row center>
100102
<Button outline size='medium' margin-10 label={`Add at index: ${counter}`} onPress={() => this.addItem()}/>
101-
<Button
102-
round outline size='large' label='+'
103+
<Button
104+
round outline size='large' label='+'
103105
onPress={() => this.setState({counter: counter < items.length ? counter + 1 : counter})}
104106
/>
105-
<Button
106-
round outline size='large' margin-10 label='-'
107+
<Button
108+
round outline size='large' margin-10 label='-'
107109
onPress={() => this.setState({counter: counter !== 0 ? counter - 1 : 0})}
108110
/>
109111
</View>
110112
<ScrollView style={{flex: 1}}>
111-
{visible &&
113+
{visible &&
112114
<FlatList
113115
data={items}
114116
renderItem={({item, index}) => this.renderItem(item, index)}
@@ -125,6 +127,6 @@ const styles = StyleSheet.create({
125127
paddingHorizontal: 20,
126128
backgroundColor: Colors.dark60,
127129
borderBottomWidth: 2,
128-
borderColor: ThemeManager.dividerColor,
129-
},
130+
borderColor: Colors.dark70
131+
}
130132
});

demo/src/screens/componentScreens/ActionBarScreen.js renamed to demo/src/screens/componentScreens/ActionBarScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import tags from '../../assets/icons/tags.png';
88
import collections from '../../assets/icons/collections.png';
99
import richText from '../../assets/icons/richText.png';
1010

11-
1211
export default class ActionBarScreen extends Component {
1312

1413
constructor(props) {

demo/src/screens/componentScreens/BasicListScreen.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import React, {Component} from 'react';
22
import {StyleSheet, Alert, FlatList} from 'react-native';
33
import * as Animatable from 'react-native-animatable';
4-
import {AnimatableManager, ThemeManager, Colors, BorderRadiuses, ListItem, Text} from 'react-native-ui-lib'; //eslint-disable-line
4+
import {AnimatableManager, Colors, BorderRadiuses, ListItem, Text} from 'react-native-ui-lib'; //eslint-disable-line
55
import orders from '../../data/orders';
66

77

88
export default class BasicListScreen extends Component {
99

1010
constructor(props) {
1111
super(props);
12-
12+
1313
this.state = {
1414
onEdit: false,
15-
updating: false,
15+
updating: false
1616
};
1717
}
1818

@@ -69,10 +69,10 @@ const styles = StyleSheet.create({
6969
width: 54,
7070
height: 54,
7171
borderRadius: BorderRadiuses.br20,
72-
marginHorizontal: 14,
72+
marginHorizontal: 14
7373
},
7474
border: {
7575
borderBottomWidth: StyleSheet.hairlineWidth,
76-
borderColor: ThemeManager.dividerColor,
77-
},
76+
borderColor: Colors.dark70
77+
}
7878
});

demo/src/screens/componentScreens/CardScannerScreen.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
import React, {Component} from 'react';
2-
import {StyleSheet} from 'react-native';
3-
import {View, Assets, Constants, Card, Button, Colors, Typography, Text, AnimatedScanner} from 'react-native-ui-lib'; //eslint-disable-line
2+
import {View, Card, Button, Colors, Text, AnimatedScanner} from 'react-native-ui-lib'; //eslint-disable-line
43
import posts from '../../data/posts';
54

5+
66
const featureIcon = require('../../assets/icons/star.png');
77
const shareIcon = require('../../assets/icons/share.png');
88

99
export default class CardScannerScreen extends Component {
1010
constructor(props) {
1111
super(props);
1212

13-
this.start = this.start.bind(this);
14-
this.reset = this.reset.bind(this);
15-
this.onBreak = this.onBreak.bind(this);
16-
1713
this.state = {
1814
progress: 0,
1915
started: false,
2016
reset: false,
21-
isDone: false,
17+
isDone: false
2218
};
2319
}
2420

25-
onBreak({isDone}) {
21+
onBreak = ({isDone}) => {
2622
if (!isDone) {
2723
this.start();
2824
} else {
29-
this.setState({
30-
isDone,
31-
});
25+
this.setState({isDone});
3226
}
3327
}
3428

35-
start() {
29+
start = () => {
3630
const {progress} = this.state;
31+
3732
this.setState({
3833
started: true,
3934
reset: false,
40-
progress: progress + 25,
35+
progress: progress + 25
4136
});
4237
}
4338

44-
reset() {
39+
reset = () => {
4540
this.setState({
4641
started: false,
4742
progress: 0,
4843
reset: true,
49-
isDone: false,
44+
isDone: false
5045
});
5146
}
5247

5348
render() {
5449
const {reset} = this.state;
5550
const post = posts[0];
5651
const statusColor = post.status === 'Published' ? Colors.green30 : Colors.orange30;
52+
5753
return (
5854
<View flex useSafeArea>
5955
<View flex padding-20>
60-
<View paddingL-40 height={6} width={'100%'} bg-violet50 marginB-20>
61-
<AnimatedScanner backgroundColor={Colors.purple30} progress={98} duration={1600} />
56+
<View paddingL-40 marginB-20>
57+
<AnimatedScanner
58+
backgroundColor={Colors.purple30}
59+
progress={98} duration={1600}
60+
containerStyle={{backgroundColor: Colors.violet50, height: 6}}
61+
/>
6262
</View>
6363

6464
<Card containerStyle={{marginBottom: 15}} onPress={() => console.log('press on a card')}>
65-
<Card.Image height={115} imageSource={post.coverImage} />
65+
<Card.Image height={115} source={post.coverImage}/>
6666
<View padding-20>
6767
<Text text40 color={Colors.dark10}>
6868
{post.title}
@@ -80,8 +80,8 @@ export default class CardScannerScreen extends Component {
8080
{post.likes} Likes
8181
</Text>
8282
<View row spread>
83-
<Button style={{marginRight: 10}} text90 link iconSource={featureIcon} label="Feature" />
84-
<Button text90 link iconSource={shareIcon} label="Share" />
83+
<Button style={{marginRight: 10}} text90 link iconSource={featureIcon} label="Feature"/>
84+
<Button text90 link iconSource={shareIcon} label="Share"/>
8585
</View>
8686
</View>
8787

@@ -107,8 +107,8 @@ export default class CardScannerScreen extends Component {
107107
</View>
108108

109109
<View row center padding-20>
110-
<Button size="medium" label="Reset" onPress={this.reset} disabled={!this.state.isDone} />
111-
<Button marginL-10 size="medium" label="Publish" onPress={this.start} disabled={this.state.started} />
110+
<Button size="medium" label="Reset" onPress={this.reset} disabled={!this.state.isDone}/>
111+
<Button marginL-10 size="medium" label="Publish" onPress={this.start} disabled={this.state.started}/>
112112
</View>
113113
</View>
114114
);

0 commit comments

Comments
 (0)