Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wix/react-native-ui-lib i…
Browse files Browse the repository at this point in the history
…nto release
  • Loading branch information
Inbal-Tish committed May 16, 2024
2 parents 4256384 + 8ef823c commit a5a20a3
Show file tree
Hide file tree
Showing 44 changed files with 585 additions and 363 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
25 changes: 25 additions & 0 deletions demo/src/assets/Assets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {Assets} from 'react-native-ui-lib';
Assets.loadAssetsGroup('icons.demo', {
chevronDown: require('./icons/chevronDown.png'),
chevronRight: require('./icons/chevronRight.png'),
add: require('./icons/add.png'),
camera: require('./icons/cameraSelected.png'),
close: require('./icons/close.png'),
dashboard: require('./icons/dashboard.png'),
drag: require('./icons/drag.png'),
image: require('./icons/image.png'),
plus: require('./icons/plus.png'),
refresh: require('./icons/refresh.png'),
search: require('./icons/search.png'),
settings: require('./icons/settings.png'),
share: require('./icons/share.png')
});

Assets.loadAssetsGroup('images.demo', {
brokenImage: require('./images/placeholderMissingImage.png')
});

Assets.loadAssetsGroup('svgs.demo', {
logo: require('./svgs/headerLogo.svg').default
});
export default Assets as typeof Assets;
29 changes: 3 additions & 26 deletions demo/src/configurations.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
import {Assets, Colors, Typography, Spacings, Incubator} from 'react-native-ui-lib'; // eslint-disable-line
import {Colors, Typography, Spacings, TextField} from 'react-native-ui-lib'; // eslint-disable-line

