generated from UnBArqDsw/RepositorioTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/ selecionando grupo nos detalhes #9
- Loading branch information
Showing
8 changed files
with
235 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import { View, Text } from "react-native"; | ||
import styles from "./styles"; | ||
import { RectButton } from "react-native-gesture-handler"; | ||
|
||
function UserItem() { | ||
return ( | ||
<View style={styles.container}> | ||
<View style={styles.profile}> | ||
<View style={styles.profileInfo}> | ||
<Text style={styles.name}>Nome</Text> | ||
</View> | ||
<View style={styles.buttonsContainer}> | ||
<RectButton style={styles.favoriteButton}> | ||
<Text style={styles.contactButtonText}>Del</Text> | ||
</RectButton> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
export default UserItem; |
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 |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import { StyleSheet } from "react-native"; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
backgroundColor: "#fff", | ||
borderWidth: 1, | ||
borderColor: "#e6e6f0", | ||
borderRadius: 8, | ||
marginBottom: 16, | ||
overflow: "hidden" | ||
}, | ||
|
||
profile: { | ||
flexDirection: "row", | ||
alignItems: "center", | ||
padding: 24, | ||
justifyContent: "space-between" | ||
}, | ||
|
||
avatar: { | ||
width: 64, | ||
height: 64, | ||
borderRadius: 32, | ||
backgroundColor: "#eee" | ||
}, | ||
|
||
profileInfo: { | ||
marginLeft: 16 | ||
}, | ||
|
||
name: { | ||
color: "#32264d", | ||
fontSize: 20 | ||
}, | ||
|
||
subject: { | ||
color: "#6a6180", | ||
fontSize: 12, | ||
marginTop: 4 | ||
}, | ||
|
||
bio: { | ||
marginHorizontal: 24, | ||
|
||
fontSize: 14, | ||
lineHeight: 24, | ||
color: "#6a6180" | ||
}, | ||
|
||
footer: { | ||
backgroundColor: "#fafafc", | ||
padding: 24, | ||
alignItems: "center", | ||
marginTop: 24 | ||
}, | ||
|
||
price: { | ||
color: "#6a6180", | ||
fontSize: 14 | ||
}, | ||
|
||
priceValue: { | ||
color: "#8257e5", | ||
fontSize: 16 | ||
}, | ||
|
||
buttonsContainer: { | ||
flexDirection: "row" | ||
}, | ||
|
||
favoriteButton: { | ||
backgroundColor: "#e33d3d", | ||
width: 56, | ||
height: 56, | ||
borderRadius: 16, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
marginRight: 0 | ||
}, | ||
|
||
favorited: { | ||
backgroundColor: "#e33d3d" | ||
}, | ||
|
||
contactButton: { | ||
backgroundColor: "#04d361", | ||
flex: 1, | ||
height: 56, | ||
borderRadius: 8, | ||
flexDirection: "row", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
marginRight: 8 | ||
}, | ||
|
||
contactButtonText: { | ||
color: "#fff", | ||
fontSize: 16 | ||
} | ||
}); | ||
|
||
export default styles; |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { View, Text } from "react-native"; | ||
import UserItem from "../../components/userItem"; | ||
import { RectButton } from "react-native-gesture-handler"; | ||
import { useNavigation, useFocusEffect } from "@react-navigation/core"; | ||
import AsyncStorage from "@react-native-community/async-storage"; | ||
import api from "../../services/api"; | ||
|
||
function GroupDeatils() { | ||
const [id, setId] = useState(); | ||
const [group, setGroup] = useState(); | ||
const [isLoading, setIsLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
async function loadStorageData() { | ||
const storagedId = await AsyncStorage.getItem("@DiarioSaude:Id"); | ||
|
||
setId(storagedId); | ||
} | ||
|
||
api | ||
.get(`/group/${id}`) | ||
.then(response => { | ||
console.log(response.data); | ||
setGroup(response.data); | ||
}) | ||
.catch(error => { | ||
console.log("errrrrrrrrrrrr"); | ||
}); | ||
|
||
loadStorageData(); | ||
}, [id]); | ||
|
||
function handleTest() { | ||
console.log(group); | ||
} | ||
if (!group) { | ||
return <Text>carregando</Text>; | ||
} else { | ||
return ( | ||
<View> | ||
<Text>{group.groupName}</Text> | ||
<UserItem /> | ||
<UserItem /> | ||
<UserItem /> | ||
<RectButton | ||
onPress={() => { | ||
handleTest(); | ||
}} | ||
> | ||
<Text>tatatata</Text> | ||
</RectButton> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
export default GroupDeatils; |
Empty file.
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