Skip to content

Commit 1e9da34

Browse files
author
HuyDo
committed
fix: change colos by theme
1 parent c3a8427 commit 1e9da34

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,11 @@ SPEC CHECKSUMS:
645645
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
646646
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
647647
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
648-
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
649-
hermes-engine: a1f157c49ea579c28b0296bda8530e980c45bdb3
648+
glog: 791fe035093b84822da7f0870421a25839ca7870
649+
hermes-engine: 5d86dc4303697a1251c830f0ee45e6e9f33877d4
650650
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
651651
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
652-
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
652+
RCT-Folly: 186619bc27c1f94f2f7c6ef60927516c71005915
653653
RCTRequired: 5a024fdf458fa8c0d82fc262e76f982d4dcdecdd
654654
RCTTypeSafety: b6c253064466411c6810b45f66bc1e43ce0c54ba
655655
React: 715292db5bd46989419445a5547954b25d2090f0
@@ -689,4 +689,4 @@ SPEC CHECKSUMS:
689689

690690
PODFILE CHECKSUM: 41b345e700f785c9a103f926104c4c507c89b32e
691691

692-
COCOAPODS: 1.11.3
692+
COCOAPODS: 1.12.1

example/src/stories/Switch.stories.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {ComponentMeta, ComponentStory} from '@storybook/react'
33
import React, {useState} from 'react'
44

55
import {View} from 'react-native'
6-
import {Switch} from 'rn-base-component'
6+
import {Switch, useTheme} from 'rn-base-component'
77

88
export default {
99
title: 'components/Switch',
@@ -12,6 +12,7 @@ export default {
1212

1313
export const Basic: ComponentStory<typeof Switch> = rest => {
1414
const [isActive, setIsActive] = useState(false)
15+
const theme = useTheme()
1516

1617
const onValueChange = () => {
1718
setIsActive(prev => !prev)
@@ -25,14 +26,15 @@ export const Basic: ComponentStory<typeof Switch> = rest => {
2526
value={isActive}
2627
onValueChange={onValueChange}
2728
thumbColor="green"
28-
trackColor={{active: 'blue', inActive: 'gray'}}
29+
trackColor={{active: theme.colors.blue, inActive: theme.colors.red}}
2930
/>
3031
</View>
3132
)
3233
}
3334

3435
export const Inside: ComponentStory<typeof Switch> = rest => {
3536
const [isActive, setIsActive] = useState(false)
37+
const theme = useTheme()
3638

3739
const onValueChange = () => {
3840
setIsActive(prev => !prev)
@@ -45,7 +47,7 @@ export const Inside: ComponentStory<typeof Switch> = rest => {
4547
variant="inside"
4648
value={isActive}
4749
onValueChange={onValueChange}
48-
trackColor={{active: 'green', inActive: 'gray'}}
50+
trackColor={{active: theme.colors.gray, inActive: theme.colors.red}}
4951
/>
5052
</View>
5153
)

0 commit comments

Comments
 (0)