Update subscription routes and components

This commit is contained in:
Simon Larsen 2023-12-19 11:34:15 +00:00
parent d03ffc83b2
commit 32e72a8817
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
4 changed files with 12 additions and 12 deletions

View File

@ -36,7 +36,7 @@ import ObjectID from 'Common/Types/ObjectID';
// Logout.
import Logout from './Pages/Accounts/Logout';
import StatusPageUtil from './Utils/StatusPage';
import Unsubscribe from './Pages/Subscribe/Unsubscribe';
import UpdateSubscription from './Pages/Subscribe/UpdateSubscription';
const App: () => JSX.Element = () => {
Navigation.setNavigateHook(useNavigate());
@ -370,10 +370,10 @@ const App: () => JSX.Element = () => {
<PageRoute
path={RouteMap[PageMap.UNSUBSCRIBE]?.toString() || ''}
path={RouteMap[PageMap.UPDATE_SUBSCRIPTION]?.toString() || ''}
element={
<Unsubscribe
pageRoute={RouteMap[PageMap.UNSUBSCRIBE] as Route}
<UpdateSubscription
pageRoute={RouteMap[PageMap.UPDATE_SUBSCRIPTION] as Route}
onLoadComplete={() => {
onPageLoadComplete();
}}
@ -428,17 +428,17 @@ const App: () => JSX.Element = () => {
<PageRoute
path={
RouteMap[PageMap.PREVIEW_UNSUBSCRIBE]?.toString() ||
RouteMap[PageMap.PREVIEW_UPDATE_SUBSCRIPTION]?.toString() ||
''
}
element={
<Unsubscribe
<UpdateSubscription
onLoadComplete={() => {
onPageLoadComplete();
}}
pageRoute={
RouteMap[
PageMap.PREVIEW_UNSUBSCRIBE
PageMap.PREVIEW_UPDATE_SUBSCRIPTION
] as Route
}
allowSubscribersToChooseResources={

View File

@ -12,7 +12,7 @@ enum PageMap {
SUBSCRIBE_EMAIL = 'SUBSCRIBE_EMAIL',
SUBSCRIBE_SMS = 'SUBSCRIBE_SMS',
SUBSCRIBE_WEBHOOKS = 'SUBSCRIBE_WEBHOOKS',
UNSUBSCRIBE = 'UNSUBSCRIBE',
UPDATE_SUBSCRIPTION = 'UPDATE_SUBSCRIPTION',
NOT_FOUND = 'NOT_FOUND',
@ -28,7 +28,7 @@ enum PageMap {
PREVIEW_SUBSCRIBE_EMAIL = 'PREVIEW_SUBSCRIBE_EMAIL',
PREVIEW_SUBSCRIBE_SMS = 'PREVIEW_SUBSCRIBE_SMS',
PREVIEW_SUBSCRIBE_WEBHOOKS = 'PREVIEW_SUBSCRIBE_WEBHOOKS',
PREVIEW_UNSUBSCRIBE = 'PREVIEW_UNSUBSCRIBE',
PREVIEW_UPDATE_SUBSCRIPTION = 'PREVIEW_UPDATE_SUBSCRIPTION',
// Accounts.
LOGIN = 'LOGIN',

View File

@ -17,7 +17,7 @@ const RouteMap: Dictionary<Route> = {
[PageMap.SUBSCRIBE_EMAIL]: new Route(`/subscribe/email`),
[PageMap.SUBSCRIBE_SMS]: new Route(`/subscribe/sms`),
[PageMap.SUBSCRIBE_WEBHOOKS]: new Route(`/subscribe/webhooks`),
[PageMap.UNSUBSCRIBE]: new Route(`/unsubscribe/:id`),
[PageMap.UPDATE_SUBSCRIPTION]: new Route(`/update-subscription/:id`),
[PageMap.LOGIN]: new Route(`/login`),
[PageMap.SSO]: new Route(`/sso`),
@ -82,8 +82,8 @@ const RouteMap: Dictionary<Route> = {
`/status-page/${RouteParams.StatusPageId}/logout`
),
[PageMap.PREVIEW_UNSUBSCRIBE]: new Route(
`/status-page/${RouteParams.StatusPageId}/unsubscribe/:id`
[PageMap.PREVIEW_UPDATE_SUBSCRIPTION]: new Route(
`/status-page/${RouteParams.StatusPageId}/update-subscription/:id`
),
};