Skip to content

Commit 341c477

Browse files
committed
Merge branch 'master' into release
2 parents e5a0dea + 2b9b512 commit 341c477

File tree

86 files changed

+2073
-1423
lines changed

Some content is hidden

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

86 files changed

+2073
-1423
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
extends: ['plugin:@typescript-eslint/recommended', 'wix/react-native'],
2+
extends: ['plugin:@typescript-eslint/recommended', 'wix/react-native', 'plugin:react-hooks/recommended'],
33
parser: '@typescript-eslint/parser',
44
rules: {
55
'arrow-parens': 'off',

.prettierrc

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
// "eslintIntegration": true,
3-
// "printWidth": 120,
4-
// "useTabs": false,
5-
// "semi": true,
6-
// "singleQuote": true,
7-
// "jsxSingleQuote": false,
8-
// "trailingComma": "none",
9-
// "bracketSpacing": false,
10-
// "arrowParens": "avoid"
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"bracketSpacing": false
116
}

demo/src/assets/icons/refresh.png

345 Bytes
Loading
499 Bytes
Loading
578 Bytes
Loading
834 Bytes
Loading
1.1 KB
Loading

demo/src/assets/icons/search.png

334 Bytes
Loading
515 Bytes
Loading
588 Bytes
Loading
845 Bytes
Loading
1.12 KB
Loading

demo/src/demoApp.js

+33-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
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 {AnimatableManager, ThemeManager, Constants, Assets, Colors, Typography} from 'react-native-ui-lib'; // eslint-disable-line
4+
import {
5+
AnimatableManager,
6+
ThemeManager,
7+
Constants,
8+
Assets,
9+
Colors,
10+
Typography,
11+
Spacings
12+
} from 'react-native-ui-lib'; // eslint-disable-line
513
import {registerScreens} from './screens';
614

15+
Assets.loadAssetsGroup('icons.demo', {
16+
refresh: require('./assets/icons/refresh.png'),
17+
search: require('./assets/icons/search.png')
18+
});
19+
20+
Typography.loadTypographies({
21+
h1: {...Typography.text40},
22+
h2: {...Typography.text50},
23+
h3: {...Typography.text60}
24+
});
25+
26+
Spacings.loadSpacings({
27+
page: Spacings.s5
28+
});
29+
730
/** Examples - uncomment when needed */
831
// Typography.loadTypographies({
932
// h1: {fontSize: 58, fontWeight: '300', lineHeight: 80},
@@ -36,10 +59,6 @@ import {registerScreens} from './screens';
3659
// }
3760
// });
3861

39-
// Assets.loadAssetsGroup('icons.general', {
40-
// camera: require('./assets/icons/cameraSelected.png'),
41-
// });
42-
4362
// AnimatableManager.loadAnimationPresets({
4463
// preset1: {
4564
// animation: 'fadeIn',
@@ -66,7 +85,9 @@ import {registerScreens} from './screens';
6685
// },
6786
// };
6887
// IMPORTANT! Make uilib's animations available globally for the app's use (option to pass adittional animation definitions)
69-
Animatable.initializeRegistryWithDefinitions(AnimatableManager.loadAnimationDefinitions(/** customAnimationsDefinitions */));
88+
Animatable.initializeRegistryWithDefinitions(
89+
AnimatableManager.loadAnimationDefinitions(/** customAnimationsDefinitions */)
90+
);
7091

7192
function getDefaultNavigationStyle() {
7293
return {
@@ -89,13 +110,17 @@ function getDefaultNavigationStyle() {
89110
title: {
90111
color: Colors.white,
91112
fontSize: Typography.text60H.fontSize,
92-
fontFamily: Constants.isAndroid ? Typography.text65H.fontFamily : '.SFUIText-Heavy',
113+
fontFamily: Constants.isAndroid
114+
? Typography.text65H.fontFamily
115+
: '.SFUIText-Heavy',
93116
fontWeight: 'heavy'
94117
},
95118
subtitle: {
96119
color: Colors.white,
97120
fontSize: Typography.text80T.fontSize,
98-
fontFamily: Constants.isAndroid ? Typography.text80.fontFamily : '.SFUIText-Medium',
121+
fontFamily: Constants.isAndroid
122+
? Typography.text80.fontFamily
123+
: '.SFUIText-Medium',
99124
fontWeight: 'medium'
100125
},
101126
backButton: {

demo/src/screens/ExampleScreenPresenter.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ export function renderBooleanGroup(title, options) {
5959
);
6060
}
6161

62-
export function renderRadioGroup(title, key, options, {isRow, afterValueChanged} = {}) {
62+
export function renderRadioGroup(title, key, options, {isRow, afterValueChanged, useValueAsLabel} = {}) {
6363
const value = this.state[key];
6464
return (
6565
<View marginB-s2>
66-
<Text text70M marginB-s2>
66+
{!_.isUndefined(title) && <Text text70M marginB-s2>
6767
{title}
68-
</Text>
68+
</Text>}
6969
<RadioGroup
7070
row={isRow}
7171
style={isRow && styles.rowWrap}
@@ -80,7 +80,7 @@ export function renderRadioGroup(title, key, options, {isRow, afterValueChanged}
8080
key={key}
8181
marginB-s2
8282
marginR-s2={isRow}
83-
label={key}
83+
label={useValueAsLabel ? value : key}
8484
value={value}
8585
/>
8686
);

demo/src/screens/MenuStructure.js

+5
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ export const navigationData = {
8989
{title: 'StateScreen', tags: 'empty state screen', screen: 'unicorn.screens.EmptyStateScreen'},
9090
{title: 'TabController', tags: 'tabbar controller native', screen: 'unicorn.components.TabControllerScreen'},
9191
{title: 'TabBar', tags: 'tab bar', screen: 'unicorn.components.TabBarScreen'},
92+
{
93+
title: 'withScrollEnabler',
94+
tags: 'scroll enabled withScrollEnabler',
95+
screen: 'unicorn.components.WithScrollEnablerScreen'
96+
},
9297
{title: 'Wizard', tags: 'wizard', screen: 'unicorn.components.WizardScreen'}
9398
]
9499
},

demo/src/screens/componentScreens/CardsScreen.js

-217
This file was deleted.

0 commit comments

Comments
 (0)