export const loadDemoConfigurations = () => {
Assets.loadAssetsGroup('icons.demo', {
chevronDown: require('./assets/icons/chevronDown.png'),
chevronRight: require('./assets/icons/chevronRight.png'),
add: require('./assets/icons/add.png'),
camera: require('./assets/icons/cameraSelected.png'),
close: require('./assets/icons/close.png'),
dashboard: require('./assets/icons/dashboard.png'),
drag: require('./assets/icons/drag.png'),
image: require('./assets/icons/image.png'),
plus: require('./assets/icons/plus.png'),
refresh: require('./assets/icons/refresh.png'),
search: require('./assets/icons/search.png'),
settings: require('./assets/icons/settings.png'),
share: require('./assets/icons/share.png')
});

Assets.loadAssetsGroup('images.demo', {
brokenImage: require('./assets/images/placeholderMissingImage.png')
});

Assets.loadAssetsGroup('svgs.demo', {
logo: require('./assets/svgs/headerLogo.svg').default
});

require('./assets/Assets');
Typography.loadTypographies({
h1: {...Typography.text40},
h2: {...Typography.text50},
Expand Down Expand Up @@ -56,5 +33,5 @@ export const loadDemoConfigurations = () => {
});

/* Components */
Incubator.TextField.defaultProps = {...Incubator.TextField.defaultProps, preset: 'default'};
TextField.defaultProps = {...TextField.defaultProps, preset: TextField.presets.UNDERLINE};
};
3 changes: 2 additions & 1 deletion demo/src/screens/componentScreens/DrawerScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, {Component} from 'react';
import {StyleSheet, ScrollView, LayoutAnimation} from 'react-native';
import {Assets, Colors, Typography, View, Drawer, Text, Button, Avatar, Badge, DrawerProps} from 'react-native-ui-lib';
import {Colors, Typography, View, Drawer, Text, Button, Avatar, Badge, DrawerProps} from 'react-native-ui-lib';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
import conversations from '../../data/conversations';
import Assets from '../../assets/Assets';

import {renderBooleanOption, renderSliderOption, renderColorOption} from '../ExampleScreenPresenter';

Expand Down
3 changes: 2 additions & 1 deletion demo/src/screens/componentScreens/HintsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import _ from 'lodash';
import React, {Component} from 'react';
import {Alert, ViewStyle} from 'react-native';
import {Colors, View, Text, Hint, Button, Assets, Incubator} from 'react-native-ui-lib';
import {Colors, View, Text, Hint, Button, Incubator} from 'react-native-ui-lib';
import {renderMultipleSegmentOptions, renderBooleanOption} from '../ExampleScreenPresenter';
import Assets from '../../assets/Assets';

const settingsIcon = require('../../assets/icons/settings.png');
const reactions = ['❤️', '😮', '😔', '😂', '😡'];
Expand Down
10 changes: 7 additions & 3 deletions demo/src/screens/componentScreens/ImageScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, {Component} from 'react';
import {ScrollView} from 'react-native';
import {View, Text, Icon, Image, Colors, Assets, OverlayTypes} from 'react-native-ui-lib';
import {View, Text, Icon, Image, Colors, OverlayTypes} from 'react-native-ui-lib';
import {renderBooleanOption, renderRadioGroup, renderSliderOption} from '../ExampleScreenPresenter';
import Assets from '../../assets/Assets';

const IMAGE_URL =
'https://images.pexels.com/photos/748837/pexels-photo-748837.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260';
Expand Down Expand Up @@ -69,7 +70,8 @@ class ImageScreen extends Component<{}, State> {
showErrorImage: false,
showSvg: false,
svgType: SvgType.File,
sizeType: SizeType.None
sizeType: SizeType.None,
borderRadius: 0
};

getSvgSource() {
Expand Down Expand Up @@ -112,7 +114,7 @@ class ImageScreen extends Component<{}, State> {
}

renderImage() {
const {cover, overlayType, overlayIntensity, margin, showErrorImage} = this.state;
const {cover, overlayType, overlayIntensity, margin, showErrorImage, borderRadius} = this.state;
return (
<Image
key={`${overlayType}-${overlayIntensity}`}
Expand All @@ -126,6 +128,7 @@ class ImageScreen extends Component<{}, State> {
height={!cover ? DEFAULT_SIZE : undefined}
customOverlayContent={this.renderOverlayContent()}
{...{[`margin-${margin}`]: true}}
borderRadius={borderRadius}
/>
);
}
Expand Down Expand Up @@ -156,6 +159,7 @@ class ImageScreen extends Component<{}, State> {
{renderRadioGroup.call(this, 'Overlay Intensity', 'overlayIntensity', Image.overlayIntensityType)}
</View>
{renderSliderOption.call(this, 'Margin(margin-XX)', 'margin', {step: 4, min: 0, max: 40})}
{renderSliderOption.call(this, 'Border Radius', 'borderRadius', {step: 5, min: 0, max: 100})}
</>
);
}
Expand Down
3 changes: 2 additions & 1 deletion demo/src/screens/componentScreens/ModalScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, {Component} from 'react';
import {Alert, StyleSheet} from 'react-native';
import {Navigation} from 'react-native-navigation';
import {Colors, Carousel, PageControl, Modal, View, Text, Assets} from 'react-native-ui-lib'; // eslint-disable-line
import {Colors, Carousel, PageControl, Modal, View, Text} from 'react-native-ui-lib'; // eslint-disable-line
import Assets from '../../assets/Assets';

const BUTTONS_HIT_SLOP = {right: 5, left: 5, top: 10, bottom: 10};
interface ModalScreenProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class SortableGridListScreen extends Component {
</View>
<View flex>
<SortableGridList
flexMigration
data={items}
renderItem={this.renderItem}
// numColumns={2}
Expand Down
3 changes: 2 additions & 1 deletion demo/src/screens/componentScreens/SortableListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
TouchableOpacity,
Text,
Icon,
Assets,
Colors,
Button
} from 'react-native-ui-lib';
import Assets from '../../assets/Assets';
import {renderHeader} from '../ExampleScreenPresenter';

interface Item extends SortableListItemProps {
Expand Down Expand Up @@ -112,6 +112,7 @@ const SortableListScreen = () => {
</View>
<View flex useSafeArea>
<SortableList
flexMigration
data={items}
renderItem={renderItem}
keyExtractor={keyExtractor}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import _ from 'lodash';
import React, {Component} from 'react';
import {ActivityIndicator, StyleSheet} from 'react-native';
import {
Assets,
TabController,
Colors,
View,
Expand All @@ -12,6 +11,7 @@ import {
TabControllerImperativeMethods
} from 'react-native-ui-lib';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
import Assets from '../../../assets/Assets';

import Tab1 from './tab1';
import Tab2 from './tab2';
Expand Down
Loading

0 comments on commit a5a20a3

Please sign in to comment.