Skip to content

Commit

Permalink
fixed layout
Browse files Browse the repository at this point in the history
  • Loading branch information
SaySayo committed Aug 9, 2023
1 parent 0f41be9 commit 8dd7a7d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
29 changes: 16 additions & 13 deletions src/ocamlorg_frontend/components/learn_components.eml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,34 @@ class_
let book_tile
books
=
<div class="flex flex-row gap-x-6">
<div class="flex flex-col gap-6 sm:flex-row">
<% books |> List.rev |> List.iteri (fun index (item : Data.Book.t) -> if (index < 2) then ( %>
<div class="flex flex-col">
<img src="<%s Ocamlorg_static.Media.url item.cover %>"
class="mt-2 h-48 w-32 md:w-56 md:h-80 border border-gray-200"
class="mt-2 w-56 h-80 border border-gray-200 object-contain"
alt="">
<%s! skill_tag item.difficulty "mt-2 grow-0 w-28" %>
<h4 class="h-16 w-56 mt-3 text-gray-700 text-lg font-normal leading-6"> <%s item.title %> </h4>
<p class="mt-3 text-gray-700 text-sm font-normal whitespace-normal max-w-xs">Suitable for complete beginners to programming</p>
<h4 class="mt-1 w-56 text-gray-700 text-lg font-normal leading-6"> <%s item.title %> </h4>
<p class="mt-1 text-gray-700 text-sm font-normal whitespace-normal max-w-xs">Suitable for complete beginners to programming</p>
</div>
<% ) else %>
<% ); %>
</div>


type link = {href : string; name : string}

let books_content_block
books
~(link : link )
=
<div class="w-full h-[42rem] bg-default md:w-1/2 md:pl-28">
<div class="pt-4 text-default text-sm text-left font-medium leading-7 tracking-widest"> Books </div>
<h2 class="mt-2 text-default text-2xl text-left font-normal leading-7"> Recommended Books </h2>
<%s! book_tile books %>
<a href="<%s! Url.books %>" class="flex gap-4 mt-4 text-primary-700 text-lg font-bold inline-flex items-center underline leading-10">
See all books
<%s! Icons.arrow_small_right "h-6 w-6" %>
</a>
<div class="w-full bg-default lg:w-1/2">
<div class="w-80 sm:w-full md:w-full mx-auto">
<div class="pt-4 text-default text-sm text-left font-medium leading-7 tracking-widest"> BOOK </div>
<h2 class="mt-2 text-default text-2xl text-left font-normal leading-7"> Recommended Books </h2>
<%s! book_tile books %>
<a href="<%s link.href %>" class="flex gap-4 mt-4 text-primary-700 text-lg font-bold inline-flex items-center underline leading-10">
<%s link.name %>
<%s! Icons.arrow_small_right "h-6 w-6" %>
</a>
</div>
</div>
5 changes: 5 additions & 0 deletions src/ocamlorg_frontend/pages/learn.eml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ Learn_layout.render
</div>
</div>
</div>
<div class="lg:grid lg:grid-cols-2">
<%s! Learn_components.books_content_block Data.Book.featured ~link:{href = Url.books; name = "See All Books"} %>
<div class="w-full bg-learn-area-light-blue h-[42rem] lg:w-1/2">
</div>
</div>
<div class="mt-10 lg:mt-20 border-b border-gray-200 pb-10">
<h3 class="font-bold">Papers</h3>
<div class="mt-6 text-lighter text-lg">
Expand Down
3 changes: 0 additions & 3 deletions src/ocamlorg_frontend/pages/outreachy.eml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,4 @@ Layout.render
</div>
<% ); %>
</div>
</div>
<div>
<%s! Learn_components.books_content_block Data.Book.featured %>
</div>

0 comments on commit 8dd7a7d

Please sign in to comment.