Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add getting started page [MDS-173] #324

Merged
merged 2 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/moon_web/components/code_snippet.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
defmodule MoonWeb.Components.CodeSnippet do
@moduledoc false

use MoonWeb, :stateless_component

slot default

def render(assigns) do
~F"""
<pre class="moon-design-dark w-full bg-goku-100 overflow-scroll p-4 text-moon-14 text-bulma-100 rounded-moon-s-sm">
<#slot />
</pre>
"""
end
end
23 changes: 17 additions & 6 deletions lib/moon_web/pages/getting_started_page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ defmodule MoonWeb.Pages.GettingStartedPage do

use MoonWeb, :live_view

alias Moon.Autolayouts.TopToDown
alias Moon.Components.Heading
alias MoonWeb.Components.Page
alias MoonWeb.Components.PageSection
alias MoonWeb.Components.CodeSnippet

data breadcrumbs, :any,
default: [
Expand All @@ -26,10 +26,21 @@ defmodule MoonWeb.Pages.GettingStartedPage do
def render(assigns) do
~F"""
<Page theme_name={@theme_name} active_page={@active_page} breadcrumbs={@breadcrumbs}>
<TopToDown>
<Heading size={32}>Getting Started</Heading>
</TopToDown>
Coming soon
<h1 class="text-moon-32 font-semibold">Getting started</h1>
<PageSection title="First Section">
<p class="text-moon-16">Lorem ipsum dolor sit amet</p>
<CodeSnippet>mix something</CodeSnippet>
<p class="text-moon-16">Lorem ipsum dolor sit amet</p>
<CodeSnippet>mix something.else</CodeSnippet>
</PageSection>
<PageSection title="Second Section">
<p class="text-moon-16">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sed quam at augue varius accumsan id in sapien. Suspendisse maximus tortor at urna blandit, et varius nibh maximus. Suspendisse potenti. Interdum et malesuada fames ac ante ipsum primis in faucibus.
</p>
<CodeSnippet>iex -S mix phx.something</CodeSnippet>
<p class="text-moon-16">Lorem ipsum dolor sit amet</p>
<CodeSnippet>iex -S mix phx.another</CodeSnippet>
</PageSection>
</Page>
"""
end
Expand Down
9 changes: 0 additions & 9 deletions lib/moon_web/templates/layout/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@
<link rel="stylesheet" href={static_path(@conn, "/themes/sportsbet-dark.css")} />
<link rel="stylesheet" href={static_path(@conn, "/themes/sportsbet-light.css")} />
<link rel="stylesheet" href={static_path(@conn, "/assets/app.css")} />

<style>
pre {
font-size: 12px;
word-wrap: break-word;
overflow-x: scroll;
}
</style>

<script defer type="text/javascript" src={static_path(@conn, "/assets/app.js")}></script>
</head>
<body>
Expand Down