11import React from 'react' ;
2- import { StyleSheet } from 'react-native' ;
32import { useColorMode } from '@docusaurus/theme-common' ;
43
5- const COLORS = {
6- SWM_OFF_WHITE : '#f8f9ff' ,
7- SWM_PURPLE_LIGHT_100 : '#782aeb' ,
8- SWM_NAVY_LIGHT_60 : '#6676aa' ,
9- SWM_NAVY : '#232736' ,
10- } ;
4+ import styles from './styles.module.css' ;
5+ import clsx from 'clsx' ;
116
127type HeaderWithBadgesProps = {
138 platforms ?: ( 'android' | 'iOS' | 'web' ) [ ] ;
@@ -29,11 +24,11 @@ export function VersionBadge({ version }: VersionBadgeProps) {
2924
3025 return (
3126 < div
32- style = { {
33- ... styles . badge ,
34- ... styles . versionBadge ,
35- ... ( isDark ? styles . versionBadgeDark : styles . versionBadgeLight ) ,
36- } } >
27+ className = { clsx (
28+ styles . badge ,
29+ styles . versionBadge ,
30+ isDark ? styles . versionBadgeDark : styles . versionBadgeLight
31+ ) } >
3732 Available from { version }
3833 </ div >
3934 ) ;
@@ -49,7 +44,7 @@ export function PlatformBadge({ platform }: PlatformBadgeProps) {
4944 ? styles . webBadge
5045 : { } ;
5146
52- return < div style = { { ... styles . badge , ... platformBadge } } > { platform } </ div > ;
47+ return < div className = { clsx ( styles . badge , platformBadge ) } > { platform } </ div > ;
5348}
5449
5550export default function HeaderWithBadges ( {
@@ -58,7 +53,7 @@ export default function HeaderWithBadges({
5853 children,
5954} : HeaderWithBadgesProps ) {
6055 return (
61- < div style = { styles . container } >
56+ < div className = { clsx ( styles . headerWithBadges ) } >
6257 { children }
6358
6459 { platforms
@@ -71,55 +66,3 @@ export default function HeaderWithBadges({
7166 </ div >
7267 ) ;
7368}
74-
75- const styles = StyleSheet . create ( {
76- container : {
77- display : 'flex' ,
78- flexDirection : 'row' ,
79- gap : 10 ,
80- marginBottom : 20 ,
81- } ,
82-
83- badge : {
84- borderRadius : 10 ,
85- paddingTop : 2 ,
86- paddingBottom : 2 ,
87- paddingLeft : 10 ,
88- paddingRight : 10 ,
89- color : 'white' ,
90-
91- display : 'flex' ,
92- alignItems : 'center' ,
93- justifyContent : 'space-around' ,
94- } ,
95-
96- androidBadge : {
97- backgroundColor : '#0f8142' ,
98- } ,
99-
100- iosBadge : {
101- backgroundColor : '#000000' ,
102- } ,
103-
104- webBadge : {
105- backgroundColor : '#1067c4' ,
106- } ,
107-
108- versionBadge : {
109- marginLeft : 'auto' ,
110- borderWidth : 1 ,
111- borderStyle : 'solid' ,
112- } ,
113-
114- versionBadgeLight : {
115- borderColor : COLORS . SWM_PURPLE_LIGHT_100 ,
116- backgroundColor : COLORS . SWM_OFF_WHITE ,
117- color : COLORS . SWM_PURPLE_LIGHT_100 ,
118- } ,
119-
120- versionBadgeDark : {
121- borderColor : COLORS . SWM_NAVY_LIGHT_60 ,
122- backgroundColor : COLORS . SWM_NAVY ,
123- color : COLORS . SWM_OFF_WHITE ,
124- } ,
125- } ) ;
0 commit comments