1
- import React , { PureComponent } from 'react' ;
2
- import { StyleSheet , View , ViewProps , ViewStyle , SafeAreaView , ScrollView , ScrollViewProps , Text , TextStyle , Image , StyleProp } from 'react-native' ;
1
+ import React , { PureComponent } from 'react' ;
2
+ import { StyleSheet , View , ViewProps , ViewStyle , SafeAreaView , ScrollView , ScrollViewProps , Text , TextStyle , Image , StyleProp } from 'react-native' ;
3
3
import PropTypes from 'prop-types' ;
4
- import { Theme } from '@uiw/react-native' ;
5
- import { useTheme } from '@shopify/restyle' ;
4
+ import { Theme } from '@uiw/react-native' ;
5
+ import { useTheme } from '@shopify/restyle' ;
6
6
7
7
export interface HeaderProps {
8
8
title ?: string ;
@@ -15,7 +15,7 @@ export interface HeaderProps {
15
15
}
16
16
17
17
const Header = ( props : HeaderProps ) => {
18
- const { children, title, description, style, hasLogo, titleStyle, descriptionStyle} = props ;
18
+ const { children, title, description, style, hasLogo, titleStyle, descriptionStyle } = props ;
19
19
const theme = useTheme < Theme > ( ) ;
20
20
const styles = createStyles ( {
21
21
backgroundColor : theme . colors . background ,
@@ -27,7 +27,7 @@ const Header = (props: HeaderProps) => {
27
27
{ title && < Text style = { [ styles . title , titleStyle ] } > { title } </ Text > }
28
28
{ hasLogo && (
29
29
< View style = { styles . logo } >
30
- < Image source = { require ( '../image/logo.png' ) } style = { { width : 103 , height : 18 } } />
30
+ < Image source = { require ( '../image/logo.png' ) } style = { { width : 103 , height : 18 } } />
31
31
</ View >
32
32
) }
33
33
{ description && < Text style = { [ styles . description , descriptionStyle ] } > { description } </ Text > }
@@ -43,7 +43,7 @@ export interface BodyProps extends ScrollViewProps {
43
43
}
44
44
45
45
const Body = ( props : BodyProps ) => {
46
- const { children, style, isScroll, ...other } = props ;
46
+ const { children, style, isScroll, ...other } = props ;
47
47
const theme = useTheme < Theme > ( ) ;
48
48
const styles = createStyles ( {
49
49
backgroundColor : theme . colors . background ,
@@ -65,7 +65,7 @@ export interface FooterProps {
65
65
}
66
66
67
67
const Footer = ( props : FooterProps ) => {
68
- const { children, copyright, style, isShowCopyRight, ...other } = props ;
68
+ const { children, copyright, style, isShowCopyRight, ...other } = props ;
69
69
const theme = useTheme < Theme > ( ) ;
70
70
const styles = createStyles ( {
71
71
backgroundColor : theme . colors . background ,
@@ -91,7 +91,7 @@ export interface CardProps extends ViewProps {
91
91
}
92
92
93
93
const Card = ( props : CardProps ) => {
94
- const { title, titleStyle, bodyStyle, children, style, showTitle, extra, ...other } = props ;
94
+ const { title, titleStyle, bodyStyle, children, style, showTitle, extra, ...other } = props ;
95
95
const theme = useTheme < Theme > ( ) ;
96
96
const styles = createStyles ( {
97
97
backgroundColor : theme . colors . background ,
@@ -103,7 +103,7 @@ const Card = (props: CardProps) => {
103
103
{ extra ? (
104
104
< View style = { [ styles . extra , styles . cardTitle ] } >
105
105
{ showTitle && (
106
- < View style = { { flex : 2 } } >
106
+ < View style = { { flex : 2 } } >
107
107
< Text style = { [ titleStyle ] } > { title } </ Text >
108
108
</ View >
109
109
) }
@@ -123,37 +123,37 @@ export interface ContainerProps extends ScrollViewProps {
123
123
}
124
124
125
125
export const Container = ( props : ContainerProps ) => {
126
- const { children, ...others } = props ;
126
+ const { children, ...others } = props ;
127
127
const theme = useTheme < Theme > ( ) ;
128
128
const styles = createStyles ( {
129
129
backgroundColor : theme . colors . background ,
130
130
shadowColor : theme . colors . border ,
131
131
color : theme . colors . primary_text ,
132
132
} ) ;
133
133
return (
134
- < SafeAreaView style = { { backgroundColor : '#ededed' } } { ...others } >
135
- < ScrollView style = { { height : '100%' } } { ...others } >
134
+ < SafeAreaView style = { styles . body } { ...others } >
135
+ < ScrollView style = { { height : '100%' } } { ...others } >
136
136
{ children }
137
137
</ ScrollView >
138
138
</ SafeAreaView >
139
139
) ;
140
140
} ;
141
141
142
- export interface LayoutProps extends ViewProps { }
142
+ export interface LayoutProps extends ViewProps { }
143
143
144
144
export default class Layout extends PureComponent < LayoutProps > {
145
145
static Header = Header ;
146
146
static Body = Body ;
147
147
static Footer = Footer ;
148
148
static Card = Card ;
149
149
render ( ) {
150
- const { children, style} = this . props ;
150
+ const { children, style } = this . props ;
151
151
const styles = createStyles ( { } ) ;
152
152
return < View style = { [ styles . container , style ] } > { children } </ View > ;
153
153
}
154
154
}
155
155
156
- function createStyles ( { backgroundColor = '#F7F7F7' , shadowColor = '#E6E6E6' , color = '#9A9A9A' } ) {
156
+ function createStyles ( { backgroundColor = '#F7F7F7' , shadowColor = '#E6E6E6' , color = '#9A9A9A' } ) {
157
157
return StyleSheet . create ( {
158
158
container : {
159
159
backgroundColor : backgroundColor ,
@@ -167,7 +167,7 @@ function createStyles({backgroundColor = '#F7F7F7', shadowColor = '#E6E6E6', col
167
167
paddingRight : 16 ,
168
168
shadowColor : shadowColor ,
169
169
backgroundColor : backgroundColor ,
170
- shadowOffset : { width : 0 , height : 3 } ,
170
+ shadowOffset : { width : 0 , height : 3 } ,
171
171
shadowRadius : 3 ,
172
172
// shadowOpacity: 0.8,
173
173
shadowOpacity : 0 ,
0 commit comments