Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
Open
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
8 changes: 7 additions & 1 deletion pages/[lang]/index.res
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ module T = {
) =>
<Page.Unstructured>
<Hero
imageSrc="/static/oc-sq.jpeg"
imageSrc="/static/hero-caml-400w.jpeg"
imageSrcSet="/static/hero-caml-400w.jpeg 400w,
/static/hero-caml-600w.jpeg 600w,
/static/hero-caml-800w.jpeg 800w"
imageSizes="(max-width: 599px) 200px,
(max-width: 799px) 300px,
(min-width: 800px) 400px"
imagePos={#Right}
header=heroContent.heroHeader
body=heroContent.heroBody
Expand Down
2 changes: 1 addition & 1 deletion pages/storybook.res
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ module Categories = {
module Hero = {
@react.component
let make = () => {
let imageSrc = "/static/oc-sq.jpeg"
let imageSrc = "/static/hero-caml-800w.jpeg"
let header = "A Header"
let body = "Some body text here that should be in latin. Some more body text here and here. Text text text text text text text text text text text text text."
let buttonLinks = {
Expand Down
Binary file added public/static/hero-caml-400w.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/hero-caml-600w.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/hero-caml-800w.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/static/oc-sq.jpeg
Binary file not shown.
10 changes: 5 additions & 5 deletions src/Hero.res
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ module HeroTextContainer = {
</div>
}

let image = (~src, ~pos) => {
let image = (~srcSet="", ~sizes="", ~src, ~pos) => {
let horizontalPlace = switch pos {
| #Right => "lg:right-0"
| #Left => "lg:left-0"
}
<div
className={`relative w-full h-64 sm:h-72 md:h-96 lg:absolute lg:inset-y-0 ${horizontalPlace} lg:w-1/2 lg:h-full`}>
<img className="absolute inset-0 w-full h-full object-cover" src alt="" />
<img className="absolute inset-0 w-full h-full object-cover" src srcSet sizes alt="" />
</div>
}

Expand Down Expand Up @@ -89,10 +89,10 @@ let callToActionArea = (~header, ~body, ~buttonLinks, ~imagePos) => {
}

@react.component
let make = (~imageSrc, ~header, ~body, ~buttonLinks=?, ~imagePos, ()) =>
<SectionContainer.LargeCentered>
let make = (~imageSrcSet="", ~imageSizes="", ~imageSrc, ~header, ~body, ~buttonLinks=?, ~imagePos, ()) =>
<SectionContainer.LargeCentered>
<div className="lg:relative">
{callToActionArea(~header, ~body, ~buttonLinks, ~imagePos)}
{image(~src=imageSrc, ~pos=imagePos)}
{image(~srcSet=imageSrcSet, ~sizes=imageSizes, ~src=imageSrc, ~pos=imagePos)}
</div>
</SectionContainer.LargeCentered>
2 changes: 2 additions & 0 deletions src/Hero.resi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type buttonLinks = {

@react.component
let make: (
~imageSrcSet: string=?,
~imageSizes: string=?,
~imageSrc: string,
~header: string,
~body: string,
Expand Down