@@ -24,7 +24,7 @@ import {
2424import { useMessageComposer } from '../../contexts/messageInputContext/hooks/useMessageComposer' ;
2525import { useStateStore } from '../../hooks/useStateStore' ;
2626import { primitives } from '../../theme' ;
27- import { getRtlMirrorSwitchStyle } from '../../utils/rtlMirrorSwitchStyle' ;
27+ import { useRtlMirrorSwitchStyle } from '../../utils/rtlMirrorSwitchStyle' ;
2828
2929const pollComposerStateSelector = ( state : PollComposerState ) => ( {
3030 options : state . data . options ,
@@ -172,11 +172,7 @@ export const CreatePollContent = () => {
172172 < Switch
173173 onValueChange = { onAnonymousPollChangeHandler }
174174 value = { isAnonymousPoll }
175- style = { [
176- styles . optionCardSwitch ,
177- getRtlMirrorSwitchStyle ( ) ,
178- anonymousPoll . optionCardSwitch ,
179- ] }
175+ style = { [ styles . optionCardSwitch , anonymousPoll . optionCardSwitch ] }
180176 />
181177 </ View >
182178 < View style = { [ styles . optionCard , suggestOption . wrapper ] } >
@@ -190,11 +186,7 @@ export const CreatePollContent = () => {
190186 < Switch
191187 onValueChange = { onAllowUserSuggestedOptionsChangeHandler }
192188 value = { allowUserSuggestedOptions }
193- style = { [
194- styles . optionCardSwitch ,
195- getRtlMirrorSwitchStyle ( ) ,
196- suggestOption . optionCardSwitch ,
197- ] }
189+ style = { [ styles . optionCardSwitch , suggestOption . optionCardSwitch ] }
198190 />
199191 </ View >
200192 < View style = { [ styles . optionCard , addComment . wrapper ] } >
@@ -208,11 +200,7 @@ export const CreatePollContent = () => {
208200 < Switch
209201 onValueChange = { onAllowAnswersChangeHandler }
210202 value = { allowAnswers }
211- style = { [
212- styles . optionCardSwitch ,
213- getRtlMirrorSwitchStyle ( ) ,
214- addComment . optionCardSwitch ,
215- ] }
203+ style = { [ styles . optionCardSwitch , addComment . optionCardSwitch ] }
216204 />
217205 </ View >
218206 </ Animated . View >
@@ -290,6 +278,7 @@ const useStyles = () => {
290278 const {
291279 theme : { semantics } ,
292280 } = useTheme ( ) ;
281+ const rtlMirrorSwitchStyle = useRtlMirrorSwitchStyle ( ) ;
293282 return useMemo ( ( ) => {
294283 return StyleSheet . create ( {
295284 scrollView : {
@@ -333,7 +322,7 @@ const useStyles = () => {
333322 optionCardWrapper : {
334323 gap : primitives . spacingMd ,
335324 } ,
336- optionCardSwitch : { width : 64 } ,
325+ optionCardSwitch : { width : 64 , ... rtlMirrorSwitchStyle } ,
337326 } ) ;
338- } , [ semantics ] ) ;
327+ } , [ rtlMirrorSwitchStyle , semantics ] ) ;
339328} ;
0 commit comments