CurViScene.re (4055B)
1 type state = { 2 opened: string, 3 dark: bool, 4 }; 5 type section = 6 | Quest 7 | Info 8 | Contact; 9 type action = 10 | ToggleDark 11 | Open(section); 12 13 let convert = (s: section) => 14 switch (s) { 15 | Quest => "quest" 16 | Info => "info" 17 | Contact => "contact" 18 }; 19 let initialState = {opened: "quest", dark: false}; 20 21 [@react.component] 22 let make = () => { 23 let (_, _) = 24 React.useReducer( 25 (state, action) => 26 switch (action) { 27 | ToggleDark => {...state, dark: !state.dark} 28 | Open(toOpen) => {...state, opened: convert(toOpen)} 29 }, 30 initialState, 31 ); 32 33 let questContent = 34 <ContentList 35 content=[| 36 { 37 variant: Done, 38 text: 39 <span> 40 {ReasonReact.string("Design apprentice at ")} 41 <Link href="https://www.xg.co.id" text="X-Graphic" /> 42 {ReasonReact.string(".")} 43 </span>, 44 }, 45 { 46 variant: Done, 47 text: 48 <span> 49 {ReasonReact.string("Quality Assurance at ")} 50 <Link href="https://www.touchten.com" text="Touchten Games" /> 51 {ReasonReact.string(".")} 52 </span>, 53 }, 54 { 55 variant: Done, 56 text: 57 <span> 58 {ReasonReact.string("Reactive Engineer at ")} 59 <Link href="https://vospay.id" text="Vospay" /> 60 {ReasonReact.string(".")} 61 </span>, 62 }, 63 { 64 variant: Progress, 65 text: 66 <h5> 67 {ReasonReact.string("Frontend Engineer at ")} 68 <Link href="https://kumparan.com" text="kumparan" /> 69 {ReasonReact.string(".")} 70 </h5>, 71 }, 72 |] 73 />; 74 75 let triviaContent = 76 <ContentList 77 content=[| 78 { 79 variant: Default, 80 text: 81 <span> 82 {ReasonReact.string("Studied CS in Binus, never finished it.")} 83 </span>, 84 }, 85 { 86 variant: Default, 87 text: <span> {ReasonReact.string("Drinks coffee.")} </span>, 88 }, 89 { 90 variant: Default, 91 text: 92 <span> 93 {ReasonReact.string("Loves moshing at indie band gigs.")} 94 </span>, 95 }, 96 { 97 variant: Default, 98 text: 99 <span> 100 <Link text="Vim user" internal="uses" /> 101 {ReasonReact.string(".")} 102 </span>, 103 }, 104 { 105 variant: Default, 106 text: 107 <span> 108 {ReasonReact.string("from ")} 109 <Link 110 href="https://goo.gl/maps/gMGbA5juGAx" 111 text="Jakarta, Indonesia" 112 /> 113 {ReasonReact.string(".")} 114 </span>, 115 }, 116 |] 117 />; 118 119 let contactContent = 120 <ContentList 121 content=[| 122 { 123 variant: Default, 124 text: 125 <span> 126 {ReasonReact.string("everywhere: ybbond or bandungpenting.")} 127 </span>, 128 }, 129 { 130 variant: Default, 131 text: 132 <h5> 133 <Link 134 href="mailto:bandungpenting@gmail.com?subject=From%20ybbond.dev" 135 text="bandungpenting@gmail.com" 136 /> 137 {ReasonReact.string(".")} 138 </h5>, 139 }, 140 { 141 variant: Default, 142 text: 143 <span> 144 <Link href="https://www.instagram.com/ybbond" text="Instagram" /> 145 {ReasonReact.string(", ")} 146 <Link href="https://github.com/ybbond" text="Github" /> 147 {ReasonReact.string(", ")} 148 <Link href="https://twitter.com/bandungpenting" text="Twitter" /> 149 {ReasonReact.string(".")} 150 </span>, 151 }, 152 |] 153 />; 154 155 <React.Fragment> 156 <Spoiler content=questContent title="Quests" /> 157 <Spoiler content=triviaContent title="Good to Know" /> 158 <Spoiler content=contactContent title="Find me" /> 159 </React.Fragment>; 160 };