Skip to content

Commit b20750a

Browse files
authored
Layouts - to design tokens (#1949)
* Carousel - to design tokens * GridListItem - to design tokens * SkeletonView - to design tokens
1 parent 3403c0d commit b20750a

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

demo/src/screens/componentScreens/CarouselScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CarouselScreen extends Component<Props, State> {
8787

8888
return (
8989
<ScrollView showsVerticalScrollIndicator={false}>
90-
<Text h1 margin-20>
90+
<Text h1 margin-20 $textDefault>
9191
Carousel
9292
</Text>
9393

@@ -115,7 +115,6 @@ class CarouselScreen extends Component<Props, State> {
115115
containerStyle={{height: 160}}
116116
pageControlPosition={Carousel.pageControlPositions.UNDER}
117117
pageControlProps={{onPagePress: this.onPagePress, limitShownPages}}
118-
// showCounter
119118
allowAccessibleLayout
120119
>
121120
{_.map([...Array(numberOfPagesShown)], (item, index) => (
@@ -143,6 +142,7 @@ class CarouselScreen extends Component<Props, State> {
143142
containerStyle: styles.loopCarousel
144143
}}
145144
pageControlPosition={Carousel.pageControlPositions.OVER}
145+
showCounter
146146
>
147147
{IMAGES.map((image, i) => {
148148
return (

src/components/carousel/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,13 @@ class Carousel extends Component<CarouselProps, CarouselState> {
409409
const {pageControlPosition, pageControlProps = {}} = this.props;
410410

411411
if (pageControlPosition) {
412-
const {size = 6, spacing = 8, color = Colors.grey20, inactiveColor = Colors.grey60, ...others} = pageControlProps;
412+
const {
413+
size = 6,
414+
spacing = 8,
415+
color = Colors.$backgroundNeutralHeavy,
416+
inactiveColor = Colors.$backgroundNeutralMedium,
417+
...others
418+
} = pageControlProps;
413419
const pagesCount = presenter.getChildrenLength(this.props);
414420
const containerStyle =
415421
pageControlPosition === PageControlPosition.UNDER

src/components/gridListItem/index.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import _ from 'lodash';
12
import React, {Component} from 'react';
23
import {StyleProp, StyleSheet, ViewStyle} from 'react-native';
3-
import _ from 'lodash';
44
import * as Modifiers from '../../commons/modifiers';
55
import {Colors, Spacings, Typography} from 'style';
66
import View, {ViewProps} from '../view';
7-
import Text from '../text';
87
import TouchableOpacity, {TouchableOpacityProps} from '../touchableOpacity';
8+
import Text from '../text';
99
import Image, {ImageProps} from '../image';
1010

1111
export interface GridListItemProps {
@@ -165,17 +165,17 @@ class GridListItem extends Component<GridListItemProps> {
165165
children,
166166
title,
167167
titleTypography,
168-
titleColor,
168+
titleColor = Colors.$textDefault,
169169
titleLines,
170170
overlayText,
171171
overlayTextContainerStyle,
172172
subtitle,
173173
subtitleTypography,
174-
subtitleColor,
174+
subtitleColor = Colors.$textDefault,
175175
subtitleLines,
176176
description,
177177
descriptionTypography,
178-
descriptionColor,
178+
descriptionColor = Colors.$textDefault,
179179
descriptionLines,
180180
onPress,
181181
renderOverlay
@@ -255,8 +255,7 @@ const styles = StyleSheet.create({
255255
},
256256
description: {
257257
textAlign: 'center',
258-
...Typography.subtext,
259-
color: Colors.grey30
258+
...Typography.subtext
260259
},
261260
contentAlignedToStart: {
262261
textAlign: 'left'

src/components/skeletonView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class SkeletonView extends Component<InternalSkeletonViewProps, SkeletonState> {
243243
}
244244

245245
return {
246-
shimmerColors: colors || [Colors.grey70, Colors.grey60, Colors.grey70],
246+
shimmerColors: colors || [Colors.$backgroundNeutral, Colors.$backgroundNeutralMedium, Colors.$backgroundNeutral],
247247
isReversed: Constants.isRTL,
248248
style: [{borderRadius}, style],
249249
width: size || width,

0 commit comments

Comments
 (0)