Added bodyshop querying before starting application. Basic job query and list view.

This commit is contained in:
Patrick Fic
2020-08-12 16:39:03 -07:00
parent 1f8d16370a
commit 7cc384e7ff
14 changed files with 167 additions and 186 deletions

View File

@@ -47,9 +47,7 @@ const JobStackNavigator = () => (
<JobStack.Screen
name="JobList"
options={({ route }) => ({
title: `${i18n.t("joblist.labels.activejobs")} ${
JSON.stringify(route.params) | "X"
}`,
title: `${i18n.t("joblist.labels.activejobs")}`,
})}
component={ScreenJobList}
/>
@@ -96,19 +94,32 @@ const DrawerNavigator = () => (
</Drawer.Navigator>
);
export function ScreenMainComponent({ checkUserSession, currentUser }) {
export function ScreenMainComponent({
checkUserSession,
currentUser,
bodyshop,
}) {
useEffect(() => {
checkUserSession();
}, [checkUserSession]);
const { t } = useTranslation();
useEffect(() => {
if (currentUser.authorized) console.log("Authed");
//Do the saga shit.
}, [currentUser]);
return (
<NavigationContainer>
{currentUser.authorized === null ? (
<ScreenSplash />
) : currentUser.authorized ? (
<DrawerNavigator />
bodyshop ? (
<DrawerNavigator />
) : (
<ScreenSplash />
)
) : (
<ScreenSignIn />
)}