Skip to content

Commit

Permalink
inicio issue #128
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdanillo committed Jul 7, 2021
1 parent 4695f4e commit d1a3d66
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 60 deletions.
17 changes: 17 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.

> What does the "packager-info.json" file contain?
The "packager-info.json" file contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.

> What does the "settings.json" file contain?
The "settings.json" file contains the server configuration that is used to serve the application manifest.

> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.

Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
8 changes: 8 additions & 0 deletions .expo/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"hostType": "lan",
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": null,
"https": false
}
Binary file added frontend/src/assets/profilePictures/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/assets/profilePictures/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/assets/profilePictures/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/assets/profilePictures/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/assets/profilePictures/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/src/assets/profilePictures/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion frontend/src/components/Avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,34 @@ const styles = StyleSheet.create({
}
});

function getProfilePicture(profilePicture: any) {
if (profilePicture == 1) {
return require('../../assets/profilePictures/1.png');
}
else if (profilePicture == 2) {
return require('../../assets/profilePictures/2.png');
}
else if (profilePicture == 3) {
return require('../../assets/profilePictures/3.png');
}
else if (profilePicture == 4) {
return require('../../assets/profilePictures/4.png');
}
else if (profilePicture == 5) {
return require('../../assets/profilePictures/5.png');
}
else if (profilePicture == 6) {
return require('../../assets/profilePictures/6.png');
}
}

const Avatar = (props: any) => {
return (
<View style={styles.componentContainer}>
<View style={styles.profilePictureAndLabelContainer}>
<Image
style={styles.profilePicture}
source={props.profilePicture}
source={getProfilePicture(props.profilePicture)}
/>
{props.isProfessional ? <View style={styles.label}>
<Text style={styles.labelText}>PROFISSIONAL</Text>
Expand Down
111 changes: 52 additions & 59 deletions frontend/src/views/profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export default function Profile({ navigation }: any) {
const [loading, setLoading] = useState(true);

//Dados da tela e valores padrão]
const [user, setUser] = useState({ email: 'julia_silva@mail.com', isProfessional: true, professional: { name: 'Lulu' }, client: { name: 'Lulu' } })
const [user, setUser] = useState({ profilePictureNumber: 3, email: 'julia_silva@mail.com', isProfessional: false, professional: { name: 'Lulu' }, client: { name: 'Lulu' } })

const toggleSwitch = () => setIsEnabled(previousState => !previousState);

const profilePicture = require('../../assets/profile.png');


function navigateToGenerateCode() {
navigation.navigate('GenerateAssociationCode')
Expand Down Expand Up @@ -55,7 +55,6 @@ export default function Profile({ navigation }: any) {

useEffect(() => {
getUserInformation();
setUser({...user, isProfessional: false})
}, [])

return (
Expand All @@ -66,71 +65,65 @@ export default function Profile({ navigation }: any) {
</TouchableOpacity>
</View>
{
loading ?
<ActivityIndicator size={80} color="#fad2d2" /> :
<>
<View style={styles.container}>
<View style={styles.avatarContainer}>
<Avatar profilePicture={profilePicture} name={user.isProfessional ? user.professional.name : user.client.name} email={user.email} isProfessional={user.isProfessional} />
</View>
<View style={styles.settingsContainer}>
<View style={styles.accountSettingsContainer}>
<Text style={styles.accountSettingsText}>Configurações da conta</Text>
{!user.isProfessional ?
<View>
<TouchableOpacity style={styles.optionContainer} onPress={() => navigation.navigate('EditProfile', { user: user })} >
<Text style={styles.optionText}>Editar perfil</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer} onPress={navigateToAssociateCode}>
<Text style={styles.optionText}>Gerenciar profissional</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<View style={styles.optionContainer}>
<Text style={styles.optionText}>Notificações</Text>
<Switch
trackColor={{ false: "#91919F", true: "#E1948B" }}
thumbColor={'#F1F1FA'}
ios_backgroundColor="#91919F"
onValueChange={toggleSwitch}
value={isEnabled}
/>
</View>
</View> :
<View>
<TouchableOpacity style={styles.optionContainer} onPress={() => navigation.navigate('EditProfile', { user: user })}>
<Text style={styles.optionText}>Editar perfil</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer} onPress={navigateToGenerateCode}>
<Text style={styles.optionText}>Código de vinculação</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
</View>
}
</View>
<View style={styles.accountSettingsContainer}>
<Text style={styles.accountSettingsText}>Suporte</Text>
<TouchableOpacity style={styles.optionContainer} onPress={() => navigation.navigate('About')}>
<Text style={styles.optionText}>Sobre o e-motion</Text>
loading ? <ActivityIndicator size={80} color="#fad2d2" /> : <View style={styles.container}>
<View style={styles.avatarContainer}>
<Avatar profilePicture={user.profilePictureNumber} name={user.isProfessional ? user.professional.name : user.client.name} email={user.email} isProfessional={user.isProfessional} />
</View>
<View style={styles.settingsContainer}>
<View style={styles.accountSettingsContainer}>
<Text style={styles.accountSettingsText}>Configurações da conta</Text>
{!user.isProfessional ?
<View>
<TouchableOpacity style={styles.optionContainer} onPress={() => navigation.navigate('EditProfile', { user: user })} >
<Text style={styles.optionText}>Editar perfil</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer} onPress={navigateToAssociateCode}>
<Text style={styles.optionText}>Gerenciar profissional</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer} onPress={() => navigation.navigate('FAQ')}>
<Text style={styles.optionText}>FAQ</Text>
<View style={styles.optionContainer}>
<Text style={styles.optionText}>Notificações</Text>
<Switch
trackColor={{ false: "#91919F", true: "#E1948B" }}
thumbColor={'#F1F1FA'}
ios_backgroundColor="#91919F"
onValueChange={toggleSwitch}
value={isEnabled}
/>
</View>
</View> :
<View>
<TouchableOpacity style={styles.optionContainer} onPress={() => navigation.navigate('EditProfile', { user: user })}>
<Text style={styles.optionText}>Editar perfil</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer}>
<Text style={styles.optionText}>Compartilhar </Text>
<TouchableOpacity style={styles.optionContainer} onPress={navigateToGenerateCode}>
<Text style={styles.optionText}>Código de vinculação</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
</View>
</View>
}
</View>


</>
<View style={styles.accountSettingsContainer}>
<Text style={styles.accountSettingsText}>Suporte</Text>
<TouchableOpacity style={styles.optionContainer}>
<Text style={styles.optionText}>Sobre o e-motion</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer}>
<Text style={styles.optionText}>FAQ</Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
<TouchableOpacity style={styles.optionContainer}>
<Text style={styles.optionText}>Compartilhar </Text>
<MaterialCommunityIcons style={styles.optionIcon} name="chevron-right" color={iconColor} size={iconSize} />
</TouchableOpacity>
</View>
</View>
</View>
}
</View >
</View>
);
}

Expand Down

0 comments on commit d1a3d66

Please sign in to comment.