Skip to content
Permalink
Browse files

Extracting a repeated responsive grid pattern.

  • Loading branch information...
krisajenkins committed Apr 11, 2019
1 parent b0e75bb commit e90befca24520887d0f6dc7cbbc5f72de82e4784
@@ -2,7 +2,7 @@ module Action
( simulationPane
) where

import Bootstrap (badge, badgePrimary, btn, btnDanger, btnGroup, btnGroupSmall, btnInfo, btnLink, btnPrimary, btnSecondary, btnSuccess, btnWarning, card, cardBody_, col10_, col12, col2_, colMd4, colSm6, col_, formControl, formGroup_, invalidFeedback_, nbsp, pullRight, row, row_, validFeedback_, wasValidated)
import Bootstrap (badge, badgePrimary, btn, btnDanger, btnGroup, btnGroupSmall, btnInfo, btnLink, btnPrimary, btnSecondary, btnSuccess, btnWarning, card, cardBody_, col10_, col2_, col_, formControl, formGroup_, invalidFeedback_, nbsp, pullRight, responsiveThird, row, row_, validFeedback_, wasValidated)
import Control.Monad.Aff.Class (class MonadAff)
import Cursor (Cursor, current)
import Cursor as Cursor
@@ -135,7 +135,7 @@ actionsPane isValidWallet actions evaluationResult =
actionPane :: forall p. (Wallet -> Boolean) -> Int -> Action -> Tuple String (HTML p Query)
actionPane isValidWallet index action =
Tuple (show index) $
div [ classes [ col12, colSm6, colMd4 ] ]
responsiveThird
[ div [ classes [ ClassName "action"
, ClassName ("action-" <> show index)
, ClassName ("action-" <> (case isValidWallet <$> (preview (_Action <<< _simulatorWallet <<< _simulatorWalletWallet) action) of
@@ -313,7 +313,7 @@ validationFeedback errors =
addWaitActionPane :: forall p. Tuple String (HTML p Query)
addWaitActionPane =
Tuple "add-wait" $
div [ classes [ col12, colSm6, colMd4 ] ]
responsiveThird
[ div
[ class_ $ ClassName "add-wait-action" ]
[ div [ class_ card
@@ -2,7 +2,7 @@ module Wallet where

import Types

import Bootstrap (btn, btnSecondary, btnSmall, card, cardBody_, cardTitle_, card_, col12, colMd4, colSm6, pullRight, row)
import Bootstrap (btn, btnSecondary, btnSmall, card, cardBody_, cardTitle_, card_, pullRight, responsiveThird, row)
import Data.Array (mapWithIndex)
import Data.Array as Array
import Data.Lens (view)
@@ -51,7 +51,7 @@ walletPane
})
=
Tuple (show walletIndex) $
div [ classes [ col12, colSm6, colMd4 ] ]
responsiveThird
[ div [ classes [ ClassName "wallet", ClassName ("wallet-" <> show walletIndex) ] ]
[ card_
[ cardBody_
@@ -75,7 +75,7 @@ walletPane
addWalletPane :: forall p. Tuple String (HTML p Query)
addWalletPane =
Tuple "add-wallet" $
div [ classes [ col12, colSm6, colMd4 ] ]
responsiveThird
[ div
[ class_ $ ClassName "add-wallet" ]
[ div [ class_ card
@@ -366,3 +366,9 @@ navLink = ClassName "nav-link"

hidden :: ClassName
hidden = ClassName "d-none"

-- | A third of the screen, assuming a reasonable screen
-- size. Collapses sensibly as the size goes down to iPhone.
responsiveThird :: forall p i. Array (HTML p i) -> HTML p i
responsiveThird =
div [ classes [ col12, colSm6, colMd4 ] ]

0 comments on commit e90befc

Please sign in to comment.
You can’t perform that action at this time.