revert screens, ready for pr
This commit is contained in:
parent
3a476e0db4
commit
a9f474fa62
@ -1,7 +1,7 @@
|
|||||||
import { DEV_USER_ID } from "@env";
|
import { DEV_USER_ID } from "@env";
|
||||||
import { FirebaseAuthTypes } from "@react-native-firebase/auth";
|
import { FirebaseAuthTypes } from "@react-native-firebase/auth";
|
||||||
import React, { createContext, useContext, useEffect, useState } from "react";
|
import React, { createContext, useContext, useEffect, useState } from "react";
|
||||||
import { currentUser, handleSignOut, onAuthStateChanged } from "../auth";
|
import { handleSignOut, onAuthStateChanged } from "../auth";
|
||||||
import { useAuthHeader } from "../graphql/client";
|
import { useAuthHeader } from "../graphql/client";
|
||||||
|
|
||||||
interface AuthContextType {
|
interface AuthContextType {
|
||||||
@ -46,7 +46,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let unsubscribe = () => {
|
let unsubscribe = () => {
|
||||||
console.log("Dev mode unsubscribe - really dense fn");
|
console.log("Dev Mode");
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!DEV_USER_ID) {
|
if (!DEV_USER_ID) {
|
||||||
@ -59,7 +59,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const setAuthAsync = async () => {
|
const setAuthAsync = async () => {
|
||||||
console.log("running");
|
|
||||||
if (DEV_USER_ID) {
|
if (DEV_USER_ID) {
|
||||||
console.log("Setting fake authorization user to: ", DEV_USER_ID);
|
console.log("Setting fake authorization user to: ", DEV_USER_ID);
|
||||||
setAuthHeader({ key: "user_id", value: DEV_USER_ID });
|
setAuthHeader({ key: "user_id", value: DEV_USER_ID });
|
||||||
|
@ -1,33 +1,14 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { StyleSheet, Text, View } from "react-native";
|
import { StyleSheet, View } from "react-native";
|
||||||
import { graph_data_two_measures } from "../../test/mock/charts/mock-data";
|
import { graph_data_two_measures } from "../../test/mock/charts/mock-data";
|
||||||
import SignOutButton from "../component/buttons/sign-out";
|
|
||||||
import BarGraph from "../component/charts/bar-graph/bar-graph";
|
import BarGraph from "../component/charts/bar-graph/bar-graph";
|
||||||
import { useAuth } from "../context";
|
|
||||||
import { useAuthHeader } from "../graphql/client";
|
|
||||||
|
|
||||||
// Session Mock - can be used for session summary screen using a query handler component
|
// Session Mock - can be used for session summary screen using a query handler component
|
||||||
// BarGraph component using mocked data currently
|
// BarGraph component using mocked data currently
|
||||||
export default function SessionScreen() {
|
export default function SessionScreen() {
|
||||||
const { user } = useAuth();
|
|
||||||
const { authHeader } = useAuthHeader();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={StyleSheet.absoluteFill}>
|
<View style={StyleSheet.absoluteFill}>
|
||||||
<BarGraph data={graph_data_two_measures} />
|
<BarGraph data={graph_data_two_measures} />
|
||||||
|
|
||||||
{user && (
|
|
||||||
<>
|
|
||||||
<Text style={{ marginTop: 10 }}>
|
|
||||||
Display name: {user?.displayName}
|
|
||||||
</Text>
|
|
||||||
<Text>Phone number: {user?.phoneNumber}</Text>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<SignOutButton />
|
|
||||||
<Text>
|
|
||||||
{authHeader.key}: {authHeader.value}
|
|
||||||
</Text>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user