Skip to main content

Admin and Restaurant Owner App

info

The Admin App allows an admin to oversee and control the different restaurants. The Restaurant Owner App empowers restaurant managers to manage their products and process incoming orders efficiently . While the default experience focuses on customers, you can easily switch to the restaurant management interface by following this guide.

Configuration Steps

Setting Up the Admin Restaurant Owner Role

Admin should signup and will be greeted with the customer view. Then head to the users collection in the firestore database to find the newly added user. You need to add to the field:

  • role : "admin" (string) Login and you should be able to see the features of the admin that mainly include ability to add Vendors (Restaurant).

Code Implementation

note

The app automatically determines the appropriate navigation stack based on user roles. If you want to change or modify the features assigned to the roles to your likings. Go ahead to file AppNavigation.js inside src/navigations, and consumerAppConfig.js inside src/config.

{
currentUser?.role === "vendor" ? (
<RootStack.Screen
options={{ headerShown: false }}
name="MainStack"
component={VendorDrawerStack}
/>
) : currentUser?.role === "driver" ? (
<RootStack.Screen
options={{ headerShown: false }}
name="MainStack"
component={DriverDrawerStack}
/>
) : currentUser?.role === "admin" ? (
<RootStack.Screen
options={{ headerShown: false }}
name="AdminStack"
component={AdminDrawerStack}
/>
) : (
<RootStack.Screen
options={{ headerShown: false }}
name="MainStack"
component={DrawerStack}
/>
);
}