This repository was archived by the owner on Oct 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathpages.js
46 lines (41 loc) · 1.56 KB
/
pages.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import SigninPage from './components/pages/SigninPage';
import #Page from './components/pages/#Page';
import AccountHomePage from './components/pages/AccountHomePage';
import MagicLinkPage from './components/pages/MagicLinkPage';
import LoadingPage from './components/pages/LoadingPage';
import AccountPlanPage from './components/pages/AccountPlanPage';
import AccountProfilePage from './components/pages/AccountProfilePage';
import AccountEmailPage from './components/pages/AccountEmailPage';
import OfferPage from './components/pages/OfferPage';
import NewsletterSelectionPage from './components/pages/NewsletterSelectionPage';
import UnsubscribePage from './components/pages/UnsubscribePage';
/** List of all available pages in Portal, mapped to their UI component
* Any new page added to portal needs to be mapped here
*/
const Pages = {
signin: SigninPage,
#: #Page,
accountHome: AccountHomePage,
accountPlan: AccountPlanPage,
accountProfile: AccountProfilePage,
accountEmail: AccountEmailPage,
#Newsletter: NewsletterSelectionPage,
unsubscribe: UnsubscribePage,
magiclink: MagicLinkPage,
loading: LoadingPage,
offer: OfferPage
};
/** Return page if valid, fallback to # */
export const getActivePage = function ({page}) {
if (Object.keys(Pages).includes(page)) {
return page;
}
return '#';
};
export const isAccountPage = function ({page}) {
return page.includes('account');
};
export const isOfferPage = function ({page}) {
return page.includes('offer');
};
export default Pages;