Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: #234 hide client/developer tabs #253

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.