mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Show landmarks if it exists in homepage and in conversation page
This commit is contained in:
parent
c0a8a8efc8
commit
51b7b24430
3 changed files with 81 additions and 44 deletions
|
@ -22,7 +22,7 @@ if (__DEV__) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch this on if you wanna run production URLs while in development
|
// Switch this on if you wanna run production URLs while in development
|
||||||
let use_production = true;
|
let use_production = false;
|
||||||
if (__DEV__ && use_production) {
|
if (__DEV__ && use_production) {
|
||||||
backendURL = "https://stude.keannu1.duckdns.org";
|
backendURL = "https://stude.keannu1.duckdns.org";
|
||||||
backendURLWebsocket = "ws://stude.keannu1.duckdns.org";
|
backendURLWebsocket = "ws://stude.keannu1.duckdns.org";
|
||||||
|
|
|
@ -200,9 +200,17 @@ export default function ConversationPage() {
|
||||||
>
|
>
|
||||||
<View style={styles.flex_row}>
|
<View style={styles.flex_row}>
|
||||||
<Text style={{ ...styles.text_white_medium }}>
|
<Text style={{ ...styles.text_white_medium }}>
|
||||||
{`Group: ${studygroup?.name ? studygroup.name : ""}`}
|
{`Group: ${studygroup?.name ? studygroup.name : "Loading..."}`}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
{studygroup.landmark ? (
|
||||||
|
<Text style={{...styles.text_white_tiny_bold,...{textAlign:'left'}}}>
|
||||||
|
{studygroup.landmark}
|
||||||
|
</Text>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
|
||||||
<View style={{ ...styles.flex_row }}>
|
<View style={{ ...styles.flex_row }}>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
|
|
|
@ -153,20 +153,21 @@ export default function Home() {
|
||||||
location.coords.latitude,
|
location.coords.latitude,
|
||||||
location.coords.longitude
|
location.coords.longitude
|
||||||
);
|
);
|
||||||
console.log('Distance:',dist)
|
console.log("Distance:", dist);
|
||||||
console.log(student_status.location.latitude,
|
console.log(
|
||||||
|
student_status.location.latitude,
|
||||||
student_status.location.longitude,
|
student_status.location.longitude,
|
||||||
location.coords.latitude,
|
location.coords.latitude,
|
||||||
location.coords.longitude)
|
location.coords.longitude
|
||||||
|
);
|
||||||
if (dist > 0.02 && studying && !stopping_toofar) {
|
if (dist > 0.02 && studying && !stopping_toofar) {
|
||||||
console.log('Too far from current studying location')
|
console.log("Too far from current studying location");
|
||||||
stop_studying.mutate({
|
stop_studying.mutate({
|
||||||
active: false,
|
active: false,
|
||||||
});
|
});
|
||||||
setStopping(true);
|
setStopping(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onError: (error: Error) => {
|
onError: (error: Error) => {
|
||||||
toast.show(String(error), {
|
toast.show(String(error), {
|
||||||
|
@ -591,6 +592,13 @@ export default function Home() {
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
Study Group: {studygroup.name}
|
Study Group: {studygroup.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
{studygroup.landmark ? (
|
||||||
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
|
{studygroup.landmark}
|
||||||
|
</Text>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
{`Studying ${studygroup.subject}`}
|
{`Studying ${studygroup.subject}`}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -698,6 +706,13 @@ export default function Home() {
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
Study Group: {studygroup.name}
|
Study Group: {studygroup.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
{studygroup.landmark ? (
|
||||||
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
|
{studygroup.landmark}
|
||||||
|
</Text>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
{`Studying ${studygroup.subject}`}
|
{`Studying ${studygroup.subject}`}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -906,7 +921,7 @@ export default function Home() {
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
animationType: "slide-in",
|
animationType: "slide-in",
|
||||||
});
|
});
|
||||||
requestLocation()
|
requestLocation();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RefreshIcon size={32} />
|
<RefreshIcon size={32} />
|
||||||
|
@ -982,14 +997,13 @@ export default function Home() {
|
||||||
<DropdownIcon size={32} />
|
<DropdownIcon size={32} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<View style={styles.flex_column}>
|
<View style={styles.flex_column}>
|
||||||
|
|
||||||
<Text style={styles.text_white_medium}>List View</Text>
|
<Text style={styles.text_white_medium}>List View</Text>
|
||||||
<Switch
|
<Switch
|
||||||
value={modalByGroup}
|
value={modalByGroup}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
setModalByGroup(!modalByGroup);
|
setModalByGroup(!modalByGroup);
|
||||||
}}
|
}}
|
||||||
style={{alignSelf:'center'}}
|
style={{ alignSelf: "center" }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
@ -1048,6 +1062,13 @@ export default function Home() {
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
Group Name: {studygroup.name}
|
Group Name: {studygroup.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
{studygroup.landmark ? (
|
||||||
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
|
{studygroup.landmark}
|
||||||
|
</Text>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
{`Studying ${studygroup.subject}`}
|
{`Studying ${studygroup.subject}`}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -1130,14 +1151,13 @@ export default function Home() {
|
||||||
<DropdownIcon size={32} />
|
<DropdownIcon size={32} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<View style={styles.flex_column}>
|
<View style={styles.flex_column}>
|
||||||
|
|
||||||
<Text style={styles.text_white_medium}>List View</Text>
|
<Text style={styles.text_white_medium}>List View</Text>
|
||||||
<Switch
|
<Switch
|
||||||
value={modalByGroup}
|
value={modalByGroup}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
setModalByGroup(!modalByGroup);
|
setModalByGroup(!modalByGroup);
|
||||||
}}
|
}}
|
||||||
style={{alignSelf:'center'}}
|
style={{ alignSelf: "center" }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
@ -1174,7 +1194,8 @@ export default function Home() {
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
{modalByGroup ? (
|
{modalByGroup ? (
|
||||||
study_groups_global.map((studygroup: StudyGroupType, index: number) => {
|
study_groups_global.map(
|
||||||
|
(studygroup: StudyGroupType, index: number) => {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
key={index}
|
key={index}
|
||||||
|
@ -1193,6 +1214,13 @@ export default function Home() {
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
Group Name: {studygroup.name}
|
Group Name: {studygroup.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
{studygroup.landmark ? (
|
||||||
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
|
{studygroup.landmark}
|
||||||
|
</Text>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
<Text style={styles.text_white_tiny_bold}>
|
<Text style={styles.text_white_tiny_bold}>
|
||||||
{`Studying ${studygroup.subject}`}
|
{`Studying ${studygroup.subject}`}
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -1201,7 +1229,8 @@ export default function Home() {
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
})
|
}
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in a new issue