Skip to content

Commit 4370b8f

Browse files
committed
Merge branch 'master' into release
2 parents 0c6b107 + 9f58b30 commit 4370b8f

File tree

81 files changed

+2259
-321
lines changed

Some content is hidden

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

81 files changed

+2259
-321
lines changed
File renamed without changes.

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ ios/
234234
android/
235235
demo/
236236
expoDemo/
237+
webDemo/
237238
uilib-docs/
238239
markdowns/
239240
.babelrc

demo/src/screens/MenuStructure.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,7 @@ export const navigationData = {
201201
]
202202
}
203203
};
204+
205+
if (__DEV__) {
206+
navigationData.Foundation.screens.unshift({title: 'Playground', screen: 'unicorn.PlaygroundScreen'});
207+
}

demo/src/screens/SettingsScreen.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,33 @@ import _ from 'lodash';
22
import React, {Component} from 'react';
33
import AsyncStorage from '@react-native-community/async-storage';
44
import {StyleSheet, I18nManager} from 'react-native';
5-
import {Colors, View, Text, Picker, Toast, Switch} from 'react-native-ui-lib'; //eslint-disable-line
5+
import {Colors, View, Text, Picker, Incubator, Switch} from 'react-native-ui-lib'; //eslint-disable-line
66
import {navigationData} from './MenuStructure';
77

88
const none = {label: '[None]', value: ''};
9-
const playgroundScreen = {label: 'Playground', value: 'unicorn.PlaygroundScreen'};
109

1110
class SettingsScreen extends Component {
1211
constructor(props) {
1312
super(props);
1413

1514
const data = props.navigationData || navigationData;
16-
const playground = props.playground || playgroundScreen;
15+
const playground = props.playground;
16+
17+
const screens = [
18+
none,
19+
..._.flow(_.values,
20+
screens => _.map(screens, 'screens'),
21+
_.flatten,
22+
screens => _.map(screens, screen => ({label: screen.title, value: screen.screen})))(data)
23+
];
24+
25+
if (playground) {
26+
screens.splice(1, 0, playground);
27+
}
1728

1829
this.state = {
1930
showRefreshMessage: false,
20-
screens: [
21-
none,
22-
playground,
23-
..._.flow(_.values,
24-
screens => _.map(screens, 'screens'),
25-
_.flatten,
26-
screens => _.map(screens, screen => ({label: screen.title, value: screen.screen})))(data)
27-
]
31+
screens
2832
};
2933
}
3034

@@ -107,7 +111,10 @@ class SettingsScreen extends Component {
107111
<Text text30 grey10>
108112
Settings
109113
</Text>
110-
<Toast visible={showRefreshMessage} position="bottom" message="Refresh the app!"/>
114+
<Incubator.Toast
115+
visible={showRefreshMessage}
116+
message={`Default screen set to: ${defaultScreen?.label}. Please refresh the app.`}
117+
/>
111118
</View>
112119
);
113120
}

