Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
ThaliApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
thalia
ThaliApp
Commits
6f28b8bc
Commit
6f28b8bc
authored
Jul 11, 2019
by
Sébastiaan Versteeg
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add-iconbutton-style' into 'master'
Add more dynamic styling prop to IconButton See merge request
!343
parents
fac5ec0c
e631913b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
37 deletions
+28
-37
__tests__/ui/components/standardHeader/__snapshots__/StandardHeader.spec.js.snap
.../standardHeader/__snapshots__/StandardHeader.spec.js.snap
+2
-2
app/ui/components/button/IconButton.js
app/ui/components/button/IconButton.js
+7
-4
app/ui/components/searchHeader/SearchHeader.js
app/ui/components/searchHeader/SearchHeader.js
+3
-3
app/ui/components/standardHeader/StandardHeader.js
app/ui/components/standardHeader/StandardHeader.js
+7
-13
app/ui/screens/events/EventAdminScreen.js
app/ui/screens/events/EventAdminScreen.js
+1
-1
app/ui/screens/photos/AlbumGalleryScreen.js
app/ui/screens/photos/AlbumGalleryScreen.js
+7
-13
app/ui/screens/profile/ProfileScreen.js
app/ui/screens/profile/ProfileScreen.js
+1
-1
No files found.
__tests__/ui/components/standardHeader/__snapshots__/StandardHeader.spec.js.snap
View file @
6f28b8bc
...
...
@@ -54,7 +54,7 @@ exports[`StandardHeader component renders correctly on Android 1`] = `
style={
Array [
Object {
"color":
undefined
,
"color":
"#FFFFFF"
,
"fontSize": 24,
},
Object {
...
...
@@ -158,7 +158,7 @@ exports[`StandardHeader component renders correctly on iOS 1`] = `
style={
Array [
Object {
"color":
undefined
,
"color":
"#FFFFFF"
,
"fontSize": 24,
},
Object {
...
...
app/ui/components/button/IconButton.js
View file @
6f28b8bc
import
React
from
'
react
'
;
import
{
TouchableOpacity
}
from
'
react-native
'
;
import
{
TouchableOpacity
,
ViewPropTypes
}
from
'
react-native
'
;
import
Icon
from
'
react-native-vector-icons/MaterialIcons
'
;
import
PropTypes
from
'
prop-types
'
;
import
Colors
from
'
../../style/Colors
'
;
...
...
@@ -8,10 +8,11 @@ const IconButton = props => (
<
TouchableOpacity
disabled
=
{
props
.
disabled
}
onPress
=
{
props
.
disabled
?
null
:
props
.
onPress
}
style
=
{
props
.
style
}
>
<
Icon
name
=
{
props
.
name
}
style
=
{
props
.
s
tyle
}
style
=
{
props
.
iconS
tyle
}
color
=
{
props
.
color
}
size
=
{
props
.
size
}
/
>
...
...
@@ -24,14 +25,16 @@ IconButton.propTypes = {
color
:
PropTypes
.
string
,
disabled
:
PropTypes
.
bool
,
size
:
PropTypes
.
number
,
style
:
Icon
.
propTypes
.
style
,
iconStyle
:
Icon
.
propTypes
.
style
,
style
:
ViewPropTypes
.
style
,
};
IconButton
.
defaultProps
=
{
color
:
Colors
.
white
,
disabled
:
false
,
size
:
24
,
style
:
Icon
.
defaultProps
.
style
,
iconStyle
:
Icon
.
defaultProps
.
style
,
style
:
{},
};
export
default
IconButton
;
app/ui/components/searchHeader/SearchHeader.js
View file @
6f28b8bc
...
...
@@ -37,7 +37,7 @@ class SearchHeader extends Component {
<
IconButton
onPress
=
{()
=>
(
isSearching
?
this
.
updateSearch
(
false
)
:
leftIconAction
())}
name
=
{
isSearching
?
'
arrow-back
'
:
leftIcon
}
s
tyle
=
{[
styles
.
leftIcon
,
isSearching
?
styles
.
magenta
:
styles
.
white
]}
iconS
tyle
=
{[
styles
.
leftIcon
,
isSearching
?
styles
.
magenta
:
styles
.
white
]}
/
>
);
};
...
...
@@ -70,7 +70,7 @@ class SearchHeader extends Component {
<
IconButton
onPress
=
{()
=>
this
.
updateSearch
(
true
)}
name
=
"
search
"
s
tyle
=
{[
styles
.
rightIcon
,
styles
.
white
]}
iconS
tyle
=
{[
styles
.
rightIcon
,
styles
.
white
]}
/
>
);
}
if
(
searchKey
)
{
...
...
@@ -78,7 +78,7 @@ class SearchHeader extends Component {
<
IconButton
onPress
=
{()
=>
this
.
updateSearchKey
(
''
)}
name
=
"
close
"
s
tyle
=
{[
styles
.
rightIcon
,
styles
.
gray
]}
iconS
tyle
=
{[
styles
.
rightIcon
,
styles
.
gray
]}
/
>
);
}
...
...
app/ui/components/standardHeader/StandardHeader.js
View file @
6f28b8bc
import
React
from
'
react
'
;
import
{
Text
,
TouchableOpacity
,
View
,
SafeAreaView
,
}
from
'
react-native
'
;
import
{
SafeAreaView
,
Text
,
View
}
from
'
react-native
'
;
import
StatusBar
from
'
@react-native-community/status-bar
'
;
import
{
withTranslation
}
from
'
react-i18next
'
;
import
PropTypes
from
'
prop-types
'
;
import
Icon
from
'
react-native-vector-icons/MaterialIcons
'
;
import
{
withNavigation
}
from
'
react-navigation
'
;
import
Colors
from
'
../../style/Colors
'
;
import
styles
from
'
./style/StandardHeader
'
;
import
IconButton
from
'
../button/IconButton
'
;
const
sceneToTitle
=
(
routeName
,
t
)
=>
{
switch
(
routeName
)
{
...
...
@@ -50,16 +48,12 @@ const StandardHeader = props => (
<
/View
>
<
SafeAreaView
style
=
{
styles
.
safeArea
}
>
<
View
style
=
{
styles
.
appBar
}
>
<
TouchableOpacity
style
=
{
styles
.
iconButton
}
<
IconButton
onPress
=
{()
=>
(
props
.
menu
?
props
.
navigation
.
toggleDrawer
()
:
props
.
navigation
.
goBack
())}
>
<
Icon
name
=
{
props
.
menu
?
'
menu
'
:
'
arrow-back
'
}
style
=
{
styles
.
ic
on
}
size
=
{
24
}
style
=
{
styles
.
iconButt
on
}
iconStyle
=
{
styles
.
icon
}
/
>
<
/TouchableOpacity
>
<
Text
style
=
{
styles
.
title
}
>
{
sceneToTitle
(
props
.
navigation
.
state
.
routeName
,
props
.
t
)}
<
/Text
>
...
...
app/ui/screens/events/EventAdminScreen.js
View file @
6f28b8bc
import
React
,
{
Component
}
from
'
react
'
;
import
{
View
,
Text
,
Switch
,
RefreshControl
,
ScrollView
,
FlatList
,
TouchableHighlight
,
FlatList
,
RefreshControl
,
ScrollView
,
Switch
,
Text
,
TouchableHighlight
,
View
,
}
from
'
react-native
'
;
import
{
withTranslation
}
from
'
react-i18next
'
;
import
PropTypes
from
'
prop-types
'
;
...
...
app/ui/screens/photos/AlbumGalleryScreen.js
View file @
6f28b8bc
import
{
TouchableOpacity
,
View
}
from
'
react-native
'
;
import
{
View
}
from
'
react-native
'
;
import
ImageViewer
from
'
react-native-image-zoom-viewer
'
;
import
Icon
from
'
react-native-vector-icons/MaterialIcons
'
;
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
Colors
from
'
../../style/Colors
'
;
import
styles
from
'
./style/AlbumDetailScreen
'
;
import
IconButton
from
'
../../components/button/IconButton
'
;
const
AlbumGalleryScreen
=
({
photos
,
goBack
,
selection
})
=>
(
<
View
style
=
{
styles
.
screenWrapper
}
>
...
...
@@ -13,17 +12,12 @@ const AlbumGalleryScreen = ({ photos, goBack, selection }) => (
index
=
{
selection
}
imageUrls
=
{
photos
}
/
>
<
TouchableOpacity
style
=
{
styles
.
closeGalleryTouchable
}
<
IconButton
onPress
=
{
goBack
}
>
<
Icon
name
=
"
close
"
style
=
{
styles
.
icon
}
size
=
{
24
}
color
=
{
Colors
.
white
}
style
=
{
styles
.
closeGalleryTouchable
}
iconStyle
=
{
styles
.
icon
}
/
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
);
...
...
app/ui/screens/profile/ProfileScreen.js
View file @
6f28b8bc
...
...
@@ -150,7 +150,7 @@ class ProfileScreen extends Component {
<
IconButton
onPress
=
{
this
.
props
.
goBack
}
name
=
"
arrow-back
"
s
tyle
=
{
styles
.
icon
}
iconS
tyle
=
{
styles
.
icon
}
/
>
<
/Animated.View
>
<
/Animated.View
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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