@@ -25,7 +25,7 @@ module DropdownSelect = {
25
25
let opacity = disabled ? " opacity-50" : "" ;
26
26
<select
27
27
className= {
28
- "border border-night-light inline-block rounded px-4 py-1 bg-onyx appearance-none font-semibold "
28
+ "border border-night-light inline-block rounded px-4 py-1 bg-gray-100 appearance-none font-semibold "
29
29
++ opacity
30
30
}
31
31
name
@@ -114,7 +114,7 @@ module Pane = {
114
114
let defaultMakeTabClass = (active: bool ): string => {
115
115
let rest =
116
116
active
117
- ? "text-fire font-medium bg-onyx hover:cursor-default"
117
+ ? "text-fire font-medium bg-gray-100 hover:cursor-default"
118
118
: "hover:cursor-pointer" ;
119
119
120
120
"flex items-center h-12 px-4 pr-24 " ++ rest;
@@ -181,7 +181,7 @@ module Pane = {
181
181
Belt . Array . mapWithIndex(
182
182
tabs,
183
183
(i, tab) => {
184
- let className = current === i ? "block" : "hidden" ;
184
+ let className = current === i ? "block h-full " : "hidden" ;
185
185
186
186
<div key= {Belt . Int . toString(i)} className> {tab. content} </div >;
187
187
},
@@ -435,7 +435,7 @@ module ResultPane = {
435
435
| Comp (Success ({warnings, time})) =>
436
436
if (Array . length(warnings) === 0 ) {
437
437
let ms = Belt . Float . toInt(time)-> Belt . Int . toString ++ " ms" ;
438
- <PreWrap > {( "0 Errors, 0 Warnings, built in " ++ ms) -> s} </PreWrap >;
438
+ <PreWrap > "0 Errors, 0 Warnings" -> s </PreWrap >;
439
439
} else {
440
440
filterHighlightedLocWarnings(~focusedRowCol, warnings)
441
441
-> Belt . Array . mapWithIndex((i, warning) => {
@@ -1081,7 +1081,7 @@ module MiscPanel = {
1081
1081
Belt . Option . map(suggestions, elements => {
1082
1082
<div
1083
1083
ref= {ReactDOMRe . Ref . domRef(listboxRef)}
1084
- className= "p-2 absolute overflow-auto z-50 border-b rounded border-l border-r block w-full bg-onyx "
1084
+ className= "p-2 absolute overflow-auto z-50 border-b rounded border-l border-r block w-full bg-gray-100 "
1085
1085
style= {ReactDOMRe . Style . make(~maxHeight= "15rem" , () )}>
1086
1086
elements
1087
1087
</div >
@@ -1300,7 +1300,7 @@ module ControlPanel = {
1300
1300
| None => None
1301
1301
};
1302
1302
1303
- <div className= "flex bg-onyx text-night-light px-6 text-14 w-full" >
1303
+ <div className= "flex bg-gray-100 text-night-light px-6 text-14 w-full" >
1304
1304
<div
1305
1305
className= "flex justify-between items-center border-t py-4 border-night-60 w-full" >
1306
1306
<div >
@@ -1468,10 +1468,10 @@ module OutputPanel = {
1468
1468
style= {ReactDOMRe . Style . make(~height= "calc(100vh - 9rem)" , () )}>
1469
1469
resultPane
1470
1470
codeElement
1471
- <div className= "absolute bottom-0 w-full" >
1472
- <Statusbar actionIndicatorKey state= compilerState />
1473
- </div >
1474
1471
</div >;
1472
+ /* <div className="absolute bottom-0 w-full">*/
1473
+ /* <Statusbar actionIndicatorKey state=compilerState />*/
1474
+ /* </div>*/
1475
1475
/* resultPane*/
1476
1476
1477
1477
let errorPane =
@@ -1560,6 +1560,8 @@ let default = () => {
1560
1560
1561
1561
let overlayState = React . useState(() => false );
1562
1562
1563
+ let windowWidth = CodeMirror2 . useWindowWidth() ;
1564
+
1563
1565
// The user can focus an error / warning on a specific line & column
1564
1566
// which is stored in this ref and triggered by hover / click states
1565
1567
// in the CodeMirror editor
@@ -1781,91 +1783,89 @@ module Button3 = {
1781
1783
title= "ReScript Playground"
1782
1784
description= "Try ReScript in the browser"
1783
1785
/>
1784
- <div className= "text-16 pt-2 bg-night-dark" >
1786
+ <Next . Head >
1787
+ <style > { j | body { background-color: #010427; } | j } -> s </style >
1788
+ </Next . Head >
1789
+ <div className= "text-16 bg-gray-100" >
1785
1790
<div className= "text-night text-14" >
1786
1791
<Navigation fixed= false overlayState />
1787
- /* MOBILE PLACEHOLDER */
1788
- <div className= "block lg:hidden h-screen text-snow-darker text-center" >
1789
- <div className= "font-bold mb-4" >
1790
- "Mobile Playground version not available yet." -> s
1791
- </div >
1792
- <div >
1793
- "Please use a screen with at least 1024px width for the desktop version"
1794
- -> s
1795
- </div >
1796
- </div >
1797
- /* DESKTOP */
1798
1792
<main
1799
- className= "hidden lg:block mt-4 bg-onyx overflow-hidden h-screen"
1800
- style= {ReactDOMRe . Style . make(~maxHeight= "calc(100vh - 6rem)" , () )}>
1801
- <div className= "flex justify-center" >
1802
- <div className= "w-full flex border-t-4 border-night" >
1803
- <div
1804
- className= "w-full border-r-4 pl-2 border-night"
1805
- style= {ReactDOMRe . Style . make(~maxWidth= "65% " , () )}>
1806
- <div className= "bg-onyx text-snow-darker" >
1807
- <CodeMirror2
1808
- className= "w-full pb-4"
1809
- minHeight= "calc(100vh - 10.5rem)"
1810
- maxHeight= "calc(100vh - 10.5rem)"
1811
- mode= "reason"
1812
- errors= cmErrors
1813
- value= {React . Ref . current(editorCode)}
1814
- onChange= {value => {
1815
- React . Ref . setCurrent(editorCode, value);
1816
-
1817
- switch (React . Ref . current(typingTimer)) {
1818
- | None => ()
1819
- | Some (timer ) => Js . Global . clearTimeout(timer)
1820
- };
1821
- let timer =
1822
- Js . Global . setTimeout(
1823
- () => {
1824
- (React . Ref . current(timeoutCompile))() ;
1825
- React . Ref . setCurrent(typingTimer, None );
1826
- },
1827
- 100 ,
1828
- );
1829
- React . Ref . setCurrent(typingTimer, Some (timer));
1830
- }}
1831
- onMarkerFocus= {rowCol => {
1832
- setFocusedRowCol(prev => {Some (rowCol)})
1833
- }}
1834
- onMarkerFocusLeave= {_ => {setFocusedRowCol(_ => None )}}
1835
- />
1836
- </div >
1793
+ className= "bg-gray-100 lg:overflow-hidden lg:h-screen"
1794
+ style= {ReactDOMRe . Style . make(~maxHeight= "calc(100vh - 4.5rem)" , () )}>
1795
+ <div
1796
+ className= "w-full h-full flex flex-col lg:flex-row border-t-4 border-night" >
1797
+ <div className= "w-full lg:border-r-4 pl-2 border-night" >
1798
+ <div className= "bg-gray-100 text-snow-darker" >
1799
+ <CodeMirror2
1800
+ className= "w-full py-4"
1801
+ minHeight= "calc(100vh - 6rem)"
1802
+ maxHeight= "calc(100vh - 6rem)"
1803
+ mode= "reason"
1804
+ errors= cmErrors
1805
+ value= {React . Ref . current(editorCode)}
1806
+ onChange= {value => {
1807
+ React . Ref . setCurrent(editorCode, value);
1808
+
1809
+ switch (React . Ref . current(typingTimer)) {
1810
+ | None => ()
1811
+ | Some (timer ) => Js . Global . clearTimeout(timer)
1812
+ };
1813
+ let timer =
1814
+ Js . Global . setTimeout(
1815
+ () => {
1816
+ (React . Ref . current(timeoutCompile))() ;
1817
+ React . Ref . setCurrent(typingTimer, None );
1818
+ },
1819
+ 100 ,
1820
+ );
1821
+ React . Ref . setCurrent(typingTimer, Some (timer));
1822
+ }}
1823
+ onMarkerFocus= {rowCol => {
1824
+ setFocusedRowCol(prev => {Some (rowCol)})
1825
+ }}
1826
+ onMarkerFocusLeave= {_ => {setFocusedRowCol(_ => None )}}
1827
+ />
1837
1828
</div >
1838
- <div
1839
- className= "w-1/2"
1840
- style= {ReactDOMRe . Style . make(~maxWidth= "56rem" , () )}>
1841
- <OutputPanel
1829
+ </div >
1830
+ <div
1831
+ className= "relative w-full overflow-x-hidden h-screen lg:h-auto lg:w-1/2"
1832
+ style= {ReactDOMRe . Style . make(
1833
+ ~maxWidth= windowWidth > 1024 ? "56rem" : "100% " ,
1834
+ () ,
1835
+ )}>
1836
+ <OutputPanel
1837
+ actionIndicatorKey= {Belt . Int . toString(actionCount)}
1838
+ compilerDispatch
1839
+ compilerState
1840
+ />
1841
+ <div className= "absolute bottom-0 w-full" >
1842
+ <Statusbar
1842
1843
actionIndicatorKey= {Belt . Int . toString(actionCount)}
1843
- compilerDispatch
1844
- compilerState
1844
+ state= compilerState
1845
1845
/>
1846
- {switch (compilerState) {
1847
- | Ready (ready )
1848
- | Compiling (ready , _ )
1849
- | SwitchingCompiler (ready , _ , _ ) =>
1850
- let disabled =
1851
- switch (compilerState) {
1852
- | SwitchingCompiler (_ , _ , _ ) => true
1853
- | _ => false
1854
- };
1855
- let config = ready. selected. config;
1856
- let setConfig = config => {
1857
- compilerDispatch(UpdateConfig (config));
1858
- };
1859
-
1860
- <div />;
1861
- /* <MiscPanel*/
1862
- /* disabled*/
1863
- /* className="border-t-4 border-night"*/
1864
- /* />;*/
1865
- | Init
1866
- | SetupFailed (_ ) => React . null
1867
- }}
1868
1846
</div >
1847
+ {switch (compilerState) {
1848
+ | Ready (ready )
1849
+ | Compiling (ready , _ )
1850
+ | SwitchingCompiler (ready , _ , _ ) =>
1851
+ let disabled =
1852
+ switch (compilerState) {
1853
+ | SwitchingCompiler (_ , _ , _ ) => true
1854
+ | _ => false
1855
+ };
1856
+ let config = ready. selected. config;
1857
+ let setConfig = config => {
1858
+ compilerDispatch(UpdateConfig (config));
1859
+ };
1860
+
1861
+ <div />;
1862
+ /* <MiscPanel*/
1863
+ /* disabled*/
1864
+ /* className="border-t-4 border-night"*/
1865
+ /* />;*/
1866
+ | Init
1867
+ | SetupFailed (_ ) => React . null
1868
+ }}
1869
1869
</div >
1870
1870
</div >
1871
1871
</main >
0 commit comments