From 71a894b29248b258b62861517d75ef85cc17a6ff Mon Sep 17 00:00:00 2001 From: zbuseaydin Date: Sat, 11 May 2024 13:53:37 +0300 Subject: [PATCH 1/2] delete unnecessary styles --- mobile/NBAForum/pages/Team.js | 36 +++-------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/mobile/NBAForum/pages/Team.js b/mobile/NBAForum/pages/Team.js index 5fdd7036..14e32298 100644 --- a/mobile/NBAForum/pages/Team.js +++ b/mobile/NBAForum/pages/Team.js @@ -41,12 +41,12 @@ const Team = ({ route }) => { - {teamInfo.name} + {teamInfo.name} Team Info - + Conference: {teamInfo.conference} Division: {teamInfo.division} Coach: {teamInfo.coach} @@ -99,33 +99,6 @@ const styles = StyleSheet.create({ teamInfoHeading: { marginBottom: 10, }, - - playersContainer: { - marginBottom: 20, - backgroundColor: '#eaeaea', - padding: 10, - borderRadius: 10, - }, - playerItem: { - flexDirection: 'row', - alignItems: 'center', - marginBottom: 10, - }, - playerPosition: { - width: 60, - height: 30, - borderRadius: 15, - backgroundColor: 'rgba(255, 255, 255, 0.8)', - justifyContent: 'center', - alignItems: 'center', - marginRight: 10, - }, - teamImage: { - width: 150, - height: 150, - borderRadius: 25, - marginRight: 10, - }, teamImageWrapper: { width: '40%', aspectRatio: 1, @@ -133,12 +106,9 @@ const styles = StyleSheet.create({ overflow: 'hidden', borderRadius: 16, }, - playerInfo: { + teamInfo: { flex: 1, }, - blankSpace: { - height: 20, - }, }); export default Team; From 0b734354da79e4065a8ccb8279ae29c7acf4355a Mon Sep 17 00:00:00 2001 From: zbuseaydin Date: Sat, 11 May 2024 14:00:31 +0300 Subject: [PATCH 2/2] fix shown data + small ui changes --- mobile/NBAForum/pages/Player.js | 101 +++++++++++++------------------- 1 file changed, 42 insertions(+), 59 deletions(-) diff --git a/mobile/NBAForum/pages/Player.js b/mobile/NBAForum/pages/Player.js index 0a973cde..6ce609ec 100644 --- a/mobile/NBAForum/pages/Player.js +++ b/mobile/NBAForum/pages/Player.js @@ -7,7 +7,7 @@ const Player = ({ route }) => { const { baseURL } = useContext(Context); const [ playerInfo, setPlayerInfo ] = useState("LL"); const [ isLoading, setIsLoading ] = useState(true); - const playerID = route.params['id']; + const playerID = route.params['id']; console.log(playerID) const handleSearch = async (id) => { @@ -36,49 +36,51 @@ const Player = ({ route }) => { {playerInfo.name} - + - - Personal Information + + Personal Information - Height: {playerInfo.height.substr(-4)} - Date of Birth: {playerInfo.date_of_birth.substr(1,10)} + Height: + {playerInfo.height.substr(1,4)} cm + Date of Birth: + {playerInfo.date_of_birth.substr(1,10)} - + - - Professional Career + + Professional Career - Teams: + Teams {Object.keys(playerInfo.teams).map((team) => ( - {team} + {'\u2022'} {team} ))} - - Position + + Positions {playerInfo.positions.map((position) => ( - {position} + {'\u2022'} {position} ))} - - Awards + + Awards {Object.keys(playerInfo.awards).map((award) => ( - {award} + {'\u2022'} {award} ))} @@ -96,24 +98,32 @@ const Player = ({ route }) => { const styles = StyleSheet.create({ container: { flex: 1, - justifyContent: "center", - alignItems: "center", - padding: 30, - backgroundColor: "#1B64EB", + backgroundColor: "#87CEEB", + }, + infoContainer: { + padding: 10, + marginBottom: 5, + marginTop: 5, }, frame: { - height: '60%', flexDirection: 'row', padding: 10, }, scrollContainer: { flexGrow: 1, + backgroundColor: "#87CEEB", }, - sideContainer: { + leftsideContainer: { flex: 1, + backgroundColor: '#eaeaea', + borderTopLeftRadius: 16, + borderBottomLeftRadius: 16, }, - backgroundGrey: { - backgroundColor: 'white', + rightsideContainer: { + flex: 1, + backgroundColor: '#eaeaea', + borderTopRightRadius: 16, + borderBottomRightRadius: 16, }, playerImageContainer: { alignItems: 'center', @@ -132,33 +142,16 @@ const styles = StyleSheet.create({ height: '100%', resizeMode: 'contain', borderRadius: 16, + marginTop: 10, }, - personalInfoText: { + sub2Heading: { marginTop: 5, fontWeight: 'bold', - }, - personalInfoContainer: { - padding: 10, - borderRadius: 10, - borderRadius: 16, + fontSize: 15, }, personalInfoItem: { marginBottom: 5, }, - personalCareerContainer: { - marginBottom: 20, - borderRadius: 16, - }, - careerContainer: { - padding: 10, - borderRadius: 10, - borderRadius: 16, - }, - personalCareerHeading: { - fontWeight: 'bold', - fontSize: 18, - marginBottom: 10, - }, careerItem: { flexDirection: 'row', justifyContent: 'space-between', @@ -167,11 +160,7 @@ const styles = StyleSheet.create({ careerData: { flexDirection: 'column', }, - teamInfoContainer: { - marginBottom: 20, - borderRadius: 16, - }, - teamInfoHeading: { + sub1Heading: { fontWeight: 'bold', fontSize: 18, marginBottom: 10, @@ -179,19 +168,13 @@ const styles = StyleSheet.create({ teamInfoItem: { marginBottom: 5, }, - awardsContainer: { - marginBottom: 20, - borderRadius: 16, - }, - awardsHeading: { - fontWeight: 'bold', - fontSize: 18, - marginBottom: 10, - }, + heading: { fontSize: 20, fontWeight: 'bold', marginBottom: 10, + marginTop: 10, + marginLeft: 10, }, });