-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prakhar Agarwal <[email protected]>
- Loading branch information
1 parent
2751deb
commit 0bdf3e2
Showing
5 changed files
with
117 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,115 @@ | ||
import { ScrollView } from "react-native-gesture-handler" | ||
|
||
import { Screen } from "@app/components/screen" | ||
import { makeStyles } from "@rneui/themed" | ||
import { GaloyPrimaryButton } from "@app/components/atomic/galoy-primary-button" | ||
import { useI18nContext } from "@app/i18n/i18n-react" | ||
import { TouchableOpacity, View } from "react-native" | ||
import { GaloyIcon } from "@app/components/atomic/galoy-icon" | ||
import { makeStyles, Text } from "@rneui/themed" | ||
|
||
export const ProfileScreen: React.FC = () => { | ||
const styles = useStyles() | ||
const { LL } = useI18nContext() | ||
|
||
const data = [ | ||
{ | ||
username: "User 1", | ||
selected: true, | ||
}, | ||
{ | ||
username: "User 2", | ||
selected: false, | ||
}, | ||
{ | ||
username: "User 3", | ||
selected: false, | ||
}, | ||
] | ||
|
||
return ( | ||
<Screen keyboardShouldPersistTaps="handled"> | ||
<ScrollView contentContainerStyle={styles.outer}></ScrollView> | ||
<ScrollView contentContainerStyle={styles.outer}> | ||
{data.map((profile, index) => { | ||
return <Profile key={index} {...profile} /> | ||
})} | ||
<GaloyPrimaryButton onPress={() => {}} containerStyle={styles.addNewButton}> | ||
<GaloyIcon name="user" size={30} style={styles.icon} /> | ||
<Text>{LL.ProfileScreen.addNew()}</Text> | ||
</GaloyPrimaryButton> | ||
</ScrollView> | ||
</Screen> | ||
) | ||
} | ||
|
||
const useStyles = makeStyles(() => ({ | ||
const Profile: React.FC<{ username: string; selected?: boolean }> = ({ | ||
username, | ||
selected, | ||
}) => { | ||
const styles = useStyles() | ||
return ( | ||
<TouchableOpacity> | ||
<View style={styles.profile}> | ||
<View style={styles.iconContainer}> | ||
{selected && ( | ||
<GaloyIcon name="check-circle" size={30} style={styles.checkIcon} /> | ||
)} | ||
</View> | ||
<Text>{username}</Text> | ||
{!selected && ( | ||
<TouchableOpacity style={styles.logoutButton} onPress={() => {}}> | ||
<Text style={styles.logoutButtonText}>Logout</Text> | ||
</TouchableOpacity> | ||
)} | ||
</View> | ||
<View style={styles.divider}></View> | ||
</TouchableOpacity> | ||
) | ||
} | ||
|
||
const useStyles = makeStyles(({ colors }) => ({ | ||
outer: { | ||
marginTop: 4, | ||
paddingHorizontal: 12, | ||
paddingBottom: 20, | ||
display: "flex", | ||
flexDirection: "column", | ||
rowGap: 12, | ||
}, | ||
iconContainer: { | ||
height: 30, | ||
width: 30, | ||
marginRight: 10, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
}, | ||
icon: { | ||
marginRight: 10, | ||
}, | ||
addNewButton: { | ||
marginVertical: 20, | ||
marginHorizontal: "auto", | ||
width: 150, | ||
}, | ||
divider: { | ||
borderWidth: 1, | ||
borderColor: colors.grey4, | ||
}, | ||
profile: { | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
marginBottom: 10, | ||
marginHorizontal: 10, | ||
}, | ||
checkIcon: { | ||
color: colors._green, | ||
margin: 10, | ||
}, | ||
logoutButton: { | ||
marginLeft: "auto", | ||
marginRight: 10, | ||
}, | ||
logoutButtonText: { | ||
color: colors.primary, | ||
fontSize: 20, | ||
fontWeight: "bold", | ||
}, | ||
})) |