Rewrote app to use hooks and fixed multiple re-renders.

This commit is contained in:
Patrick Fic
2019-12-11 18:39:27 -08:00
parent 5c7523e6bd
commit f333301f67
16 changed files with 162 additions and 193 deletions

View File

@@ -1,5 +1,6 @@
export default {
currentUser: { email: null, displayName: null },
__typename: "State",
currentUser: null,
selectedNavItem: "Home",
recentItems: [],
whiteBoardLeftSiderVisible: true

View File

@@ -12,6 +12,10 @@ export const GET_CURRENT_USER = gql`
{
currentUser @client {
email
displayName
token
uid
photoUrl
}
}
`;
@@ -20,4 +24,4 @@ export const GET_WHITE_BOARD_LEFT_SIDER_VISIBLE = gql`
{
whiteBoardLeftSiderVisible @client
}
`;
`;

View File

@@ -20,11 +20,3 @@ export const GET_SELECTED_NAV_ITEM = gql`
selectedNavItem @client
}
`;
// export const SET_CURRENT_USER = gql`
// mutation SetCurrentUser($user User!){
// setCurrentUser(currentUser: $user)
// }
// `;

View File

@@ -6,7 +6,7 @@ export const UPSERT_USER = gql`
objects: [{ email: $authEmail, authid: $authToken }]
on_conflict: { constraint: users_pkey, update_columns: [authid] }
) {
data {
returning {
authid
}
}