Skip to content

Commit

Permalink
Config and routes for roomshare
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikMelton committed Oct 10, 2024
1 parent febdc90 commit 5aaac00
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/funnels/funnels/register/steps/roomshare.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ReadonlyRouteComponentProps } from '~/util/readonly-types'
import { Router } from '@reach/router'
import { withPrefix } from 'gatsby'
import * as ROUTES from '~/navigation/routes'
import RoomShareJoin from '~/components/funnels/funnels/register/steps/roomshare/join'
import RoomShareHome from '~/components/funnels/funnels/register/steps/roomshare/home'
import RoomShareCreate from '~/components/funnels/funnels/register/steps/roomshare/create'

const RoomShare = (_: ReadonlyRouteComponentProps) =>
<Router basepath={withPrefix('/register/room-share')}>
<RoomShareHome path={`/${ROUTES.REGISTER_ROOM_SHARE_HOME}`} />
<RoomShareCreate path={`/${ROUTES.REGISTER_ROOM_SHARE_CREATE}`} />`
<RoomShareJoin path={`/${ROUTES.REGISTER_ROOM_SHARE_JOIN}`} />
</Router>

export default RoomShare
11 changes: 11 additions & 0 deletions src/components/funnels/funnels/register/steps/roomshare/create.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ReadonlyRouteComponentProps } from '~/util/readonly-types'

const RoomShareCreate = (_: ReadonlyRouteComponentProps) => {
return (
<div>
{/*<RoomShareCreateForm />*/}
</div>
)
}

export default RoomShareCreate
11 changes: 11 additions & 0 deletions src/components/funnels/funnels/register/steps/roomshare/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ReadonlyRouteComponentProps } from '~/util/readonly-types'

const RoomShareHome = (_: ReadonlyRouteComponentProps) => {
return (
<div>
<h1>RoomShareHome</h1>
</div>
)
}

export default RoomShareHome
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ReadonlyRouteComponentProps } from '~/util/readonly-types'

const RoomShareJoin = (_: ReadonlyRouteComponentProps) => {
return <div>RoomShareJoin</div>
}

export default RoomShareJoin
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const config = checkConfig({
dayTicketEndDate: DateTime.fromISO('2024-09-21', { zone: 'Europe/Berlin' }),
earliestBirthDate: DateTime.fromISO('1901-01-01'),
minimumAge: 18,
enableRoomshare: true, // For development
allowedCountries: ['AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AC', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BQ', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'CV', 'KH', 'CM', 'CA', 'KY', 'CF', 'EA', 'TD', 'CL', 'CN', 'CX', 'CP', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'HR', 'CU', 'CW', 'CY', 'CZ', 'CI', 'DK', 'DG', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE', 'SZ', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP', 'JE', 'JO', 'IC', 'KZ', 'KE', 'KI', 'KP', 'KR', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MK', 'MP', 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'BL', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST', 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'SS', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK', 'TO', 'TT', 'TA', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'UM', 'US', 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW'],
ticketLevels: {
'standard': {
Expand Down
7 changes: 7 additions & 0 deletions src/navigation/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,30 @@ import Room from '~/components/funnels/funnels/hotel-booking/steps/room'
import Guests from '~/components/funnels/funnels/hotel-booking/steps/guests'
import AdditionalInfo from '~/components/funnels/funnels/hotel-booking/steps/additional-info'
import Email from '~/components/funnels/funnels/hotel-booking/steps/email'
import RoomShare from '~/components/funnels/funnels/register/steps/roomshare'

import * as ROUTES from './routes'
import { withPrefix } from 'gatsby'
import { useAppSelector } from '~/hooks/redux'
import { isEditMode } from '~/state/selectors/register'
import config from '~/config'

export const EFRouter = () =>
<IndexPage />

const RoomShareRoutes = () =>
<RoomShare path={`/${ROUTES.REGISTER_ROOM_SHARE}`} />

export const RegisterRouter = () => {
const isEdit = useAppSelector(isEditMode())
const enableRoomShare = config.enableRoomshare

return <Router basepath={withPrefix('/register')}>
<Ticket default={!isEdit} path={`/${ROUTES.REGISTER_TICKET}/*`} />
<Personal path={`/${ROUTES.REGISTER_PERSONAL}`} />
<Contact path={`/${ROUTES.REGISTER_CONTACT}`} />
<Optional path={`/${ROUTES.REGISTER_OPTIONAL}`} />
{enableRoomShare && <RoomShareRoutes />}
<Summary default={isEdit} path={`/${ROUTES.REGISTER_SUMMARY}`} />
<ThankYou path={`/${ROUTES.REGISTER_THANK_YOU}`} />
</Router>
Expand Down
4 changes: 4 additions & 0 deletions src/navigation/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export const REGISTER_TICKET_LEVEL = 'level'
export const REGISTER_PERSONAL = 'personal-info'
export const REGISTER_CONTACT = 'contact-info'
export const REGISTER_OPTIONAL = 'optional-info'
export const REGISTER_ROOM_SHARE = 'room-share'
export const REGISTER_ROOM_SHARE_HOME = 'home'
export const REGISTER_ROOM_SHARE_JOIN = 'join'
export const REGISTER_ROOM_SHARE_CREATE = 'create'
export const REGISTER_SUMMARY = 'summary'
export const REGISTER_THANK_YOU = 'thank-you'

Expand Down
1 change: 1 addition & 0 deletions src/util/config-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Config<TicketLevel extends string, AddonConfigs extends Readonly<Record<str
readonly dayTicketEndDate: DateTime
readonly earliestBirthDate: DateTime
readonly minimumAge: number
readonly enableRoomshare: boolean
readonly allowedCountries: readonly (
| 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AC' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD'
| 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'CV' | 'KH'
Expand Down

0 comments on commit 5aaac00

Please sign in to comment.