diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php index 94d80427b..4b311cab1 100644 --- a/resources/views/components/footer.blade.php +++ b/resources/views/components/footer.blade.php @@ -66,7 +66,7 @@ class="h-6" }) } " - class="flex flex-wrap items-center justify-center gap-2.5 *:opacity-0" + class="flex flex-wrap items-center justify-center gap-x-3 gap-y-2 *:opacity-0" aria-label="Social networks" > diff --git a/resources/views/components/icons/devnull.blade.php b/resources/views/components/icons/devnull.blade.php new file mode 100644 index 000000000..45a7d920c --- /dev/null +++ b/resources/views/components/icons/devnull.blade.php @@ -0,0 +1,16 @@ + + + + diff --git a/resources/views/components/icons/facebook.blade.php b/resources/views/components/icons/facebook.blade.php new file mode 100644 index 000000000..1bf6493f6 --- /dev/null +++ b/resources/views/components/icons/facebook.blade.php @@ -0,0 +1,10 @@ + + + diff --git a/resources/views/components/icons/instagram.blade.php b/resources/views/components/icons/instagram.blade.php new file mode 100644 index 000000000..8be498a9c --- /dev/null +++ b/resources/views/components/icons/instagram.blade.php @@ -0,0 +1,28 @@ + + + + + diff --git a/resources/views/components/icons/pinkary.blade.php b/resources/views/components/icons/pinkary.blade.php deleted file mode 100644 index c36dcdf69..000000000 --- a/resources/views/components/icons/pinkary.blade.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/resources/views/components/icons/threads.blade.php b/resources/views/components/icons/threads.blade.php new file mode 100644 index 000000000..7be368b27 --- /dev/null +++ b/resources/views/components/icons/threads.blade.php @@ -0,0 +1,10 @@ + + + diff --git a/resources/views/components/icons/tiktok.blade.php b/resources/views/components/icons/tiktok.blade.php new file mode 100644 index 000000000..d7bc252f0 --- /dev/null +++ b/resources/views/components/icons/tiktok.blade.php @@ -0,0 +1,10 @@ + + + diff --git a/resources/views/components/icons/twitch.blade.php b/resources/views/components/icons/twitch.blade.php new file mode 100644 index 000000000..36f5d2511 --- /dev/null +++ b/resources/views/components/icons/twitch.blade.php @@ -0,0 +1,10 @@ + + + diff --git a/resources/views/components/navbar/mobile-menu.blade.php b/resources/views/components/navbar/mobile-menu.blade.php index ff1b9fd25..1df42873c 100644 --- a/resources/views/components/navbar/mobile-menu.blade.php +++ b/resources/views/components/navbar/mobile-menu.blade.php @@ -485,24 +485,13 @@ class="rounded-full px-2.5 py-1.5 transition duration-300 ease-in-out"
- - diff --git a/resources/views/components/social-networks-all.blade.php b/resources/views/components/social-networks-all.blade.php index 4c6421f9d..a988afda6 100644 --- a/resources/views/components/social-networks-all.blade.php +++ b/resources/views/components/social-networks-all.blade.php @@ -1,95 +1,33 @@ -
- - - -
+@php + $networks = [ + ['href' => $githubLink, 'title' => 'Source code of NativePHP', 'icon' => 'github', 'size' => 'size-[1.2rem]'], + ['href' => $openCollectiveLink, 'title' => 'NativePHP on Open Collective', 'icon' => 'opencollective', 'size' => 'size-[1.2rem]'], + ['href' => $discordLink, 'title' => 'Go to discord server', 'icon' => 'discord', 'size' => 'size-[1.25rem]'], + ['href' => 'https://youtube.com/@NativePHPOfficial', 'title' => 'NativePHP on YouTube', 'icon' => 'youtube', 'size' => 'size-[1.5rem]'], + ['href' => 'https://www.twitch.tv/nativephp', 'title' => 'NativePHP on Twitch', 'icon' => 'twitch', 'size' => 'size-[1.15rem]'], + ['href' => 'https://dev-null.sh/@nativephp', 'title' => 'NativePHP on /dev/null', 'icon' => 'devnull', 'size' => 'size-[1.1rem]'], + ['href' => 'https://x.com/nativephp', 'title' => 'NativePHP on X', 'icon' => 'twitter', 'size' => 'size-[1.1rem]'], + ['href' => $bskyLink, 'title' => 'NativePHP on Bluesky', 'icon' => 'bluesky', 'size' => 'size-[1.2rem]'], + ['href' => 'https://www.threads.com/@nativephp', 'title' => 'NativePHP on Threads', 'icon' => 'threads', 'size' => 'size-[1.15rem]'], + ['href' => 'https://www.facebook.com/profile.php?id=61578672170369', 'title' => 'NativePHP on Facebook', 'icon' => 'facebook', 'size' => 'size-[1.2rem]'], + ['href' => 'https://www.instagram.com/nativephp/', 'title' => 'NativePHP on Instagram', 'icon' => 'instagram', 'size' => 'size-[1.2rem]'], + ['href' => 'https://www.tiktok.com/@nativephp', 'title' => 'NativePHP on TikTok', 'icon' => 'tiktok', 'size' => 'size-[1.15rem]'], + ['href' => 'https://www.linkedin.com/company/nativephp/', 'title' => 'NativePHP on LinkedIn', 'icon' => 'linkedin', 'size' => 'size-[1.2rem]'], + ]; +@endphp -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
+@foreach ($networks as $network) +
+ + + +
+@endforeach diff --git a/tests/Feature/SocialNetworkLinksTest.php b/tests/Feature/SocialNetworkLinksTest.php new file mode 100644 index 000000000..26e620952 --- /dev/null +++ b/tests/Feature/SocialNetworkLinksTest.php @@ -0,0 +1,86 @@ +withoutVite() + ->get('/contributing') + ->assertOk() + ->assertSee('href="https://dev-null.sh/@nativephp"', false) + ->assertSee('title="NativePHP on /dev/null"', false) + ->assertDontSee('pinkary.com') + ->assertDontSee('Pinkary'); + } + + #[Test] + public function the_footer_lists_every_network_in_the_chosen_order(): void + { + $this + ->withoutVite() + ->get('/contributing') + ->assertOk() + ->assertSeeInOrder([ + 'title="Source code of NativePHP"', + 'title="NativePHP on Open Collective"', + 'title="Go to discord server"', + 'title="NativePHP on YouTube"', + 'title="NativePHP on Twitch"', + 'title="NativePHP on /dev/null"', + 'title="NativePHP on X"', + 'title="NativePHP on Bluesky"', + 'title="NativePHP on Threads"', + 'title="NativePHP on Facebook"', + 'title="NativePHP on Instagram"', + 'title="NativePHP on TikTok"', + 'title="NativePHP on LinkedIn"', + ], false); + } + + #[Test] + public function social_links_only_appear_in_the_footer_and_not_the_header_menu(): void + { + $response = $this + ->withoutVite() + ->get('/contributing') + ->assertOk() + ->assertSee('aria-label="Social networks"', false) + ->assertDontSee('aria-label="Social media"', false); + + $content = $response->getContent(); + + foreach ([ + 'https://x.com/nativephp', + 'https://www.twitch.tv/nativephp', + 'https://www.tiktok.com/@nativephp', + 'https://www.instagram.com/nativephp/', + 'https://www.threads.com/@nativephp', + 'https://www.facebook.com/profile.php?id=61578672170369', + 'https://dev-null.sh/@nativephp', + 'https://www.linkedin.com/company/nativephp/', + ] as $url) { + $this->assertSame(1, substr_count($content, 'href="'.$url.'"'), "Expected {$url} to be linked exactly once."); + } + } +}