Takk!

import React from 'react';

import { replaceQueryParameters } from 'shared/query-strings'; import { useSessionStorage } from 'hooks/use-storage'; import useUrlState from 'hooks/use-url-state';

import Text from '@sats/ui-lib/react/text';

import CheckoutEditorialCard from 'components/checkout-editorial-card/checkout-editorial-card'; import CheckoutLayout from 'components/checkout-layout/checkout-layout'; import CheckoutSummary from 'components/checkout-summary/checkout-summary'; import ContentContainer from 'components/content-container/content-container'; import HiddenInput from 'components/hidden-input/hidden-input'; import RegistrationForm from 'components/registration-form/registration-form';

import { RegistrationPage as Props } from './registration-page.types';

type PersonalInfo = { formData: Record<string, unknown>; member: { name: string; email: string; address: string; postalPlace: string; }; };

type RequestData = { firstName: string; lastName: string; email: string; address: string; postalCode: string; postalArea: string; };

const RegistrationPage: React.FC<Props> = ({ editorialCard, form, layout, personalInformationStorageKey, priceExplanation, redirectUrl, summary, }) => { const [personalInfo, setPersonalInfo] = useSessionStorage<PersonalInfo>( personalInformationStorageKey ); const [queryParameters] = useUrlState(); const { clubId = '', memberTypeId = '', sessionId = '' } = queryParameters;

const onRegistered = async ( { memberId }: { memberId: string }, requestData: RequestData ) => { const name = `${requestData.firstName} ${requestData.lastName}`; setPersonalInfo({ formData: requestData, member: { name, email: requestData.email, address: requestData.address, postalPlace: `${requestData.postalCode} ${requestData.postalArea}`, }, });

window.location.replace( replaceQueryParameters(redirectUrl, { ...queryParameters, memberId, email: requestData.email, })import React from 'react';

import { replaceQueryParameters } from 'shared/query-strings'; import { useSessionStorage } from 'hooks/use-storage'; import useUrlState from 'hooks/use-url-state';

import Text from '@sats/ui-lib/react/text';

import CheckoutEditorialCard from 'components/checkout-editorial-card/checkout-editorial-card'; import CheckoutLayout from 'components/checkout-layout/checkout-layout'; import CheckoutSummary from 'components/checkout-summary/checkout-summary'; import ContentContainer from 'components/content-container/content-container'; import HiddenInput from 'components/hidden-input/hidden-input'; import RegistrationForm from 'components/registration-form/registration-form';

import { RegistrationPage as Props } from './registration-page.types';

type PersonalInfo = { formData: Record<string, unknown>; member: { name: string; email: string; address: string; postalPlace: string; }; };

type RequestData = { firstName: string; lastName: string; email: string; address: string; postalCode: string; postalArea: string; };

const RegistrationPage: React.FC<Props> = ({ editorialCard, form, layout, personalInformationStorageKey, priceExplanation, redirectUrl, summary, }) => { const [personalInfo, setPersonalInfo] = useSessionStorage<PersonalInfo>( personalInformationStorageKey ); const [queryParameters] = useUrlState(); const { clubId = '', memberTypeId = '', sessionId = '' } = queryParameters;

const onRegistered = async ( { memberId }: { memberId: string }, requestData: RequestData ) => { const name = `${requestData.firstName} ${requestData.lastName}`; setPersonalInfo({ formData: requestData, member: { name, email: requestData.email, address: requestData.address, postalPlace: `${requestData.postalCode} ${requestData.postalArea}`, }, });

window.location.replace( replaceQueryParameters(redirectUrl, { ...queryParameters, memberId, email: requestData.email, })Din bestilling er registrert, vi kontakter deg for å aktivere ditt medlemskap på Røa Bad.