Skip to content

Commit bd9d009

Browse files
committed
feat: added about us and contact page transitions. #prod
1 parent caa626d commit bd9d009

File tree

4 files changed

+49
-12
lines changed

4 files changed

+49
-12
lines changed

resources/ts/Layouts/AppLayout.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,19 @@
4141
</a>
4242
{/if}
4343

44+
<a class="btn btn-sm variant-ghost-surface" href={route('about')} use:inertia> About </a>
45+
<a class="btn btn-sm variant-ghost-surface" href={route('contact')} use:inertia> Contact </a>
46+
4447
<a
45-
class="btn btn-sm variant-ghost-surface"
48+
class="btn btn-sm variant-ringed-surface"
4649
href="https://twitter.com/acelords"
4750
target="_blank"
4851
rel="noreferrer"
4952
>
5053
Twitter
5154
</a>
5255
<a
53-
class="btn btn-sm variant-ghost-surface"
56+
class="btn btn-sm variant-ringed-surface"
5457
href="https://github.com/lexxyungcarter/laravelte"
5558
target="_blank"
5659
rel="noreferrer"

resources/ts/Pages/About.svelte

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
<script lang="ts">
2-
import {inertia} from '@inertiajs/svelte'
3-
</script>
2+
import Title from '@/Components/Title.svelte'
3+
import { inertia } from '@inertiajs/svelte'
4+
import { fly } from 'svelte/transition'
5+
import { quintOut } from 'svelte/easing'
6+
import { onMount } from 'svelte'
47
5-
<h2>About us</h2>
8+
let ready = false
9+
onMount(() => (ready = true))
10+
</script>
611

7-
<a href="/" use:inertia>GoHome</a>
8-
<a href={route('contact')} use:inertia>Contact</a>
12+
<div class="container mt-5" in:fly={{ y: -70, duration: 300, easing: quintOut }}>
13+
<Title>About Us Page</Title>
14+
<a href="/" use:inertia>Go Home</a>
15+
<br />
16+
<a href={route('contact')} use:inertia>Contact</a>
17+
</div>

resources/ts/Pages/Contact.svelte

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
<script lang="ts">
2-
import {inertia} from '@inertiajs/svelte'
3-
</script>
2+
import Title from '@/Components/Title.svelte'
3+
import { inertia } from '@inertiajs/svelte'
4+
import { fly } from 'svelte/transition'
5+
import { quintOut } from 'svelte/easing'
6+
import { onMount } from 'svelte'
47
5-
<h2>Contact us</h2>
8+
let ready = false
9+
onMount(() => (ready = true))
10+
</script>
611

7-
<a href="/" use:inertia>Go Home</a>
8-
<a href={route('about')} use:inertia>About</a>
12+
<div class="container mt-5" in:fly={{ y: -70, duration: 300, easing: quintOut }}>
13+
<Title>Contact Us Page</Title>
14+
<a href="/" use:inertia>Go Home</a>
15+
<br />
16+
<a href={route('about')} use:inertia>About</a>
17+
</div>

tests/Feature/FrontendPagesTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,19 @@
1616
->component('Home')
1717
);
1818
})->group('browser');
19+
20+
test('about screen can be rendered', function () {
21+
$response = $this->get(route('about'));
22+
23+
$response->assertInertia(fn (Assert $page) => $page
24+
->component('About')
25+
);
26+
})->group('browser');
27+
28+
test('contact screen can be rendered', function () {
29+
$response = $this->get(route('contact'));
30+
31+
$response->assertInertia(fn (Assert $page) => $page
32+
->component('Contact')
33+
);
34+
})->group('browser');

0 commit comments

Comments
 (0)