-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProfile.tsx
48 lines (44 loc) · 1.39 KB
/
Profile.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React, { FC, ReactElement, useEffect, useState } from "react";
import { Text, View } from "react-native";
import { useAuth } from "./context/AuthContext";
import QRCode from "react-native-qrcode-svg";
export const Profile: FC<{}> = ({}): ReactElement => {
const { user, userInfo, getPoints, changedPoints, setChangedPoints, points } =
useAuth();
const hacks8Logo = require("./assets/byte_mini.png");
useEffect(() => {
if (changedPoints) {
getPoints(user.uid);
setChangedPoints(false);
}
}, [changedPoints, user]);
return (
<>
<View style={{ flex: 3, alignItems: "center" }}>
{userInfo.uid ? (
<>
<Text style={{ fontSize: 36, color: "white" }}>
You have {points} points!
</Text>
<View
style={{
alignItems: "center",
marginTop: 10,
marginBottom: 10,
paddingBottom: 10,
backgroundColor: "white",
}}
>
<Text style={{ marginBottom: 15, fontSize: 18, color: "black" }}>
Use this QR code to check-in to events! 🐶
</Text>
<View style={{ backgroundColor: "white" }}>
<QRCode size={250} value={userInfo.uid} />
</View>
</View>
</>
) : null}
</View>
</>
);
};