Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Commit 0881577

Browse files
author
kanishka-work
authored
Quick implementaiton of "Industrial Users: Header" (#212)
* update "Industrial Users" header to exactly match the Tailwind Playground implementation * also: fix hidden menu issue
1 parent 8f56cdc commit 0881577

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

components/HeaderNavigation.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let make = (~content) => {
9292
className={"absolute z-10 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-xs sm:px-0 " ++
9393
switch activeMenu {
9494
| Some(Industry) => " opacity-100 translate-y-0 "
95-
| _ => " opacity-0 translate-y-1 "
95+
| _ => " hidden "
9696
}}>
9797
<div
9898
className="rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden">
@@ -152,7 +152,7 @@ let make = (~content) => {
152152
className={"absolute z-10 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-xs sm:px-0 " ++
153153
switch activeMenu {
154154
| Some(Resources) => " opacity-100 translate-y-0 "
155-
| _ => " opacity-0 translate-y-1 "
155+
| _ => " hidden "
156156
}}>
157157
<div
158158
className="rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden">
@@ -221,7 +221,7 @@ let make = (~content) => {
221221
className={"absolute z-10 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-xs sm:px-0 " ++
222222
switch activeMenu {
223223
| Some(Community) => " opacity-100 translate-y-0 "
224-
| _ => " opacity-0 translate-y-1 "
224+
| _ => " hidden translate-y-1 "
225225
}}>
226226
<div
227227
className="rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden">

res_pages/industry/IndustryUsers.res

+52-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
module Link = Next.Link
2+
13
let s = React.string
24

35
type t = {
@@ -10,13 +12,62 @@ let contentEn = {
1012
pageDescription: `OCaml is a popular choice for companies who make use of its features in key aspects of their technologies. Some companies that use OCaml code are listed below:`,
1113
}
1214

15+
type callToAction = {
16+
label: string,
17+
url: string,
18+
}
19+
20+
// TODO: as part of generalizing, consolidate this with installocaml version
21+
module MarkdownPageTitleHeading2 = {
22+
@react.component
23+
let make = (~title, ~pageDescription, ~descriptionCentered=false, ~callToAction=?) =>
24+
<div className="text-lg max-w-prose mx-auto">
25+
<h1>
26+
// TODO: pass in mt-2 as a paramater
27+
<span
28+
className="mt-2 block text-3xl text-center leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl">
29+
{s(title)}
30+
</span>
31+
</h1>
32+
<p
33+
className={"mt-8 text-xl text-gray-500 leading-8" ++
34+
switch descriptionCentered {
35+
| true => " text-center "
36+
| false => ""
37+
}}>
38+
{s(pageDescription)}
39+
</p>
40+
{switch callToAction {
41+
| Some(callToAction) =>
42+
<div className="text-center mt-7">
43+
<Link href=callToAction.url>
44+
<a
45+
className="justify-center inline-flex items-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-yellow-600 hover:bg-yellow-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
46+
{s(callToAction.label)}
47+
</a>
48+
</Link>
49+
</div>
50+
| None => <> </>
51+
}}
52+
</div>
53+
}
54+
1355
@react.component
1456
let make = (~content=contentEn) => <>
1557
<ConstructionBanner
1658
figmaLink=`https://www.figma.com/file/36JnfpPe1Qoc8PaJq8mGMd/V1-Pages-Next-Step?node-id=430%3A36400`
1759
playgroundLink=`/play/industry/users`
1860
/>
19-
<TitleHeading title=content.title pageDescription=content.pageDescription />
61+
<div className="relative py-16 overflow-hidden">
62+
<div className="relative px-4 sm:px-6 lg:px-8">
63+
<MarkdownPageTitleHeading2
64+
title=content.title
65+
pageDescription=content.pageDescription
66+
descriptionCentered=true
67+
callToAction={label: "Success Stories", url: "/industry/successstories"}
68+
/>
69+
</div>
70+
</div>
2071
</>
2172

2273
let default = make

res_pages/resources/ResourcesInstallOcaml.res

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ let make = (~source, ~title, ~pageDescription) => {
4848
/>
4949
<div className="grid grid-cols-9">
5050
<div className="hidden lg:flex lg:col-span-2 " />
51+
// TODO: remove redundant bg-graylight
5152
<div className="col-span-9 lg:col-span-7 relative py-16 bg-graylight overflow-hidden">
5253
<div className="relative px-4 sm:px-6 lg:px-8">
5354
<MarkdownPageTitleHeading title pageDescription />

0 commit comments

Comments
 (0)