mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
* feat: add new user page * feat: passwordchecker * fix: remove loading * feat: reset password * fix: move swr to devDeps * feat: generate reset link * feat: add reset password form * fix: remove console log * fix: rename to forgotten password * feat: add simple menu * fix: change password checker title * fix: change text in new-user view * fix: lint errors * fix: add status code to constants * fix: comment * fix: add classes for new user component * fix: tests * fix: remove console log * fix: remove retry method * fix: invalid token constant * fix: remove console log * fix: dependency array on useCallback * fix: featureview * fix: redirect on authenticated * refactor: progresswheel * fix: lint deps
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import ConditionallyRender from '../../common/ConditionallyRender';
|
|
import MainLayout from '../MainLayout/MainLayout';
|
|
|
|
const LayoutPicker = ({ children, location }) => {
|
|
const standalonePages = () => {
|
|
const isLoginPage = location.pathname.includes('login');
|
|
const isNewUserPage = location.pathname.includes('new-user');
|
|
const isChangePasswordPage = location.pathname.includes(
|
|
'reset-password'
|
|
);
|
|
const isResetPasswordSuccessPage = location.pathname.includes(
|
|
'reset-password-success'
|
|
);
|
|
const isForgottenPasswordPage = location.pathname.includes(
|
|
'forgotten-password'
|
|
);
|
|
|
|
return (
|
|
isLoginPage ||
|
|
isNewUserPage ||
|
|
isChangePasswordPage ||
|
|
isResetPasswordSuccessPage ||
|
|
isForgottenPasswordPage
|
|
);
|
|
};
|
|
|
|
return (
|
|
<ConditionallyRender
|
|
condition={standalonePages()}
|
|
show={children}
|
|
elseShow={<MainLayout location={location}>{children}</MainLayout>}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default LayoutPicker;
|