11import * as React from 'react'
2- import { View , StyleSheet , StatusBar , SafeAreaView } from 'react-native'
3- import { Appbar , Button , IconButton , Text , useTheme } from 'react-native-paper'
2+ import {
3+ View ,
4+ StyleSheet ,
5+ StatusBar ,
6+ Animated ,
7+ SafeAreaView ,
8+ } from 'react-native'
9+ import {
10+ Appbar ,
11+ Button ,
12+ IconButton ,
13+ overlay ,
14+ Text ,
15+ useTheme ,
16+ } from 'react-native-paper'
417import { ModeType } from './Calendar'
518import { LocalState } from './DatePickerModal'
619import { useMemo } from 'react'
@@ -40,7 +53,7 @@ export default function DatePickerModalHeader(props: HeaderProps) {
4053
4154 const backgroundColor =
4255 theme . dark && theme . mode === 'adaptive'
43- ? theme . colors . surface
56+ ? overlay ( 4 , theme . colors . surface )
4457 : theme . colors . primary
4558
4659 return (
@@ -54,43 +67,50 @@ export default function DatePickerModalHeader(props: HeaderProps) {
5467 } ,
5568 ] }
5669 />
57- < SafeAreaView
70+
71+ < Animated . View
5872 style = { {
5973 backgroundColor,
6074 paddingBottom : 0 ,
75+ elevation : 4 ,
6176 } }
6277 >
63- < Appbar style = { [ styles . appbarHeader , { backgroundColor } ] } >
64- < Appbar . Action icon = "close" onPress = { props . onDismiss } />
65- < Appbar . Content title = { '' } />
66- < Button color = { '#fff' } onPress = { props . onSave } >
67- { saveLabel }
68- </ Button >
69- </ Appbar >
70- </ SafeAreaView >
71- < View
72- style = { [
73- styles . header ,
74- {
75- backgroundColor,
76- } ,
77- ] }
78- >
79- < View >
80- < Text style = { styles . label } > { label . toUpperCase ( ) } </ Text >
78+ < SafeAreaView
79+ style = { {
80+ paddingBottom : 0 ,
81+ } }
82+ >
83+ < Appbar
84+ style = { [
85+ styles . appbarHeader ,
86+ { backgroundColor : backgroundColor . toString ( ) } ,
87+ ] }
88+ >
89+ < Appbar . Action icon = "close" onPress = { props . onDismiss } />
90+ < Appbar . Content title = { '' } />
91+ < Button color = { '#fff' } onPress = { props . onSave } >
92+ { saveLabel }
93+ </ Button >
94+ </ Appbar >
95+
96+ < View style = { [ styles . header ] } >
97+ < View >
98+ < Text style = { styles . label } > { label . toUpperCase ( ) } </ Text >
8199
82- < View style = { styles . headerContentContainer } >
83- { mode === 'range' ? < HeaderContentRange { ...props } /> : null }
84- { mode === 'single' ? < HeaderContentSingle { ...props } /> : null }
100+ < View style = { styles . headerContentContainer } >
101+ { mode === 'range' ? < HeaderContentRange { ...props } /> : null }
102+ { mode === 'single' ? < HeaderContentSingle { ...props } /> : null }
103+ </ View >
104+ </ View >
105+ < View style = { styles . fill } />
106+ < IconButton
107+ icon = { collapsed ? 'pencil' : 'calendar' }
108+ color = { '#fff' }
109+ onPress = { onToggle }
110+ />
85111 </ View >
86- </ View >
87- < View style = { styles . fill } />
88- < IconButton
89- icon = { collapsed ? 'pencil' : 'calendar' }
90- color = { '#fff' }
91- onPress = { onToggle }
92- />
93- </ View >
112+ </ SafeAreaView >
113+ </ Animated . View >
94114 </ >
95115 )
96116}
0 commit comments