@@ -7,11 +7,6 @@ const INITIAL_DATE = '2020-02-02';
77
88const CalendarsScreen = ( ) => {
99 const [ selected , setSelected ] = useState ( INITIAL_DATE ) ;
10- const [ showMarkedDatesExamples , setShowMarkedDatesExamples ] = useState ( false ) ;
11-
12- const toggleSwitch = ( ) => {
13- setShowMarkedDatesExamples ( ! showMarkedDatesExamples ) ;
14- } ;
1510
1611 const onDayPress : CalendarProps [ 'onDayPress' ] = day => {
1712 setSelected ( day . dateString ) ;
@@ -259,7 +254,8 @@ const CalendarsScreen = () => {
259254 elevation : 2
260255 } ,
261256 text : {
262- color : 'red'
257+ color : 'red' ,
258+ marginTop : 0
263259 }
264260 }
265261 } ,
@@ -454,19 +450,6 @@ const CalendarsScreen = () => {
454450 ) ;
455451 } ;
456452
457- const renderMarkedDatesExamples = ( ) => {
458- return (
459- < Fragment >
460- { renderCalendarWithMarkedDatesAndHiddenArrows ( ) }
461- { renderCalendarWithMultiDotMarking ( ) }
462- { renderCalendarWithPeriodMarkingAndSpinner ( ) }
463- { renderCalendarWithPeriodMarkingAndDotMarking ( ) }
464- { renderCalendarWithMultiPeriodMarking ( ) }
465- { renderCalendarWithCustomMarkingType ( ) }
466- </ Fragment >
467- ) ;
468- } ;
469-
470453 const renderExamples = ( ) => {
471454 return (
472455 < Fragment >
@@ -477,29 +460,19 @@ const CalendarsScreen = () => {
477460 { renderCalendarWithInactiveDays ( ) }
478461 { renderCalendarWithCustomHeaderTitle ( ) }
479462 { renderCalendarWithCustomHeader ( ) }
463+ { renderCalendarWithMarkedDatesAndHiddenArrows ( ) }
464+ { renderCalendarWithMultiDotMarking ( ) }
465+ { renderCalendarWithPeriodMarkingAndSpinner ( ) }
466+ { renderCalendarWithPeriodMarkingAndDotMarking ( ) }
467+ { renderCalendarWithMultiPeriodMarking ( ) }
468+ { renderCalendarWithCustomMarkingType ( ) }
480469 </ Fragment >
481470 ) ;
482471 } ;
483472
484- const renderSwitch = ( ) => {
485- // Workaround for Detox 18 migration bug
486- return (
487- < View style = { styles . switchContainer } >
488- < Switch
489- trackColor = { { false : '#d9e1e8' , true : '#00BBF2' } }
490- onValueChange = { toggleSwitch }
491- value = { showMarkedDatesExamples }
492- />
493- < Text style = { styles . switchText } > Show markings examples</ Text >
494- </ View >
495- ) ;
496- } ;
497-
498473 return (
499474 < ScrollView showsVerticalScrollIndicator = { false } testID = { testIDs . calendars . CONTAINER } >
500- { renderSwitch ( ) }
501- { showMarkedDatesExamples && renderMarkedDatesExamples ( ) }
502- { ! showMarkedDatesExamples && renderExamples ( ) }
475+ { renderExamples ( ) }
503476 </ ScrollView >
504477 ) ;
505478} ;
0 commit comments