Skip to content

Commit

Permalink
Close button should be visible on Login regardless of login state
Browse files Browse the repository at this point in the history
  • Loading branch information
kueda committed Aug 19, 2022
1 parent 9a74595 commit e0e5064
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 14 additions & 12 deletions src/components/LoginSignUp/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Linking,
Platform,
Pressable,
SafeAreaView,
ScrollView,
TouchableOpacity,
View
Expand Down Expand Up @@ -127,12 +128,6 @@ const Login = ( ): Node => {

const loginForm = (
<>
<Pressable
onPress={() => navigation.goBack()}
style={closeButton.close}
>
<Icon name="close" size={35} />
</Pressable>
<Image
style={imageStyles.logo}
resizeMode="contain"
Expand Down Expand Up @@ -187,12 +182,19 @@ const Login = ( ): Node => {
behavior={Platform.OS === "ios" ? "padding" : "height"}
style={viewStyles.container}
>
<ScrollView
style={[viewStyles.container]}
contentContainerStyle={viewStyles.paddedContainer}
>
{loggedIn ? logoutForm : loginForm}
</ScrollView>
<SafeAreaView style={[viewStyles.container]}>
<ScrollView
contentContainerStyle={viewStyles.paddedContainer}
>
<Pressable
onPress={() => navigation.goBack()}
style={closeButton.close}
>
<Icon name="close" size={35} />
</Pressable>
{loggedIn ? logoutForm : loginForm}
</ScrollView>
</SafeAreaView>
</KeyboardAvoidingView>
);
};
Expand Down
4 changes: 3 additions & 1 deletion src/styles/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ const imageStyles: { [string]: ImageStyleProp } = StyleSheet.create( {

const closeButton: { [string]: ViewStyleProp } = StyleSheet.create( {
close: {
alignSelf: "flex-end"
position: "absolute",
top: 20,
end: 20
}
} );

Expand Down

0 comments on commit e0e5064

Please sign in to comment.