aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/contact.svelte
blob: 9f5bb98844db834b3c9e1361a2a31e988278ee35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<script context="module" lang="ts">
	export type ContactModel = {
		addressLines: Array<string>;
		email?: string;
		phone?: string;
		phoneHours?: string;
	};
</script>

<script lang="ts">
	import LL from "$i18n/i18n-svelte";

	export let model: ContactModel;

	let visible = true;

	$: if (!model.addressLines) {
		visible = false;
	} else {
		visible = true;
	}
</script>

<section class="contact relative z-1">
	<div class="w-[calc(100%_-_2.5rem)] lg:w-[calc(100%_-_4rem)] mx-auto max-w-7xl">
		<div class="mb-8 lg:mb-12">
			<h1 class="text-center">{$LL.contact.title()}</h1>
		</div>

		<div class="grid grid-cols-12 gap-8 lg:gap-12">
			<div class="col-span-12 lg:col-span-6">
				<dl class="details-list details-list--rows">
					{#if (model.addressLines?.length ?? 0) > 0}
						<div class="details-list__item py-5 lg:py-8 lg:flex lg:justify-between">
							<dt class="font-bold mb-1.5 lg:mb-2 lg:mb-0">{$LL.contact.addressTitle()}</dt>
							<dd class="leading-snug lg:text-right">
								{#each model.addressLines as line}
									{line}<br />
								{/each}
							</dd>
						</div>
					{/if}
					{#if model.email}
						<div class="details-list__item py-5 lg:py-8 lg:flex lg:justify-between">
							<dt class="font-bold mb-1.5 lg:mb-2 lg:mb-0">{$LL.contact.emailTitle()}</dt>
							<dd>
								<a href="mailto:webmaster@example.com">{model.email}</a>
							</dd>
						</div>
					{/if}
					{#if model.phone}
						<div class="details-list__item py-5 lg:py-8 lg:flex lg:justify-between">
							<dt class="font-bold mb-1.5 lg:mb-2 lg:mb-0">{$LL.contact.phoneTitle()}</dt>
							<dd class="leading-snug lg:text-right">
								<p><a href="tel:+44 7656 6455">{model.phone}</a></p>
								{#if model.phoneHours}
									<p class="text-contrast-medium">{model.phoneHours}</p>
								{/if}
							</dd>
						</div>
					{/if}
				</dl>
			</div>
			<div class="rounded col-span-12 lg:col-span-6 lg:h-auto lg:pb-0" />
		</div>
	</div>
</section>