From 0d1e240b203f346cd63ce368d38c9f05512e934e Mon Sep 17 00:00:00 2001 From: emilyliublair <67622097+emilyliublair@users.noreply.github.com> Date: Thu, 29 Jul 2021 11:26:38 -0400 Subject: [PATCH] sotw ui --- app/StudentWeek.js | 91 +++++++++++++++++++++++++----------- app/assets/achievements.png | Bin 0 -> 3196 bytes app/assets/collapse.png | Bin 0 -> 183 bytes app/assets/expand.png | Bin 0 -> 186 bytes app/assets/hobbies.png | Bin 0 -> 2332 bytes app/assets/message.png | Bin 0 -> 2125 bytes 6 files changed, 65 insertions(+), 26 deletions(-) create mode 100644 app/assets/achievements.png create mode 100644 app/assets/collapse.png create mode 100644 app/assets/expand.png create mode 100644 app/assets/hobbies.png create mode 100644 app/assets/message.png diff --git a/app/StudentWeek.js b/app/StudentWeek.js index e7d3012..2002dcb 100644 --- a/app/StudentWeek.js +++ b/app/StudentWeek.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { SafeAreaView, StyleSheet, @@ -7,6 +7,7 @@ import { Text, StatusBar, Image, + TouchableOpacity } from 'react-native'; import { @@ -23,9 +24,29 @@ class StudentWeek extends React.Component { constructor(props) { super(props) this.state = { - isLoading: true + isLoading: true, + hobbyExpanded: false, + achievementExpanded: false, + messageExpanded: false, + hobbyArrow:require('./assets/expand.png'), + achievementArrow:require('./assets/expand.png'), + messageArrow:require('./assets/expand.png') } } + + clickHobby() { + if (!this.state.hobbyExpanded) this.setState({hobbyExpanded:true, hobbyArrow: require('./assets/collapse.png')}); + else this.setState({hobbyExpanded: false,hobbyArrow:require('./assets/expand.png')}); + } + clickAchievements() { + if (!this.state.achievementExpanded) this.setState({achievementExpanded:true, achievementArrow: require('./assets/collapse.png')}); + else this.setState({achievementExpanded: false, achievementArrow:require('./assets/expand.png')}); + } + clickMessages() { + if (!this.state.messageExpanded) this.setState({messageExpanded:true, messageArrow: require('./assets/collapse.png')}); + else this.setState({messageExpanded: false, messageArrow:require('./assets/expand.png')}); + } + componentDidMount() { fetch(`${url}/api/en/student`,{ @@ -44,35 +65,53 @@ class StudentWeek extends React.Component { return } else { const iconURI = this.state.data.icon !== undefined?`data:image/png;charset=utf-8;base64,${this.state.data.icon}`:''; + const hobbyText = ({this.state.data.hobbies}) + const achievementText = ({this.state.data.achievements}) + const messageText = ({this.state.data.messages}) return ( - - - - {this.state.data.name} - {'\t'}Grade: {this.state.data.year} - - - + + + + + {this.state.data.name} + Grade {this.state.data.year} + + + + + + + Hobbies + + + + {this.state.hobbyExpanded?hobbyText:<>} + + + + + + Achievements + + + + {this.state.achievementExpanded?achievementText:<>} + + + + + + Messages + + + + {this.state.messageExpanded?messageText:<>} + - - - {"\n"}Hobbies: - {'\t'}{this.state.data.hobbies} - - - {"\n"}Achievements: - {'\t'}{this.state.data.achievements} - - - {"\n"}Messages: - {'\t'}{this.state.data.messages} - - - - + ) } } diff --git a/app/assets/achievements.png b/app/assets/achievements.png new file mode 100644 index 0000000000000000000000000000000000000000..7a1afc643c8eee90cb17143d122a30d4c11894a8 GIT binary patch literal 3196 zcmV-?41@EDP)6$cQAG|hlC-R%O>BJP8X8!EH|D9f-(BTb7fTM#4=Bxb8hQmLfYclwW)lvJuJ z3)}quN$TBm?mgdo@1DCog{veHX$=elZUZ_3ZGdzjq1vPZC;`p_r+`DiE=5t!U#%D} zTO!g{L>7rij$FP@ipW9{Y4iU9&{ag<5s|CSFYdi-@efjsUf_Mno)E3Sk$Ktyep;prb^b%NI$othAvnJ47Vu zav>5$VxDfIA&@x-1 z#KrFf?okxQTiaHR5!0%=AS$wQ=rBL~ojTArj0KTI~0PvqW zPT*o5ri^C94I7CmHJw0SF8(t)Vf6&gp2o3oHU*RJq4=?Bl+2!ibLo75!N3c#;tIbD zA`|L*z7-#>m;4b~QuuGVy%^JY*~YiYa8CYq&B0v(v^!Tne!)}51qWl=#yq&pDt$ZBM2+MLvd%Tdf`O6LBW zs-0W0bn8jdqfdrx%$;t=KK_2<`VS>oa1rOiC(+BxFlDwvcNB-!r>3Q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S>)oHYfp-~G7)`_Si=Oz; zoB~}B^HtN*vGwYUUS5X#qxDqn+6IbhB!fsDR;nkB=Nbc2zUGfqZuyLiwHq)szoC8y zUB~^&|4{MX>xkcvt?xkM1`WfM*^2Ttf54w}oMs<>5#7~Y0U`h>nucPFi)PkRQxxUA zh~!YuRHa7Z^-#6@3oN&GZx{rCs$w5E1zXl2TyMUDXWuS7`*wwj?c-yvup2Tk9#<6Q zLd`hx9#V%om=tj--YfdF{Ue>ZpM~12-|?6sL82yMk4_~WzT2hJ-815NA^>s zE&fA&Fv2B!TVX+q$lDkj5s_YgKSd9YL2KEDwB@Vte}BSwZT9XYSX^iX-}x47{fA)d zJ22YrV2p4C=hFFj5AMT0dID;C6I^e+f~9j8QkTAnVvh3U4ZWc#%EL83YEK&H03(5j zTj)Ko2fe%u3HT{`WKw7!%G{wd@uMeT%NpE}je50000&IYeHTaHXLCoRH8zaLIXpGb zPx4nS{i%A=D1DmEY4L=0D$8bXImMmkx&F`8lvf_7n%5n;7Ga-yC)7Pppkc)gamgR% dGRFf8m}|2X#E-X&Z35cM;OXk;vd$@?2>^f$Llyu4 literal 0 HcmV?d00001 diff --git a/app/assets/expand.png b/app/assets/expand.png new file mode 100644 index 0000000000000000000000000000000000000000..b53914379aeb2b7ffd0bba66d5fa1596ceefa903 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt`no-U3d z9-VLdH}WGk(dhy4r@Asu;j{ls>aHKD0%A3cZcw`RT zIiY&;&9sy(8F9-f9#1B-)jQf5)+p_&3z{x2_4>Y7+th5&ut`z#+^1xF{!O`2JIK~!jg#hQC?l+_uBpKo__SrP~a1{7mJTg#Lg>Ub&C8d4CUs6nlO zDBiVPtV{(XqjI%Uydfw8BHB)^*0Ixy&InZtf=V3`Daas1NCd36&1HA937hP0cK7@B zk1rcGo6T)^(cfP?=l-1cJ!ju@&S#JzNg4`_11F3`Ez~EK@GlKxh^bb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