Skip to content

Commit

Permalink
move tones
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii committed Dec 27, 2023
1 parent 45208da commit 6065a17
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
19 changes: 0 additions & 19 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
/// <reference types="@sveltejs/kit" />

type Tone =
| 'brand'
| 'brand-new'
| 'job'
| 'live'
| 'travel'
| 'money'
| 'book'
| 'masterclass'
| 'weekly'
| 'members'
| 'patron'
| 'lifestyle'
| 'climate'
| 'climate2'
| 'support'
| 'subscription'
| 'subs-rebrand';
3 changes: 2 additions & 1 deletion src/lib/Previews.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { replaceGAMVariables } from '$lib/gam';
import { onMount } from 'svelte';
import type { Message } from './messenger';
import { tones } from './types/tones';
export let template: string;
export let html: string;
Expand Down Expand Up @@ -93,7 +94,7 @@
{#if prop === 'Tone'}
{prop}:
<select bind:value={props[prop]}>
{#each ['job', 'live', 'travel', 'money', 'book', 'masterclass', 'weekly', 'members', 'patron', 'brand', 'brand-new', 'lifestyle', 'climate', 'climate2', 'support', 'subscription', 'subs-rebrand'] as tone}
{#each tones as tone}
<option value={tone}>{tone}</option>
{/each}
</select>
Expand Down
25 changes: 25 additions & 0 deletions src/lib/types/tones.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const tones = [
'brand',
'brand-new',
'job',
'live',
'travel',
'money',
'book',
'masterclass',
'weekly',
'members',
'patron',
'lifestyle',
'climate',
'climate2',
'support',
'subscription',
'subs-rebrand',
];

type Tone = typeof tones[number];

export type { Tone };

export { tones };
1 change: 1 addition & 0 deletions src/templates/components/ManualCard.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script context="module" lang="ts">
import { clickMacro } from '$lib/gam';
import type { Tone } from '$lib/types/tones';
</script>

<script lang="ts">
Expand Down
1 change: 1 addition & 0 deletions src/templates/components/ManualHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import '$templates/components/fonts/Headline.css';
import '$templates/components/fonts/SansBold.css';
import '$templates/components/colours/tones.css';
import type { Tone } from '$lib/types/tones';
export let buttonUrl: string;
export let buttonText: string;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/csr/events-multiple/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import ManualCard from '$templates/components/ManualCard.svelte';
import Resizer from '$templates/components/Resizer.svelte';
import ManualHeader from '$templates/components/ManualHeader.svelte';
import LiveLogo from '$templates/components/icons/LiveLogo.svelte';
import ToneLogo from '$templates/components/ToneLogo.svelte';
import type { Tone } from '$lib/types/tones';
export let BannerDescription: GAMVariable;
export let HeaderButtonText: GAMVariable;
Expand Down
1 change: 1 addition & 0 deletions src/templates/csr/manual-multiple/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import ManualHeader from '$templates/components/ManualHeader.svelte';
import Resizer from '$templates/components/Resizer.svelte';
import ToneLogo from '$templates/components/ToneLogo.svelte';
import type { Tone } from '$lib/types/tones';
export let Tone: GAMVariable<Tone>;
export let TitleURL: GAMVariable;
Expand Down

0 comments on commit 6065a17

Please sign in to comment.