Skip to content

Commit 8553e6b

Browse files
committed
Improve styles for warnings flags input
1 parent 9760eda commit 8553e6b

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

src/Playground.res

+20-14
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,9 @@ module WarningFlagsWidget = {
697697
})
698698
->React.array
699699
->Some
700-
| Typing(typing) =>
700+
| Typing(typing) if typing.suggestion != NoSuggestion =>
701701
let suggestions = switch typing.suggestion {
702-
| NoSuggestion => React.string("Type + / - followed by a number or letter (e.g. +a+1)")
702+
| NoSuggestion => React.null
703703
| ErrorSuggestion(msg) => React.string(msg)
704704
| FuzzySuggestions({precedingTokens, selected, results, modifier}) =>
705705
Array.mapWithIndex(results, ((flag, desc), i) => {
@@ -753,7 +753,8 @@ module WarningFlagsWidget = {
753753
})->React.array
754754
}
755755
Some(suggestions)
756-
| HideSuggestion(_) => None
756+
757+
| Typing(_) | HideSuggestion(_) => None
757758
}
758759

759760
let suggestionBox =
@@ -829,17 +830,22 @@ module WarningFlagsWidget = {
829830
<div className={"flex justify-between border p-2 " ++ activeClass}>
830831
<div>
831832
chips
832-
<input
833-
ref={ReactDOM.Ref.domRef(inputRef)}
834-
className="outline-none bg-gray-90 placeholder-gray-20 placeholder-opacity-50"
835-
placeholder="Flags"
836-
type_="text"
837-
tabIndex=0
838-
value=inputValue
839-
onChange
840-
onFocus
841-
onBlur
842-
/>
833+
<section className="mt-3">
834+
<input
835+
ref={ReactDOM.Ref.domRef(inputRef)}
836+
className="inline-block p-1 max-w-20 outline-none bg-gray-90 placeholder-gray-20 placeholder-opacity-50"
837+
placeholder="Flags"
838+
type_="text"
839+
tabIndex=0
840+
value=inputValue
841+
onChange
842+
onFocus
843+
onBlur
844+
/>
845+
<p className="mt-1 text-12">
846+
{React.string("Type + / - followed by a number or letter (e.g. +a+1)")}
847+
</p>
848+
</section>
843849
</div>
844850
deleteButton
845851
</div>

0 commit comments

Comments
 (0)