revert screens, ready for pr

This commit is contained in:
Loewy 2024-02-07 17:33:27 -08:00
parent 3a476e0db4
commit a9f474fa62
2 changed files with 3 additions and 23 deletions

View File

@ -1,7 +1,7 @@
import { DEV_USER_ID } from "@env";
import { FirebaseAuthTypes } from "@react-native-firebase/auth";
import React, { createContext, useContext, useEffect, useState } from "react";
import { currentUser, handleSignOut, onAuthStateChanged } from "../auth";
import { handleSignOut, onAuthStateChanged } from "../auth";
import { useAuthHeader } from "../graphql/client";
interface AuthContextType {
@ -46,7 +46,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
useEffect(() => {
let unsubscribe = () => {
console.log("Dev mode unsubscribe - really dense fn");
console.log("Dev Mode");
};
if (!DEV_USER_ID) {
@ -59,7 +59,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
useEffect(() => {
const setAuthAsync = async () => {
console.log("running");
if (DEV_USER_ID) {
console.log("Setting fake authorization user to: ", DEV_USER_ID);
setAuthHeader({ key: "user_id", value: DEV_USER_ID });

View File

@ -1,33 +1,14 @@
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 SignOutButton from "../component/buttons/sign-out";
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
// BarGraph component using mocked data currently
export default function SessionScreen() {
const { user } = useAuth();
const { authHeader } = useAuthHeader();
return (
<View style={StyleSheet.absoluteFill}>
<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>
);
}