Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
2d7f4f66
Verified
Commit
2d7f4f66
authored
Aug 09, 2018
by
Sébastiaan Versteeg
Browse files
Create CardSection component
parent
a468f25d
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/ui/components/cardSection/CardSection.js
0 → 100644
View file @
2d7f4f66
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
StyleSheet
,
Text
,
View
,
ViewPropTypes
}
from
'
react-native
'
;
import
styles
from
'
./style/CardSection
'
;
const
CardSection
=
props
=>
(
<
View
style
=
{[
styles
.
section
,
props
.
style
]}
>
<
Text
style
=
{
styles
.
sectionHeader
}
>
{
props
.
sectionHeader
}
<
/Text
>
<
View
style
=
{[
styles
.
card
,
props
.
contentStyle
]}
>
{
props
.
children
}
<
/View
>
<
/View
>
);
CardSection
.
propTypes
=
{
children
:
PropTypes
.
node
.
isRequired
,
sectionHeader
:
PropTypes
.
string
,
style
:
ViewPropTypes
.
style
,
contentStyle
:
ViewPropTypes
.
style
,
};
const
defaultStyles
=
StyleSheet
.
create
({
});
CardSection
.
defaultProps
=
{
sectionHeader
:
null
,
style
:
defaultStyles
,
contentStyle
:
defaultStyles
,
};
export
default
CardSection
;
\ No newline at end of file
app/ui/components/cardSection/style/CardSection.js
0 → 100644
View file @
2d7f4f66
import
StyleSheet
from
'
../../../style/StyleSheet
'
;
import
Colors
from
'
../../../style/Colors
'
;
const
styles
=
StyleSheet
.
create
({
section
:
{
marginTop
:
8
,
marginBottom
:
8
,
},
sectionHeader
:
{
android
:
{
fontFamily
:
'
sans-serif-medium
'
,
},
ios
:
{
fontFamily
:
'
System
'
,
fontWeight
:
'
600
'
,
},
color
:
Colors
.
textColour
,
fontSize
:
14
,
paddingLeft
:
10
,
paddingTop
:
6
,
paddingBottom
:
6
,
},
card
:
{
backgroundColor
:
Colors
.
white
,
elevation
:
2
,
android
:
{
borderRadius
:
2
,
},
ios
:
{
borderRadius
:
4
,
borderColor
:
Colors
.
lightGray
,
borderStyle
:
'
solid
'
,
borderWidth
:
0.5
,
},
},
});
export
default
styles
;
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment