Skip to content

Commit

Permalink
remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty-key committed Mar 26, 2024
1 parent 627bb67 commit 10ef9d2
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/ReshowcaseUi.re
Original file line number Diff line number Diff line change
Expand Up @@ -880,20 +880,9 @@ module DemoUnitFrame = {
(),
);

let useFullframeUrl: bool = [%mel.raw
{js|typeof USE_FULL_IFRAME_URL === "boolean" ? USE_FULL_IFRAME_URL : false|js}
];

[@react.component]
let make =
(
~queryString as _: string,
~responsiveMode,
~onLoad: Js.t('a) => unit,
~children,
) => {
let make = (~responsiveMode, ~onLoad: Js.t('a) => unit, ~children) => {
let (body, setBody) = React.useState(_ => None);
let _iframePath = if (useFullframeUrl) {"demo/index.html"} else {"demo"};

<div name="DemoUnitFrame" style={container(responsiveMode)}>
<iframe
Expand Down Expand Up @@ -993,7 +982,7 @@ module App = {

type route =
| Unit(URLSearchParams.t, string)
| Demo(string, string)
| Demo(string)
| Home;

[@react.component]
Expand All @@ -1007,7 +996,7 @@ module App = {
urlSearchParams->(URLSearchParams.get("demo")),
) {
| (Some("true"), Some(demoName)) => Unit(urlSearchParams, demoName)
| (_, Some(demoName)) => Demo(url.search, demoName)
| (_, Some(demoName)) => Demo(demoName)
| _ => Home
};

Expand Down Expand Up @@ -1065,7 +1054,7 @@ module App = {
<div name="App" style=Styles.app>
{switch (route) {
| Unit(_, _) => React.null
| Demo(_, _)
| Demo(_)
| Home =>
<DemoListSidebar
demos
Expand All @@ -1082,7 +1071,7 @@ module App = {
->(Option.map(demoUnit => <DemoUnit demoUnit />))
->(Option.getWithDefault("Demo not found"->React.string))}
</div>;
| Demo(queryString, demoName) =>
| Demo(demoName) =>
let demoUnit =
Demos.findDemo(urlSearchParams, demoName, demos)
->(
Expand All @@ -1109,7 +1098,6 @@ module App = {
<div name="Demo" style=Styles.demo>
<div style=Styles.demoContents>
<DemoUnitFrame
queryString
responsiveMode
onLoad={iframeWindow => {
setLoadedIframeWindow(_ => Some(iframeWindow))
Expand Down

0 comments on commit 10ef9d2

Please sign in to comment.