@@ -11,7 +11,7 @@ import {
1111import Svg , { Path } from "react-native-svg" ;
1212
1313import { AnimatedBox , Box } from "../../primitives" ;
14- import { useTheme } from "../../theme" ;
14+ import { useTailwind , useTheme } from "../../theme" ;
1515import { cx } from "../../utils" ;
1616
1717import { AvatarProps , AvatarSizes } from "./Avatar" ;
@@ -27,7 +27,7 @@ interface AnimatedDotProps {
2727}
2828
2929const AnimatedDot : React . FC < AnimatedDotProps > = ( { size, delay } ) => {
30- const tailwind = useTheme ( ) ;
30+ const { ts } = useTailwind ( ) ;
3131 const avatarStatusTheme = useTheme ( "avatar" ) ;
3232 const dotAnimation = useSharedValue ( 0 ) ;
3333 React . useEffect ( ( ) => {
@@ -52,7 +52,7 @@ const AnimatedDot: React.FC<AnimatedDotProps> = ({ size, delay }) => {
5252 return (
5353 < AnimatedBox
5454 style = { [
55- tailwind . style (
55+ ts (
5656 cx (
5757 avatarStatusTheme . status . typing . innerDots . base ,
5858 avatarStatusTheme . status . typing . innerDots . size [ size ] ,
@@ -68,24 +68,24 @@ const TypingComponent: React.FC<TypingStatusProps> = ({
6868 size,
6969 parentsBackground,
7070} ) => {
71- const tailwind = useTheme ( ) ;
71+ const { ts , gc } = useTailwind ( ) ;
7272 const avatarStatusTheme = useTheme ( "avatar" ) ;
7373
7474 const delays = [ "xl" , "2xl" , "3xl" ] . includes ( size ) ? [ 0 , 333 , 667 ] : [ 0 , 500 ] ;
7575
7676 return (
7777 < Box
7878 style = { [
79- tailwind . style ( cx ( avatarStatusTheme . status . typing . container ) ) ,
79+ ts ( cx ( avatarStatusTheme . status . typing . container ) ) ,
8080 avatarStatusTheme . status . position ,
8181 {
82- borderColor : tailwind . getColor ( parentsBackground ) ,
83- backgroundColor : tailwind . getColor ( parentsBackground ) ,
82+ borderColor : gc ( parentsBackground ) ,
83+ backgroundColor : gc ( parentsBackground ) ,
8484 } ,
8585 ] }
8686 >
8787 < Box
88- style = { tailwind . style (
88+ style = { ts (
8989 cx (
9090 avatarStatusTheme . status . typing . base ,
9191 avatarStatusTheme . status . typing . size [ size ] ,
@@ -103,20 +103,21 @@ const TypingComponent: React.FC<TypingStatusProps> = ({
103103export const AvatarStatus : React . FC <
104104 Pick < AvatarProps , "status" | "size" | "parentsBackground" >
105105> = ( { status, size, parentsBackground } ) => {
106- const tailwind = useTheme ( ) ;
106+ const { ts, gc } = useTailwind ( ) ;
107+
107108 const avatarStatusTheme = useTheme ( "avatar" ) ;
108109 switch ( status ) {
109110 case "active" : {
110111 return (
111112 < Box
112113 style = { [
113- tailwind . style ( cx ( avatarStatusTheme . status . active . container ) ) ,
114+ ts ( cx ( avatarStatusTheme . status . active . container ) ) ,
114115 avatarStatusTheme . status . position ,
115- { borderColor : tailwind . getColor ( parentsBackground ) } ,
116+ { borderColor : gc ( parentsBackground ) } ,
116117 ] }
117118 >
118119 < Box
119- style = { tailwind . style (
120+ style = { ts (
120121 cx (
121122 avatarStatusTheme . status . active . base ,
122123 avatarStatusTheme . status . active . size [ size ] ,
@@ -130,23 +131,21 @@ export const AvatarStatus: React.FC<
130131 return (
131132 < Box
132133 style = { [
133- tailwind . style ( cx ( avatarStatusTheme . status . away . container ) ) ,
134+ ts ( cx ( avatarStatusTheme . status . away . container ) ) ,
134135 avatarStatusTheme . status . position ,
135136 {
136- borderColor : tailwind . getColor ( parentsBackground ) ,
137- backgroundColor : tailwind . getColor ( parentsBackground ) ,
137+ borderColor : gc ( parentsBackground ) ,
138+ backgroundColor : gc ( parentsBackground ) ,
138139 } ,
139140 ] }
140141 >
141- < Box
142- style = { tailwind . style ( cx ( avatarStatusTheme . status . away . size [ size ] ) ) }
143- >
142+ < Box style = { ts ( cx ( avatarStatusTheme . status . away . size [ size ] ) ) } >
144143 < Svg width = "100%" height = "100%" viewBox = "0 0 4 4" fill = "none" >
145144 < Path
146145 fillRule = "evenodd"
147146 clipRule = "evenodd"
148147 d = "M2 4C3.10457 4 4 3.10457 4 2C4 0.895431 3.10457 0 2 0C0.895431 0 0 0.895431 0 2C0 3.10457 0.895431 4 2 4ZM2 3.25C2.69036 3.25 3.25 2.69036 3.25 2C3.25 1.30964 2.69036 0.75 2 0.75C1.30964 0.75 0.75 1.30964 0.75 2C0.75 2.69036 1.30964 3.25 2 3.25Z"
149- fill = { tailwind . getColor ( "text-gray-600" ) }
148+ fill = { gc ( "text-gray-600" ) }
150149 />
151150 </ Svg >
152151 </ Box >
@@ -157,23 +156,19 @@ export const AvatarStatus: React.FC<
157156 return (
158157 < Box
159158 style = { [
160- tailwind . style ( cx ( avatarStatusTheme . status . sleep . container ) ) ,
159+ ts ( cx ( avatarStatusTheme . status . sleep . container ) ) ,
161160 avatarStatusTheme . status . position ,
162161 {
163- borderColor : tailwind . getColor ( parentsBackground ) ,
164- backgroundColor : tailwind . getColor ( parentsBackground ) ,
162+ borderColor : gc ( parentsBackground ) ,
163+ backgroundColor : gc ( parentsBackground ) ,
165164 } ,
166165 ] }
167166 >
168- < Box
169- style = { tailwind . style (
170- cx ( avatarStatusTheme . status . sleep . size [ size ] ) ,
171- ) }
172- >
167+ < Box style = { ts ( cx ( avatarStatusTheme . status . sleep . size [ size ] ) ) } >
173168 < Svg width = "100%" height = "100%" viewBox = "0 0 4 4" fill = "none" >
174169 < Path
175170 d = "M3.97107 2.35964C3.98707 2.27194 3.88243 2.2173 3.8072 2.26514C3.57467 2.413 3.29869 2.49864 3.00271 2.49864C2.17354 2.49864 1.50136 1.82646 1.50136 0.997285C1.50136 0.701308 1.587 0.425334 1.73486 0.192796C1.7827 0.117568 1.72806 0.0129337 1.64036 0.0289269C0.707321 0.199076 0 1.01603 0 1.99819C0 3.10376 0.896241 4 2.00181 4C2.98397 4 3.80092 3.29268 3.97107 2.35964Z"
176- fill = { tailwind . getColor ( "text-gray-600" ) }
171+ fill = { gc ( "text-gray-600" ) }
177172 />
178173 </ Svg >
179174 </ Box >
@@ -186,5 +181,4 @@ export const AvatarStatus: React.FC<
186181 ) ;
187182 }
188183 }
189- return null ;
190184} ;
0 commit comments