demo/src/screens/componentScreens/ActionSheetScreen.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default class ActionSheetScreen extends Component {
6464
cancelButtonIndex={3}
6565
destructiveButtonIndex={0}
6666
useNativeIOS={false}
67+
migrateDialog
6768
options={[
6869
{label: 'option 1', onPress: () => this.pickOption('option 1')},
6970
{label: 'option 2', onPress: () => this.pickOption('option 2')},
@@ -79,6 +80,7 @@ export default class ActionSheetScreen extends Component {
7980
message={'Message of action sheet'}
8081
cancelButtonIndex={3}
8182
destructiveButtonIndex={0}
83+
migrateDialog
8284
options={[
8385
{label: 'option 1', onPress: () => this.pickOption('option 1'), iconSource: collectionsIcon},
8486
{label: 'option 2', onPress: () => this.pickOption('option 2'), iconSource: shareIcon},

demo/src/screens/componentScreens/ChipScreen.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _ from 'lodash';
22
import React, {Component} from 'react';
33
import {Alert} from 'react-native';
4-
import {Chip, Colors, Spacings, Text, Typography, View, Dialog, WheelPickerDialog, Image} from 'react-native-ui-lib';
4+
import {Chip, Colors, Spacings, Text, Typography, View, Incubator, WheelPickerDialog, Image} from 'react-native-ui-lib';
55

66
const avatarImage = {
77
uri: 'https://randomuser.me/api/portraits/women/24.jpg'
@@ -72,9 +72,9 @@ export default class ChipScreen extends Component {
7272
const {showDialog} = this.state;
7373

7474
return (
75-
<Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
75+
<Incubator.Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
7676
{this.renderContent()}
77-
</Dialog>
77+
</Incubator.Dialog>
7878
);
7979
};
8080

@@ -90,7 +90,7 @@ export default class ChipScreen extends Component {
9090
render() {
9191
return (
9292
<View style={{padding: 20}}>
93-
{this.state.showDialog && this.renderPickerDialog()}
93+
{this.renderPickerDialog()}
9494
<Text marginB-20 text40 $textDefault>
9595
Chip
9696
</Text>

demo/src/screens/componentScreens/FloatingButtonScreen.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import React, {Component} from 'react';
22
import {View, StyleSheet, Alert, ScrollView} from 'react-native';
3-
import {Colors, Text, FloatingButton} from 'react-native-ui-lib';
3+
import {Colors, Text, FloatingButton, FloatingButtonLayouts} from 'react-native-ui-lib';
44
import {renderBooleanOption} from '../ExampleScreenPresenter';
55

66
interface State {
77
showButton: boolean;
88
showSecondary: boolean;
9+
showVertical: boolean;
910
}
1011

1112
export default class FloatingButtonScreen extends Component<{}, State> {
1213
state = {
1314
showButton: true,
14-
showSecondary: true
15+
showSecondary: true,
16+
showVertical: true
1517
};
1618

1719
notNow = () => {
@@ -25,14 +27,15 @@ export default class FloatingButtonScreen extends Component<{}, State> {
2527
};
2628

2729
render() {
28-
const {showSecondary} = this.state;
30+
const {showSecondary, showVertical} = this.state;
2931
return (
3032
<View style={styles.container}>
3133
<Text text60 center $textDefault marginB-s4>
3234
Trigger Floating Button
3335
</Text>
3436
{renderBooleanOption.call(this, 'Show Floating Button', 'showButton')}
3537
{renderBooleanOption.call(this, 'Show Secondary Button', 'showSecondary')}
38+
{renderBooleanOption.call(this, 'Button Layout Vertical', 'showVertical')}
3639

3740
<ScrollView showsVerticalScrollIndicator={false}>
3841
<View paddingT-20>
@@ -69,11 +72,11 @@ export default class FloatingButtonScreen extends Component<{}, State> {
6972
showSecondary
7073
? {
7174
label: 'Not now',
72-
onPress: this.notNow,
73-
color: Colors.$textDangerLight
75+
onPress: this.notNow
7476
}
7577
: undefined
7678
}
79+
buttonLayout={showVertical ? FloatingButtonLayouts.VERTICAL : FloatingButtonLayouts.HORIZONTAL}
7780
// bottomMargin={80}
7881
// hideBackgroundOverlay
7982
// withoutAnimation

demo/src/screens/componentScreens/PickerScreen.tsx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import _ from 'lodash';
22
import React, {Component} from 'react';
3-
import {ScrollView} from 'react-native';
3+
import {ScrollView} from 'react-native-gesture-handler';
44
import {
55
View,
66
Colors,
77
Icon,
8-
Dialog,
8+
Incubator,
99
Text,
1010
Picker,
1111
Avatar,
@@ -14,7 +14,6 @@ import {
1414
Typography,
1515
PickerProps,
1616
PickerMethods,
17-
DialogProps,
1817
Button
1918
} from 'react-native-ui-lib'; //eslint-disable-line
2019
import contactsData from '../../data/conversations';
@@ -61,20 +60,11 @@ export default class PickerScreen extends Component {
6160
contact: 0
6261
};
6362

64-
dialogHeader: DialogProps['renderPannableHeader'] = props => {
65-
const {title} = props;
66-
return (
67-
<Text margin-15 text60 $textDefault>
68-
{title}
69-
</Text>
70-
);
71-
};
72-
7363
renderDialog: PickerProps['renderCustomModal'] = modalProps => {
7464
const {visible, children, toggleModal, onDone} = modalProps;
7565

7666
return (
77-
<Dialog
67+
<Incubator.Dialog
7868
visible={visible}
7969
onDismiss={() => {
8070
onDone();
@@ -85,12 +75,11 @@ export default class PickerScreen extends Component {
8575
bottom
8676
useSafeArea
8777
containerStyle={{backgroundColor: Colors.$backgroundDefault}}
88-
renderPannableHeader={this.dialogHeader}
89-
panDirection={PanningProvider.Directions.DOWN}
90-
pannableHeaderProps={{title: 'Custom modal'}}
78+
direction={PanningProvider.Directions.DOWN}
79+
headerProps={{title: 'Custom modal'}}
9180
>
9281
<ScrollView>{children}</ScrollView>
93-
</Dialog>
82+
</Incubator.Dialog>
9483
);
9584
};
9685

0 commit comments

Comments
 (0)