|
| 1 | +type link = { |
| 2 | + url: string, |
| 3 | + title: string, |
| 4 | + description: string, |
| 5 | + image: string, |
| 6 | +} |
| 7 | + |
| 8 | +let links: array<link> = [ |
| 9 | + { |
| 10 | + url: "https://dev.to/zth/getting-rid-of-your-dead-code-in-rescript-3mba", |
| 11 | + title: "Getting rid of your dead code in ReScript - DEV Community", |
| 12 | + description: "Exploring ReScript's tools for eliminating dead code, keeping your repository clean and without... Tagged with rescript.", |
| 13 | + image: "https://media2.dev.to/dynamic/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12lsasc06v1a355i6rfk.jpeg", |
| 14 | + }, |
| 15 | + { |
| 16 | + url: "https://www.daggala.com/belt_vs_js_array_in_rescript/", |
| 17 | + title: "Belt.Array vs Js.Array in Rescript", |
| 18 | + description: "You might have noticed that there are several ways in Rescript for iterating through elements of an array. It’s not at all obvious which one you should be using…", |
| 19 | + image: "https://www.daggala.com/static/30b47dd2b0682e7eb0279b85bc9ebb53/f3583/toolbelt.png", |
| 20 | + }, |
| 21 | + { |
| 22 | + url: "https://www.greyblake.com/blog/from-typescript-to-rescript/", |
| 23 | + title: "From TypeScript To ReScript | Serhii Potapov (greyblake)", |
| 24 | + description: "A blog about software development.", |
| 25 | + image: "https://www.greyblake.com/greyblake.jpeg", |
| 26 | + }, |
| 27 | + { |
| 28 | + url: "https://fullsteak.dev/posts/fullstack-rescript-architecture-overview", |
| 29 | + title: "Full-stack ReScript. Architecture Overview | Full Steak Dev", |
| 30 | + description: "Can ReScript be used to create a full-featured back-end? In this article, I’d try to prove it can and does it with success.\n", |
| 31 | + image: "", |
| 32 | + }, |
| 33 | + { |
| 34 | + url: "https://scalac.io/blog/rescript-for-react-development/", |
| 35 | + title: "ReScript for React - Development & Business Pros of ReScript", |
| 36 | + description: "Looking for ReScript for React Development information? In this article, I highlight the development & business advantages of ReScript.", |
| 37 | + image: "https://scalac.io/wp-content/uploads/2021/08/ReScript-for-React-Development-FB.png", |
| 38 | + }, |
| 39 | + { |
| 40 | + url: "https://yangdanny97.github.io/blog/2021/07/09/Migrating-to-Rescript", |
| 41 | + title: "Rewriting a Project in ReScript", |
| 42 | + description: "My experience reimplementing a small project in ReScript", |
| 43 | + image: "", |
| 44 | + }, |
| 45 | + { |
| 46 | + url: "https://alexfedoseev.com/blog/post/responsive-images-and-cumulative-layout-shift", |
| 47 | + title: "Responsive Images and Cumulative Layout Shift | Alex Fedoseev", |
| 48 | + description: "Solving cumulative layout shift issue caused by responsive images in layouts.", |
| 49 | + image: "https://d20bjcorj7xdk.cloudfront.net/eyJidWNrZXQiOiJpbWFnZXMuYWxleGZlZG9zZWV2LmNvbSIsImtleSI6Im1ldGEtYmxvZy5wbmciLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjEyMDAsImhlaWdodCI6NjMwLCJmaXQiOiJjb3ZlciJ9LCJqcGVnIjp7InF1YWxpdHkiOjkwfX19?signature=d8e6c0ac1ff03d0f5ee04d128b96a7701b998952a38ba96e9a16e4414cd05ed0&version=58cfd6f8abdefeca2195a6a1f1108596", |
| 50 | + }, |
| 51 | +] |
| 52 | + |
| 53 | +let simplifyUrl = url => |
| 54 | + url |
| 55 | + ->String.replace("https://", "") |
| 56 | + ->String.replace("http://", "") |
| 57 | + ->String.split("/") |
| 58 | + ->Array.at(0) |
| 59 | + |
| 60 | +module LinkCard = { |
| 61 | + @react.component |
| 62 | + let make = (~link) => { |
| 63 | + <div className="rounded-lg border-gray-90 hover:border-fire border-2 overflow-hidden"> |
| 64 | + <a href=link.url className="flex flex-col h-full"> |
| 65 | + <img className="object-cover w-full lg:h-20 md:h-22 h-40" src=link.image alt="" /> |
| 66 | + <div className="p-2 grow"> |
| 67 | + <h3 className="mb-2 font-semibold text-14 grow-0"> {React.string(link.title)} </h3> |
| 68 | + <p className="mb-2 text-12 grow"> {React.string(link.description)} </p> |
| 69 | + </div> |
| 70 | + <p className="text-14 p-2 grow-0 text-gray-60"> |
| 71 | + {React.string(link.url->simplifyUrl->Option.getOr(""))} |
| 72 | + </p> |
| 73 | + </a> |
| 74 | + </div> |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +module LinkCards = { |
| 79 | + @react.component |
| 80 | + let make = () => |
| 81 | + <div className="grid lg:grid-cols-3 md:grid-cols-2 gap-4"> |
| 82 | + {links |
| 83 | + ->Array.map(link => |
| 84 | + switch link.image { |
| 85 | + | "" => {...link, image: "/static/Art-3-rescript-launch.jpg"} |
| 86 | + | _ => link |
| 87 | + } |
| 88 | + ) |
| 89 | + ->Array.map(link => <LinkCard link key=link.title />) |
| 90 | + ->React.array} |
| 91 | + </div> |
| 92 | +} |
| 93 | + |
| 94 | +@react.component |
| 95 | +let make = () => { |
| 96 | + <div> |
| 97 | + <LinkCards /> |
| 98 | + </div> |
| 99 | +} |
| 100 | + |
| 101 | +let default = make |
0 commit comments