diff --git a/angular.json b/angular.json index 7544246..5a7ea9c 100644 --- a/angular.json +++ b/angular.json @@ -35,10 +35,7 @@ ], "scripts": [], "server": "src/main.server.ts", - "prerender": true, - "ssr": { - "entry": "server.ts" - } + "baseHref": "replaced-base-href" }, "configurations": { "production": { @@ -103,10 +100,14 @@ } }, "i18n": { - "sourceLocale": "nl-NL", + "sourceLocale": { + "code": "nl-NL", + "baseHref": "" + }, "locales": { "en-US": { - "translation": "messages-en.json" + "translation": "messages-en.json", + "baseHref": "" } } } diff --git a/messages-en.json b/messages-en.json index ac8ac51..f64cacd 100644 --- a/messages-en.json +++ b/messages-en.json @@ -7,7 +7,7 @@ "whenOptionCake": "Cake & Bubbles", "whenOptionDinner": "Dinner", "whenOptionChurch": "Church Ceremony", - "whenOptionParty": "Feest", - "mailBody": "Glad to hear you are attending! Please provide answers to the following questions:\n\nI will attend with: X persons\nI will be attending (please remove the events you will not attend):\n{$PH}\nNotes and dietary requirements" + "whenOptionParty": "Party", + "mailBody": "Glad to hear you are attending! Please provide answers to the following questions:%0D%0A\nI will attend with: X persons%0D%0A %0D%0A\nI will be attending (please remove the events you will not attend):\n%0D%0A\n{$PH}%0D%0A\n%0D%0ANotes and dietary requirements" } } diff --git a/messages-nl.json b/messages-nl.json index ff061fb..5d96288 100644 --- a/messages-nl.json +++ b/messages-nl.json @@ -8,6 +8,6 @@ "whenOptionDinner": "Diner", "whenOptionChurch": "Kerkdienst", "whenOptionParty": "Feest", - "mailBody": "Fijn dat je komt! Geef hieronder antwoord op de volgende vragen:\n\nIk kom met: X personen\nIk ben er bij met (verwijder als je niet aanwezig bent):\n{$PH}\nVerdere opmerkingen/dieetwensen" + "mailBody": "Wat fijn dat je ons laat weten of je er bij bent!%0D%0A\nIk kom met: %0D%0A\n- X personen%0D%0A %0D%0A\nIk ben er bij met (verwijder als je niet aanwezig bent):\n%0D%0A\n{$PH}%0D%0A\n%0D%0AVerdere opmerkingen/dieetwensen" } } \ No newline at end of file diff --git a/src/app/landing-page/landing-page.component.html b/src/app/landing-page/landing-page.component.html index 4e003a3..af4cf58 100644 --- a/src/app/landing-page/landing-page.component.html +++ b/src/app/landing-page/landing-page.component.html @@ -27,10 +27,10 @@

Cadeautip

Envelope - -
-

Adressen

- Klik -
+ + + + + diff --git a/src/app/landing-page/landing-page.component.ts b/src/app/landing-page/landing-page.component.ts index c014665..f662429 100644 --- a/src/app/landing-page/landing-page.component.ts +++ b/src/app/landing-page/landing-page.component.ts @@ -1,6 +1,7 @@ import {Component} from '@angular/core'; import {HeartComponent} from "../heart/heart.component"; import {RouterLink} from "@angular/router"; +import {InviteType, InviteTypeService} from "../shared/invite-type.service"; @Component({ selector: 'app-landing-page', @@ -13,6 +14,10 @@ import {RouterLink} from "@angular/router"; styleUrl: './landing-page.component.scss' }) export class LandingPageComponent { + constructor( + private inviteTypeService: InviteTypeService + ) { + } title = 'marc-en-tineke-2024'; mailTitleWholeDay = $localize`:@@mailTitleWholeDay:RSVP Trouwen 2024`; @@ -41,14 +46,14 @@ ${this.getWhenQuestions()}%0D%0A getWhenQuestions() { - return this.whenQuestionOptionsWholeDay.map(item => `- ${encodeURIComponent(item)}`).join('%0D%0A'); + const options = this.inviteTypeService.getInviteType() === InviteType.EVENING ? this.whenQuestionOptionsEvening : this.whenQuestionOptionsWholeDay; + + return options.map(item => `- ${encodeURIComponent(item)}`).join('%0D%0A'); } getMailToLink() { - return `mailto:marcentinekegaantrouwen@xz1.nl?subject=${this.mailTitleWholeDay}&body=${this.mailBody}`.replace('\n', '%0D%0A'); - } - - goToAddressesPage() { + const title = this.inviteTypeService.getInviteType() === InviteType.EVENING ? this.mailTitleEvening : this.mailTitleWholeDay; + return `mailto:marcentinekegaantrouwen@xz1.nl?subject=${title}&body=${this.mailBody}`.replace('\n', '%0D%0A'); } } diff --git a/src/app/shared/invite-type.service.ts b/src/app/shared/invite-type.service.ts new file mode 100644 index 0000000..09436fc --- /dev/null +++ b/src/app/shared/invite-type.service.ts @@ -0,0 +1,39 @@ +import {Inject, Injectable} from '@angular/core'; +import {DOCUMENT} from "@angular/common"; + +export enum InviteType { + FULL_DAY, + EVENING +} + +const inviteTypeMap = { + 'u7Tk3QvK': InviteType.EVENING, + 'AGr3ZfXM': InviteType.FULL_DAY, + 'ZXwfAK7g': InviteType.EVENING, + '5JnTf3NF': InviteType.FULL_DAY +} + +@Injectable({ + providedIn: 'root' +}) +export class InviteTypeService { + + + getInviteType() { + const inviteValue = this.getCookieValue('invite'); + + if (!inviteValue) { + return InviteType.EVENING; + } + + // @ts-ignore + return inviteTypeMap[inviteValue] + } + + private getCookieValue(name: string) { + return document.cookie + .split("; ") + .find((row) => row.startsWith(`${name}=`)) + ?.split("=")[1]; + } +} diff --git a/src/favicon.ico b/src/favicon.ico index 57614f9..5d240cf 100644 Binary files a/src/favicon.ico and b/src/favicon.ico differ diff --git a/src/index.html b/src/index.html index 04205dd..9bdc470 100644 --- a/src/index.html +++ b/src/index.html @@ -2,12 +2,11 @@ - MarcEnTineke2024 - + Marc en Tineke 2024 - +