Skip to content

Commit

Permalink
string interpolation issue solved
Browse files Browse the repository at this point in the history
using className utility
  • Loading branch information
r-nikhilkumar committed May 10, 2024
1 parent ab0f74e commit 82aeb19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Components/CriticalCareRecording/components/Slider.res
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ let make = (
let (text, setText) = React.useState(() => "Normal")
let (precision, setPrecision) = React.useState(() => 1)
let (displayValue, setDisplayValue) = React.useState(() => value)
let justifyContentClassName = title != "" ? "justify-between" : "justify-center"
let alignItemClassName = title != "" ? "items-end" : "items-center"

React.useEffect1(() => {
let (text, color) = getLabel(value->Belt.Float.fromString->Belt.Option.getWithDefault(0.0))
Expand Down Expand Up @@ -76,11 +78,11 @@ let make = (

<>
<section className={"slider-box " ++ className}>
<div className=`slider-head flex ${title != "" ? "justify-between" : "justify-center"} flex-col sm:flex-row sm:items-center`>
<div className={"slider-head flex flex-col sm:flex-row sm:items-center " ++ justifyContentClassName}>
<div className="flex items-center">
<h1 className="m-2"> {title->str} </h1> titleNeighbour
</div>
<div className=`flex flex-col ${title != "" ? "items-end" : "items-center"} mt-2 sm:mt-0`>
<div className={"flex flex-col mt-2 sm:mt-0 " ++ alignItemClassName}>
<label htmlFor="measure" style={ReactDOM.Style.make(~color=textColor, ())}>
{switch value->Belt.Float.fromString {
| Some(_) => text->str
Expand Down

0 comments on commit 82aeb19

Please sign in to comment.