Skip to content

Commit f199619

Browse files
committed
include configuration of demo app presets with the example screens registration
1 parent 341c477 commit f199619

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

demo/src/configurations.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {Assets, Typography, Spacings} from 'react-native-ui-lib'; // eslint-disable-line
2+
3+
Assets.loadAssetsGroup('icons.demo', {
4+
refresh: require('./assets/icons/refresh.png'),
5+
search: require('./assets/icons/search.png')
6+
});
7+
8+
Typography.loadTypographies({
9+
h1: {...Typography.text40},
10+
h2: {...Typography.text50},
11+
h3: {...Typography.text60}
12+
});
13+
14+
Spacings.loadSpacings({
15+
page: Spacings.s5
16+
});

demo/src/demoApp.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,11 @@ import {
55
AnimatableManager,
66
ThemeManager,
77
Constants,
8-
Assets,
98
Colors,
10-
Typography,
11-
Spacings
9+
Typography
1210
} from 'react-native-ui-lib'; // eslint-disable-line
1311
import {registerScreens} from './screens';
1412

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-
3013
/** Examples - uncomment when needed */
3114
// Typography.loadTypographies({
3215
// h1: {fontSize: 58, fontWeight: '300', lineHeight: 80},

demo/src/screens/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
22

33
export function registerScreens(registrar) {
4+
// load demo app presets
5+
require('../configurations');
46

57
require('./componentScreens').registerScreens(registrar);
68
require('./foundationScreens').registerScreens(registrar);
@@ -13,4 +15,5 @@ export function registerScreens(registrar) {
1315
registrar('unicorn.PlaygroundScreen', () => gestureHandlerRootHOC(require('./PlaygroundScreen').default));
1416
registrar('unicorn.Settings', () => require('./SettingsScreen').default);
1517
registrar('unicorn.CustomScreen', () => require('./CustomScreen').default);
18+
1619
}

0 commit comments

Comments
 (0)