Skip to content

Commit 307e3a1

Browse files
committed
feat: add Challenges live view and routing
- Introduced a new live view for the Challenges page, featuring links to Golem, Tsperf, and Prettier challenges with corresponding background images. - Updated the router to include a new route for the Challenges page, enhancing navigation within the application.
1 parent 96e3075 commit 307e3a1

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
defmodule AlgoraWeb.ChallengesLive do
2+
@moduledoc false
3+
use AlgoraWeb, :live_view
4+
5+
alias AlgoraWeb.Components.Footer
6+
alias AlgoraWeb.Components.Header
7+
8+
def render(assigns) do
9+
~H"""
10+
<Header.header />
11+
<div class="pt-24 mx-auto max-w-7xl px-6 lg:px-8">
12+
<h1 class="text-4xl font-bold font-display">Challenges</h1>
13+
<div class="flex flex-col gap-6 pt-16 md:grid md:grid-cols-3 md:pt-12">
14+
<.link
15+
class="group relative flex aspect-[1200/630] flex-1 rounded-2xl border-2 border-solid border-border bg-cover hover:no-underline"
16+
style="background-image:url(/images/challenges/golem/og.png)"
17+
navigate={~p"/challenges/golem"}
18+
>
19+
</.link>
20+
<.link
21+
class="group relative flex aspect-[1200/630] flex-1 rounded-2xl border-2 border-solid border-border bg-cover hover:no-underline"
22+
style="background-image:url(/images/challenges/tsperf/og.png)"
23+
navigate={~p"/challenges/tsperf"}
24+
>
25+
</.link>
26+
<.link
27+
class="group relative flex aspect-[1200/630] flex-1 rounded-2xl border-2 border-solid border-border bg-cover hover:no-underline"
28+
style="background-image:url(/images/challenges/prettier/og.png)"
29+
navigate={~p"/challenges/prettier"}
30+
>
31+
</.link>
32+
</div>
33+
</div>
34+
<Footer.footer />
35+
"""
36+
end
37+
end

lib/algora_web/router.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ defmodule AlgoraWeb.Router do
144144
live "/onboarding/org", Onboarding.OrgLive
145145
live "/onboarding/dev", Onboarding.DevLive
146146
live "/pricing", PricingLive
147+
live "/challenges", ChallengesLive
147148
live "/challenges/prettier", Challenges.PrettierLive
148149
live "/challenges/golem", Challenges.GolemLive
149150
live "/challenges/tsperf", Challenges.TsperfLive

0 commit comments

Comments
 (0)