diff --git a/pages/[lang]/community/aroundweb.res b/pages/[lang]/community/aroundweb.res index fc4ad339..52784ae1 100644 --- a/pages/[lang]/community/aroundweb.res +++ b/pages/[lang]/community/aroundweb.res @@ -163,7 +163,10 @@ module T = { } + renderCard={(idx, s) => +
+ +
} title=content.spacesSectionHeader />
diff --git a/pages/[lang]/resources/tutorials.res b/pages/[lang]/resources/tutorials.res index cecf483f..87042d04 100644 --- a/pages/[lang]/resources/tutorials.res +++ b/pages/[lang]/resources/tutorials.res @@ -33,7 +33,8 @@ module T = {
} + renderCard={(idx, t: Ood.Tutorial.t) => +
} />
diff --git a/pages/storybook.res b/pages/storybook.res index 1312e9f8..470c5998 100644 --- a/pages/storybook.res +++ b/pages/storybook.res @@ -22,11 +22,12 @@ module Item = {

{React.string(`<${name} />`)}

{docsElement}
{React.array( - children->Belt.Array.map(((color, (doc, child))) => { + children->Belt.Array.mapWithIndex((idx, (color, (doc, child))) => {
+ )} p-8 mb-8`} + key={string_of_int(idx)}>
{React.string(doc)}

{child}
}), @@ -959,9 +960,7 @@ module Categories = {
{React.string(Printf.sprintf("Foo-%d-%d", n, m))}
- | #Bar => - Js.log(a) - React.string(Printf.sprintf("Bar-%d-%d", n, m)) + | #Bar => React.string(Printf.sprintf("Bar-%d-%d", n, m)) } } let detailsComponent = foobar => { @@ -1275,7 +1274,8 @@ module Categories = { ( "CardGrid rendered with strings for each element", { - let renderCard = React.string + let renderCard = (idx, x) => +
{React.string(x)}
let title = "Example" }, @@ -1283,8 +1283,10 @@ module Categories = { ( "CardGrid rendered with Cards for each element", { - let renderCard = s => - {React.string(s)} + let renderCard = (idx, s) => +
+ {React.string(s)} +
let title = "Example" }, diff --git a/src/CardGrid.res b/src/CardGrid.res index d5d94b3d..c5df4101 100644 --- a/src/CardGrid.res +++ b/src/CardGrid.res @@ -11,6 +11,6 @@ let make = (~cardData, ~renderCard, ~title=?) => <> | None => <> }}
- {cardData->Belt.Array.map(renderCard)->React.array} + {cardData->Belt.Array.mapWithIndex(renderCard)->React.array}
diff --git a/src/CardGrid.resi b/src/CardGrid.resi index 3d914dd2..16b42b56 100644 --- a/src/CardGrid.resi +++ b/src/CardGrid.resi @@ -3,6 +3,6 @@ open! Import @react.component let make: ( ~cardData: array<'a>, - ~renderCard: 'a => React.element, + ~renderCard: (int, 'a) => React.element, ~title: string=?, ) => React.element diff --git a/src/ContentGrid.res b/src/ContentGrid.res index 59b31d5b..2d88b230 100644 --- a/src/ContentGrid.res +++ b/src/ContentGrid.res @@ -37,7 +37,7 @@ let make = (~title, ~renderChild, ~cols, ~children) => { }, ]) } -
+

{renderChild(child)}

diff --git a/src/HeaderNavigation.res b/src/HeaderNavigation.res index aab7244f..745a11e2 100644 --- a/src/HeaderNavigation.res +++ b/src/HeaderNavigation.res @@ -296,37 +296,37 @@ let make = (~content) => {
-
diff --git a/src/LogoCloud.res b/src/LogoCloud.res index 19a479c0..9018454c 100644 --- a/src/LogoCloud.res +++ b/src/LogoCloud.res @@ -64,12 +64,14 @@ let make = (~companies) =>
{switch companies { | #LogoOnly(companies) => - companies->Js.Array2.map((c: Company.t) => -
+ companies->Js.Array2.mapi((c: Company.t, idx) => +
+ +
) | #LogoWithText(companies) => - companies->Js.Array2.map((c: CompanyOptionalLogo.t) => - + companies->Js.Array2.mapi((c: CompanyOptionalLogo.t, idx) => +
) }->React.array}
diff --git a/src/MediaCarousel.res b/src/MediaCarousel.res index 6e9af7fe..a3cdc1a5 100644 --- a/src/MediaCarousel.res +++ b/src/MediaCarousel.res @@ -74,7 +74,6 @@ let make = (
{items ->Belt.Array.mapWithIndex((id, item) => { - Js.log(item)
) => { let len = Belt.Array.length(items) React.array( - items->Belt.Array.mapWithIndex((i, item) => { + items->Belt.Array.mapWithIndex((idx, item) => { let borderSizes = [ "sm:border-0", - if i != len - 1 { + if idx != len - 1 { "border-b sm:border-r" } else { "" }, - if i != 0 { + if idx != 0 { "border-t sm:border-l" } else { "" }, ]->Js.String.concatMany(" ") - +
+ +
}), ) } diff --git a/src/Table.res b/src/Table.res index a6b4c2e0..be7dcb8d 100644 --- a/src/Table.res +++ b/src/Table.res @@ -70,15 +70,15 @@ module Regular = { { let len = Belt.Array.length(columns) React.array( - columns->Belt.Array.mapWithIndexU((. i, column) => { + columns->Belt.Array.mapWithIndexU((. idx, column) => { let rounding = { [ - if i == 0 { + if idx == 0 { "rounded-tl" } else { "" }, - if i == len - 1 { + if idx == len - 1 { "rounded-tr" } else { "" @@ -86,7 +86,8 @@ module Regular = { ]->Js.String.concatMany(" ") } + className={`py-2 px-3 ${rounding} sticky top-0 border-b border-gray-200 bg-yellow-300`} + key={string_of_int(idx)}> {React.string(column.title)} }), @@ -100,9 +101,12 @@ module Regular = { key={"r" ++ string_of_int(i)} className="border-double border-t-4 border-gray-200 hover:bg-yellow-50"> {React.array( - columns->Belt.Array.map(({title, component, className}) => - {React.createElement(component, map)} - ), + columns->Belt.Array.mapWithIndex((idx, {title, component, className}) => { + let _title = title + + {React.createElement(component, map)} + + }), )} ), diff --git a/src/VerticalHighlightCard.res b/src/VerticalHighlightCard.res index a394fbf3..f51c0ead 100644 --- a/src/VerticalHighlightCard.res +++ b/src/VerticalHighlightCard.res @@ -10,7 +10,7 @@ type item = { let make = (~title, ~buttonText, ~buttonRoute, ~lang, ~children) => { let (item1, item2, item3) = children let renderItem = (i, item) => { -
+

{React.string(`${string_of_int(i)}.`)}

// TODO: visual indicator that link will open new tab