Skip to content

Commit

Permalink
chore(marketplace): #234 hide client/developer tabs (#253)
Browse files Browse the repository at this point in the history
hide the tabs when REAPIT_ENV is PROD
  • Loading branch information
duong-se authored Feb 13, 2020
1 parent 13236c4 commit 74b123c
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/aml-checklist/src/tests/badges/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/aml-checklist/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/lifetime-legal/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion packages/marketplace/src/components/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const tabConfigs = ({ loginType, history }: LoginProps): TabConfig[] => [
]

export const Login: React.FunctionComponent<LoginProps> = (props: LoginProps) => {
const reapitEnv = process.env.REAPIT_ENV || 'LOCAL'
const isReapitEnvProd = reapitEnv === 'PROD'
const { hasSession, loginType, location, authChangeLoginType } = props
const { wrapper, container, image, tabsContainer /* , register */ } = loginStyles

Expand All @@ -69,7 +71,7 @@ export const Login: React.FunctionComponent<LoginProps> = (props: LoginProps) =>
</Level>
<p className="pb-8">Welcome to Reapit {`${loginType === 'CLIENT' ? 'Marketplace' : 'Foundations'}`}</p>

{loginType !== 'ADMIN' && (
{loginType !== 'ADMIN' && !isReapitEnvProd && (
<div className={tabsContainer}>
<Tabs tabConfigs={tabConfigs(props)} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ exports[`Router should match a snapshot 1`] = `
exact={true}
path={
Array [
"/client/login",
"/developer/login",
"/admin/login",
"/client/login",
]
}
render={[Function]}
Expand Down
4 changes: 3 additions & 1 deletion packages/marketplace/src/core/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ const AdminAppsPage = React.lazy(() => import('../components/pages/admin-apps'))
const RegisterConfirm = React.lazy(() => import('../components/pages/register-confirm'))
const AdminStats = React.lazy(() => import('../components/pages/admin-stats'))

const reapitEnv = process.env.REAPIT_ENV || 'LOCAL'
const isReapitEnvProd = reapitEnv === 'PROD'
const Router = () => (
<BrowserRouter history={history}>
<React.Suspense fallback={null}>
<Switch>
<Route
path={[Routes.CLIENT_LOGIN, Routes.DEVELOPER_LOGIN, Routes.ADMIN_LOGIN]}
path={[Routes.DEVELOPER_LOGIN, Routes.ADMIN_LOGIN, ...(isReapitEnvProd ? [] : [Routes.CLIENT_LOGIN])]}
exact
render={() => <Login />}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/marketplace/src/tests/badges/badge-statements.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74b123c

Please sign in to comment.