@@ -21,8 +21,9 @@ import Cardano.Wallet.UI.Common.Html.Lib
21
21
import Cardano.Wallet.UI.Common.Html.Pages.Lib
22
22
( copyButton
23
23
)
24
- import Control.Monad
25
- ( when
24
+ import Cardano.Wallet.UI.Type
25
+ ( WHtml
26
+ , onShelley
26
27
)
27
28
import Data.Text
28
29
( Text
@@ -60,7 +61,7 @@ mnemonicH (Just mnemonic) = do
60
61
$ T. intercalate " " mnemonic
61
62
copyButton " copy-mnemonic"
62
63
63
- newWalletH :: (Maybe Bool -> Link ) -> PostWalletConfig -> Html ()
64
+ newWalletH :: (Maybe Bool -> Link ) -> PostWalletConfig -> WHtml ()
64
65
newWalletH walletMnemonicLink config = do
65
66
useHtmxExtension " json-enc"
66
67
div_ [class_ " btn-group mb-3" , role_ " group" ] $ do
@@ -88,11 +89,10 @@ newWalletH walletMnemonicLink config = do
88
89
89
90
data PostWalletConfig = PostWalletConfig
90
91
{ passwordVisibility :: Maybe Visible
91
- , namePresence :: Bool
92
92
, walletDataLink :: Link
93
93
}
94
94
95
- postWalletForm :: PostWalletConfig -> Html ()
95
+ postWalletForm :: PostWalletConfig -> WHtml ()
96
96
postWalletForm PostWalletConfig {.. } = form_
97
97
[ hxPost_ $ linkText walletDataLink
98
98
, hxExt_ " json-enc"
@@ -106,19 +106,20 @@ postWalletForm PostWalletConfig{..} = form_
106
106
, name_ " mnemonicSentence"
107
107
, placeholder_ " Mnemonic Sentence"
108
108
]
109
- when namePresence $
110
- input_
109
+ onShelley
110
+ $ input_
111
111
[ class_ " form-control form-control-lg mb-3"
112
112
, type_ " text"
113
113
, name_ " name"
114
114
, placeholder_ " Wallet Name"
115
115
]
116
- input_
117
- [ class_ " form-control form-control-lg mb-3"
118
- , visibility
119
- , name_ " passphrase"
120
- , placeholder_ " Passphrase"
121
- ]
116
+ onShelley
117
+ $ input_
118
+ [ class_ " form-control form-control-lg mb-3"
119
+ , visibility
120
+ , name_ " passphrase"
121
+ , placeholder_ " Passphrase"
122
+ ]
122
123
button_
123
124
[ class_ " btn btn-primary btn-block mb-3"
124
125
, type_ " submit"
0 commit comments