Skip to content

Commit

Permalink
more css fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shmish111 committed Jul 6, 2020
1 parent 19f2d03 commit a818cd9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 37 deletions.
44 changes: 26 additions & 18 deletions marlowe-playground-client/src/Simulation.purs
Expand Up @@ -40,7 +40,7 @@ import Halogen as H
import Halogen.Analytics (handleActionWithAnalyticsTracking)
import Halogen.Classes (aHorizontal, active, activeClasses, blocklyIcon, bold, closeDrawerIcon, codeEditor, expanded, infoIcon, jFlexStart, minusBtn, noMargins, panelSubHeader, panelSubHeaderMain, panelSubHeaderSide, plusBtn, pointer, sidebarComposer, smallBtn, spaceLeft, spanText, textSecondaryColor, uppercase)
import Halogen.Classes as Classes
import Halogen.HTML (ClassName(..), ComponentHTML, HTML, a, article, aside, b_, button, div, em_, h2, h6, h6_, img, input, label, li, li_, option, p, p_, section, select, slot, small, small_, span, strong_, text, ul, ul_)
import Halogen.HTML (ClassName(..), ComponentHTML, HTML, a, article, aside, b_, br_, button, div, em_, h2, h6, h6_, img, input, label, li, li_, option, p, p_, section, select, slot, small, small_, span, strong_, text, ul, ul_)
import Halogen.HTML.Events (onClick, onSelectedIndexChange, onValueChange, onValueInput)
import Halogen.HTML.Properties (InputType(..), alt, class_, classes, disabled, enabled, href, placeholder, src, type_, value)
import Halogen.HTML.Properties as HTML
Expand Down Expand Up @@ -606,24 +606,32 @@ inputItem isEnabled person (DepositInput accountId party token value) =
inputItem isEnabled person (ChoiceInput choiceId@(ChoiceId choiceName choiceOwner) bounds chosenNum) =
div
[ classes [ aHorizontal, ClassName "flex-wrap" ] ]
[ div []
[ p [ class_ (ClassName "choice-input") ]
[ spanText "Choice "
, b_ [ spanText (show choiceName) ]
, spanText ": Choose value "
, marloweActionInput isEnabled (SetChoice choiceId) chosenNum
]
, p [ class_ (ClassName "choice-error") ] error
]
, button
[ classes [ plusBtn, smallBtn, (Classes.disabled $ not isEnabled) ]
, enabled (isEnabled && inBounds chosenNum bounds)
, onClick $ const $ Just
$ AddInput (Just person) (IChoice (ChoiceId choiceName choiceOwner) chosenNum) bounds
]
[ text "+" ]
]
( [ div []
[ p [ class_ (ClassName "choice-input") ]
[ spanText "Choice "
, b_ [ spanText (show choiceName <> ":") ]
, br_
, spanText "Choose value "
, marloweActionInput isEnabled (SetChoice choiceId) chosenNum
]
, p [ class_ (ClassName "choice-error") ] error
]
]
<> addButton
)
where
addButton =
if isEnabled && inBounds chosenNum bounds then
[ button
[ classes [ plusBtn, smallBtn ]
, onClick $ const $ Just
$ AddInput (Just person) (IChoice (ChoiceId choiceName choiceOwner) chosenNum) bounds
]
[ text "+" ]
]
else
[]

error = if inBounds chosenNum bounds then [] else [ text boundsError ]

boundsError = "Choice must be between " <> intercalate " or " (map boundError bounds)
Expand Down
44 changes: 26 additions & 18 deletions marlowe-playground-client/src/Wallet.purs
Expand Up @@ -40,7 +40,7 @@ import Halogen as H
import Halogen.Analytics (handleActionWithAnalyticsTracking)
import Halogen.Classes (aHorizontal, active, bold, closeDrawerIcon, expanded, first, infoIcon, jFlexStart, minusBtn, noMargins, panelSubHeader, panelSubHeaderMain, panelSubHeaderSide, plusBtn, pointer, rTable, rTable4cols, rTableCell, rTableDataRow, rTableEmptyRow, sidebarComposer, smallBtn, spaceLeft, spanText, textSecondaryColor, uppercase)
import Halogen.Classes as Classes
import Halogen.HTML (HTML, a, article, aside, b_, button, div, h6, hr_, img, input, li, option, p, p_, section, select, small, small_, strong_, text, ul)
import Halogen.HTML (HTML, a, article, aside, b_, br_, button, div, h6, hr_, img, input, li, option, p, p_, section, select, small, small_, strong_, text, ul)
import Halogen.HTML (code_, span) as HTML
import Halogen.HTML.Elements.Keyed as Keyed
import Halogen.HTML.Events (onClick, onValueChange)
Expand Down Expand Up @@ -1115,24 +1115,32 @@ inputItem isEnabled person (DepositInput accountId party token value) =
inputItem isEnabled person (ChoiceInput choiceId@(ChoiceId choiceName choiceOwner) bounds chosenNum) =
li
[ classes [ aHorizontal, ClassName "flex-wrap", ClassName "choice-row" ] ]
[ div []
[ p [ class_ (ClassName "choice-input") ]
[ spanText "Choice "
, b_ [ spanText (show choiceName) ]
, spanText ": Choose value "
, marloweActionInput isEnabled (SetChoice choiceId) chosenNum
]
, p [ class_ (ClassName "choice-error") ] error
]
, button
[ classes [ plusBtn, smallBtn, if (isEnabled && inBounds chosenNum bounds) then (ClassName mempty) else Classes.hide ]
, enabled (isEnabled && inBounds chosenNum bounds)
, onClick $ const $ Just
$ AddInput (Just person) (IChoice (ChoiceId choiceName choiceOwner) chosenNum) bounds
]
[ text "+" ]
]
( [ div []
[ p [ class_ (ClassName "choice-input") ]
[ spanText "Choice "
, b_ [ spanText (show choiceName <> ":") ]
, br_
, spanText "Choose value "
, marloweActionInput isEnabled (SetChoice choiceId) chosenNum
]
, p [ class_ (ClassName "choice-error") ] error
]
]
<> addButton
)
where
addButton =
if isEnabled && inBounds chosenNum bounds then
[ button
[ classes [ plusBtn, smallBtn ]
, onClick $ const $ Just
$ AddInput (Just person) (IChoice (ChoiceId choiceName choiceOwner) chosenNum) bounds
]
[ text "+" ]
]
else
[]

error = if inBounds chosenNum bounds then [] else [ text boundsError ]

boundsError = "Choice must be between " <> intercalate " or " (map boundError bounds)
Expand Down
6 changes: 5 additions & 1 deletion marlowe-playground-client/static/css/panels.css
Expand Up @@ -305,8 +305,12 @@ button.minus-btn:hover {
height: 100%;
}

.footer-panel-bg .panel-header {
height: 25%;
}

.expanded>.panel-contents {
height: 100%;
height: 70%;
max-height: 70vh;
overflow-x: scroll;
display: block;
Expand Down

0 comments on commit a818cd9

Please sign in to comment.