ybbond-reason

My old site written in ReasonReact
Log | Files | Refs | README | LICENSE | CC-LICENSE

PoemsScene.re (882B)


      1 module Styles = {
      2   open Css;
      3   let pre =
      4     style([
      5       paddingLeft(`em(1.4)),
      6       fontFamily("Cousine for Powerline, monospace"),
      7       display(`block),
      8       whiteSpace(`preWrap),
      9       maxWidth(`px(544)),
     10       fontSize(`em(0.9)),
     11       lineHeight(`em(2.8)),
     12       media(
     13         "(max-width: 414px)",
     14         [fontSize(`em(0.8)), lineHeight(`em(3.0))],
     15       ),
     16     ]);
     17 };
     18 
     19 [@react.component]
     20 let make = () => {
     21   open PoemContent;
     22   let content: array(poemContent) = content;
     23   let contentMapped =
     24     Array.mapi(
     25       (key, item) => {
     26         let contentPre =
     27           <pre className=Styles.pre> {ReasonReact.string(item.script)} </pre>;
     28         <Spoiler
     29           title={item.title}
     30           content=contentPre
     31           key={string_of_int(key)}
     32         />;
     33       },
     34       content,
     35     );
     36 
     37   <React.Fragment> {ReasonReact.array(contentMapped)} </React.Fragment>;
     38 };