Skip to content

Commit

Permalink
Set foundation presets for our demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanshar committed Jun 10, 2020
1 parent 7a6e86f commit 2ff0412
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions demo/src/demoApp.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
import AsyncStorage from '@react-native-community/async-storage';
import {Navigation} from 'react-native-navigation';
import * as Animatable from 'react-native-animatable';
import {AnimatableManager, ThemeManager, Constants, Assets, Colors, Typography} from 'react-native-ui-lib'; // eslint-disable-line
import {
AnimatableManager,
ThemeManager,
Constants,
Assets,
Colors,
Typography,
Spacings
} from 'react-native-ui-lib'; // eslint-disable-line
import {registerScreens} from './screens';


Assets.loadAssetsGroup('icons.demo', {
refresh: require('./assets/icons/refresh.png')
});

Typography.loadTypographies({
h1: {...Typography.text40},
h2: {...Typography.text50},
h3: {...Typography.text60}
});

Spacings.loadSpacings({
page: Spacings.s5
});

/** Examples - uncomment when needed */
// Typography.loadTypographies({
// h1: {fontSize: 58, fontWeight: '300', lineHeight: 80},
Expand Down Expand Up @@ -41,7 +58,6 @@ Assets.loadAssetsGroup('icons.demo', {
// }
// });


// AnimatableManager.loadAnimationPresets({
// preset1: {
// animation: 'fadeIn',
Expand All @@ -68,7 +84,9 @@ Assets.loadAssetsGroup('icons.demo', {
// },
// };
// IMPORTANT! Make uilib's animations available globally for the app's use (option to pass adittional animation definitions)
Animatable.initializeRegistryWithDefinitions(AnimatableManager.loadAnimationDefinitions(/** customAnimationsDefinitions */));
Animatable.initializeRegistryWithDefinitions(
AnimatableManager.loadAnimationDefinitions(/** customAnimationsDefinitions */)
);

function getDefaultNavigationStyle() {
return {
Expand All @@ -91,13 +109,17 @@ function getDefaultNavigationStyle() {
title: {
color: Colors.white,
fontSize: Typography.text60H.fontSize,
fontFamily: Constants.isAndroid ? Typography.text65H.fontFamily : '.SFUIText-Heavy',
fontFamily: Constants.isAndroid
? Typography.text65H.fontFamily
: '.SFUIText-Heavy',
fontWeight: 'heavy'
},
subtitle: {
color: Colors.white,
fontSize: Typography.text80T.fontSize,
fontFamily: Constants.isAndroid ? Typography.text80.fontFamily : '.SFUIText-Medium',
fontFamily: Constants.isAndroid
? Typography.text80.fontFamily
: '.SFUIText-Medium',
fontWeight: 'medium'
},
backButton: {
Expand Down

0 comments on commit 2ff0412

Please sign in to comment.