mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 03:48:06 +08:00
Code cleanup for multiple pages and components
This commit is contained in:
parent
14e14b8bb6
commit
68778cea7a
5 changed files with 22 additions and 13 deletions
|
@ -1,26 +1,26 @@
|
|||
import { Callout } from "react-native-maps";
|
||||
import { RawLocationType } from "../../interfaces/Interfaces";
|
||||
import { LocationType, RawLocationType } from "../../interfaces/Interfaces";
|
||||
import styles from "../../styles";
|
||||
import { Text } from "react-native";
|
||||
|
||||
// Map popup for user's location
|
||||
|
||||
type props = {
|
||||
location: RawLocationType;
|
||||
location: LocationType;
|
||||
studying: boolean;
|
||||
subject?: string;
|
||||
};
|
||||
|
||||
export default function CustomMapCallout(props: props) {
|
||||
let { location, studying, subject } = props;
|
||||
if (location && location.coords) {
|
||||
if (location && location.latitude && location.longitude) {
|
||||
if (studying) {
|
||||
return (
|
||||
<Callout>
|
||||
<Text style={styles.text_black_tiny}>
|
||||
You are here {"\n"}
|
||||
X: {Math.round(location.coords.longitude) + "\n"}
|
||||
Z: {Math.round(location.coords.latitude) + "\n"}
|
||||
X: {Math.round(location.longitude) + "\n"}
|
||||
Z: {Math.round(location.latitude) + "\n"}
|
||||
Studying: {subject}
|
||||
</Text>
|
||||
</Callout>
|
||||
|
@ -30,8 +30,8 @@ export default function CustomMapCallout(props: props) {
|
|||
<Callout>
|
||||
<Text style={styles.text_black_tiny}>
|
||||
You are here {"\n"}
|
||||
X: {Math.round(location.coords.longitude) + "\n"}
|
||||
Z: {Math.round(location.coords.latitude)}
|
||||
X: {Math.round(location.longitude) + "\n"}
|
||||
Z: {Math.round(location.latitude)}
|
||||
</Text>
|
||||
</Callout>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue