File tree Expand file tree Collapse file tree 14 files changed +71
-39
lines changed
miso-widgets/src/Functora/Miso Expand file tree Collapse file tree 14 files changed +71
-39
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ in rec {
41
41
text = ''
42
42
(
43
43
cd ${ repo }
44
- ${ functora-pkgs . nodejs } /bin/npm i
44
+ ${ functora-pkgs . nodejs } /bin/npm i --prefer-offline
45
45
${ functora-pkgs . nodejs } /bin/npm run build
46
46
nix-build -A releaseDer
47
47
rm -rf ./dist/latest
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ stQuery st = do
219
219
case st ^. # stIkm . # fieldOutput of
220
220
ikm | ikm == mempty -> Left (st ^. # stKm)
221
221
ikm -> Right $ (st ^. # stKm) & # kmIkm .~ Ikm (encodeUtf8 ikm)
222
- encodeText :: (MonadThrow m ) => BL. ByteString -> m Prelude. Text
222
+ encodeText :: (MonadThrow m ) => BL. ByteString -> m Text
223
223
encodeText =
224
224
either throw pure
225
225
. decodeUtf8Strict
@@ -302,7 +302,7 @@ googlePlayLink =
302
302
303
303
testGroupLink :: URI
304
304
testGroupLink =
305
- [URI. uri |https://groups.google.com/g/currency-converter |]
305
+ [URI. uri |https://groups.google.com/g/functora |]
306
306
307
307
functoraLink :: URI
308
308
functoraLink =
@@ -316,7 +316,7 @@ apkLink :: URI
316
316
apkLink =
317
317
either impureThrow id
318
318
. URI. mkURI
319
- . from @ Unicode @ Prelude. Text
319
+ . from @ Unicode @ Text
320
320
$ " https://github.com/functora/functora.github.io/releases/download/lightning-verifier-v"
321
321
<> vsn
322
322
<> " /lightning-verifier-v"
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ makeBolt11Viewer st =
122
122
rawR = st ^. # stDocLnPreimage . # fieldOutput
123
123
ln :: Either Unicode B11. Bolt11
124
124
ln =
125
- first (mappend " Bad invoice - " . from @ Prelude. String @ Unicode )
125
+ first (mappend " Bad invoice - " . from @ String @ Unicode )
126
126
. B11. decodeBolt11
127
127
$ from @ Unicode @ Prelude. Text rawLn
128
128
rh :: Either Unicode ByteString
@@ -169,7 +169,9 @@ verifyPreimage rh r =
169
169
170
170
invoiceFields :: B11. Bolt11 -> [FieldPair DynamicField Identity ]
171
171
invoiceFields ln =
172
- [ pair " Network"
172
+ [ pair " Invoice"
173
+ $ B11. bolt11Raw ln,
174
+ pair " Network"
173
175
$ case B11. bolt11HrpNet $ B11. bolt11Hrp ln of
174
176
B11. BitcoinMainnet -> " Bitcoin Mainnet"
175
177
B11. BitcoinTestnet -> " Bitcoin Testnet"
@@ -245,5 +247,6 @@ preimageFields rawR r =
245
247
pair " Preimage Hash"
246
248
. either impureThrow id
247
249
. decodeUtf8Strict @ Unicode @ ByteString
250
+ . B16. encode
248
251
$ sha256Hash r
249
252
]
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import qualified Functora.Miso.Widgets.Field as Field
13
13
import qualified Functora.Miso.Widgets.Grid as Grid
14
14
import qualified Material.Button as Button
15
15
import qualified Material.Dialog as Dialog
16
+ import qualified Material.Theme as Theme
16
17
17
18
fav :: Model -> [View Action ]
18
19
fav st =
@@ -132,7 +133,10 @@ favItem st label Fav {favUri = uri} =
132
133
[ Button. raised
133
134
( Button. config
134
135
& Button. setOnClick openAction
135
- & Button. setAttributes [Css. fullWidth]
136
+ & Button. setAttributes
137
+ [ Css. fullWidth,
138
+ Theme. secondaryBg
139
+ ]
136
140
)
137
141
label
138
142
]
Original file line number Diff line number Diff line change @@ -130,12 +130,24 @@ screenWidget st@Model {modelState = St {stScreen = Converter}} =
130
130
{ Field. optsFilledOrOutlined = Outlined ,
131
131
Field. optsPlaceholder = " Invoice" ,
132
132
Field. optsLeadingWidget =
133
- pasteWidget
134
- " content_paste_go"
135
- Jsm. selectClipboard
136
- $ # modelState
137
- . # stDoc
138
- . # stDocLnInvoice,
133
+ if null
134
+ ( st
135
+ ^. # modelState
136
+ . # stDoc
137
+ . # stDocLnInvoice
138
+ . # fieldInput
139
+ . # uniqueValue
140
+ )
141
+ then
142
+ pasteWidget
143
+ " content_paste_go"
144
+ Jsm. selectClipboard
145
+ $ # modelState
146
+ . # stDoc
147
+ . # stDocLnInvoice
148
+ else
149
+ Just
150
+ Field. ClearWidget ,
139
151
Field. optsTrailingWidget =
140
152
pasteWidget
141
153
" qr_code_scanner"
@@ -155,12 +167,24 @@ screenWidget st@Model {modelState = St {stScreen = Converter}} =
155
167
{ Field. optsFilledOrOutlined = Outlined ,
156
168
Field. optsPlaceholder = " Preimage" ,
157
169
Field. optsLeadingWidget =
158
- pasteWidget
159
- " content_paste_go"
160
- Jsm. selectClipboard
161
- $ # modelState
162
- . # stDoc
163
- . # stDocLnPreimage,
170
+ if null
171
+ ( st
172
+ ^. # modelState
173
+ . # stDoc
174
+ . # stDocLnPreimage
175
+ . # fieldInput
176
+ . # uniqueValue
177
+ )
178
+ then
179
+ pasteWidget
180
+ " content_paste_go"
181
+ Jsm. selectClipboard
182
+ $ # modelState
183
+ . # stDoc
184
+ . # stDocLnPreimage
185
+ else
186
+ Just
187
+ Field. ClearWidget ,
164
188
Field. optsTrailingWidget =
165
189
pasteWidget
166
190
" qr_code_scanner"
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import qualified Material.IconButton as IconButton
20
20
import qualified Material.Theme as Theme
21
21
import qualified Material.TopAppBar as TopAppBar
22
22
import qualified Text.URI as URI
23
- import qualified Prelude
24
23
25
24
menu :: Model -> [View Action ]
26
25
menu st =
@@ -109,7 +108,7 @@ menu st =
109
108
( PushUpdate
110
109
. Instant
111
110
. Jsm. shareText
112
- . from @ Prelude. String @ Unicode
111
+ . from @ String @ Unicode
113
112
. either impureThrow URI. renderStr
114
113
$ stUri st
115
114
)
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import qualified App.Widgets.Bolt11 as B11
9
9
import qualified Functora.Aes as Aes
10
10
import Functora.Cfg
11
11
import Functora.Miso.Prelude
12
- import qualified Prelude
13
12
14
13
newModel :: (MonadThrow m , MonadUnliftIO m ) => Maybe Model -> URI -> m Model
15
14
newModel mSt uri = do
@@ -64,7 +63,7 @@ newModel mSt uri = do
64
63
bDoc :: ByteString <-
65
64
maybe
66
65
( throwString
67
- @ Prelude. String
66
+ @ String
68
67
" Failed to decrypt the document!"
69
68
)
70
69
pure
Original file line number Diff line number Diff line change 43
43
. forever
44
44
. handleAny (\ e -> consoleLog e >> sleepSeconds 5 )
45
45
$ do
46
- uri <- URI. mkURI . Prelude. inspect =<< getCurrentURI
46
+ uri <- URI. mkURI . inspect =<< getCurrentURI
47
47
mSt <- unShareUri uri
48
48
st <- newModel Nothing uri
49
49
startApp
@@ -317,7 +317,7 @@ evalModel st@Model {modelState = st0} = do
317
317
318
318
syncUri :: URI -> JSM ()
319
319
syncUri uri = do
320
- textUri <- fmap Prelude. inspect getCurrentURI
320
+ textUri <- fmap inspect getCurrentURI
321
321
prevUri <- URI. mkURI textUri
322
322
let nextUri = prevUri {URI. uriQuery = URI. uriQuery uri}
323
323
when (nextUri /= prevUri)
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import qualified Data.ByteString.Lazy as BL
18
18
import Functora.Miso.Prelude
19
19
import qualified Language.Javascript.JSaddle as JS
20
20
import qualified Text.URI as URI
21
- import qualified Prelude
22
21
import qualified Prelude ((!!) )
23
22
24
23
popupText :: (Show a , Data a ) => a -> JSM ()
@@ -144,11 +143,11 @@ genericPromise fun marg after = do
144
143
raw <-
145
144
JS. fromJSVal @ Unicode val
146
145
res <-
147
- maybe (throwString @ Prelude. String " Failure, bad type!" ) pure raw
146
+ maybe (throwString @ String " Failure, bad type!" ) pure raw
148
147
after
149
148
$ Just res
150
149
_ ->
151
- throwString @ Prelude. String " Failure, bad argv!"
150
+ throwString @ String " Failure, bad argv!"
152
151
failure <-
153
152
JS. function $ \ _ _ e -> do
154
153
msg <- handleAny (\ _ -> pure " Unknown" ) $ JS. valToText e
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ import Functora.Cfg as X
8
8
import Functora.Miso.Orphan as X ()
9
9
import Functora.Prelude as X hiding
10
10
( Field (.. ),
11
- String ,
12
- Text ,
13
11
cons ,
14
12
field ,
15
13
)
You can’t perform that action at this time.
0 commit comments