@@ -328,82 +328,133 @@ defFavName st =
328
328
. to toMisoString
329
329
330
330
linksWidget :: Model -> [View Action ]
331
- linksWidget _ =
332
- [ Cell. mediumCell
331
+ linksWidget st =
332
+ [ Cell. bigCell
333
333
$ Button. raised
334
334
( Button. config
335
- & Button. setOnClick
336
- ( open
337
- " https://groups.google.com/g/currency-converter"
338
- )
335
+ & Button. setOnClick openWidget
339
336
& Button. setIcon (Just " android" )
340
337
& Button. setAttributes [class_ " fill" ]
341
338
)
342
- " Join testing (closed beta)" ,
343
- Cell. mediumCell
344
- $ Button. raised
345
- ( Button. config
346
- & Button. setOnClick
347
- ( open
348
- " https://play.google.com/apps/testing/com.functora.currency_converter"
349
- )
350
- & Button. setIcon (Just " android" )
351
- & Button. setAttributes [class_ " fill" ]
352
- )
353
- " Google Play (closed beta)" ,
354
- Cell. mediumCell
355
- $ Button. raised
356
- ( Button. config
357
- & Button. setOnClick
358
- ( open
359
- $ " https://github.com/functora/functora.github.io/releases/download/currency-converter-v"
360
- <> fromMisoString vsn
361
- <> " /currency-converter-v"
362
- <> fromMisoString vsn
363
- <> " .apk"
364
- )
365
- & Button. setIcon (Just " download" )
366
- & Button. setAttributes [class_ " fill" ]
367
- )
368
- " Download APK" ,
369
- Cell. mediumCell
370
- $ Button. raised
371
- ( Button. config
372
- & Button. setOnClick
373
- ( open
374
- " https://github.com/functora/functora.github.io/tree/master/ghcjs/currency-converter"
375
- )
376
- & Button. setIcon (Just " code" )
377
- & Button. setAttributes [class_ " fill" ]
378
- )
379
- " Source" ,
380
- Cell. mediumCell
381
- $ Button. raised
382
- ( Button. config
383
- & Button. setOnClick (open " https://functora.github.io/" )
384
- & Button. setIcon (Just " person" )
385
- & Button. setAttributes [class_ " fill" ]
386
- )
387
- " Author" ,
388
- Cell. mediumCell
389
- $ Button. raised
390
- ( Button. config
391
- & Button. setOnClick
392
- ( PushUpdate $ do
393
- doc <- liftIO Templates. newDonateDoc
394
- pure
395
- . ChanItem 0
396
- $ (& # modelMenu .~ Closed )
397
- . (& # modelLoading .~ True )
398
- . (& # modelState . # stDoc .~ doc)
399
- )
400
- & Button. setIcon (Just " volunteer_activism" )
401
- & Button. setAttributes [class_ " fill" ]
402
- )
403
- " Donate"
339
+ " App"
404
340
]
341
+ <> ( if st ^. # modelLinks == Closed
342
+ then mempty
343
+ else
344
+ [ Dialog. dialog
345
+ ( Dialog. config
346
+ & Dialog. setOnClose closeWidget
347
+ & Dialog. setOpen (Opened == st ^. # modelLinks)
348
+ )
349
+ ( Dialog. dialogContent
350
+ Nothing
351
+ [ Cell. grid
352
+ mempty
353
+ [ Cell. bigCell
354
+ $ span_
355
+ mempty
356
+ [ text
357
+ " The Android app is in closed beta. To install it, join the " ,
358
+ Misc. browserLink testGroupLink " closed beta group" ,
359
+ text " and then install the app from " ,
360
+ Misc. browserLink googlePlayLink " Google Play" ,
361
+ text " , or download the " ,
362
+ Misc. browserLink apkLink " APK file" ,
363
+ text " directly."
364
+ ],
365
+ Cell. mediumCell
366
+ $ Button. raised
367
+ ( Button. config
368
+ & Button. setIcon (Just " android" )
369
+ & Button. setOnClick (openBrowser testGroupLink)
370
+ & Button. setAttributes
371
+ [ Theme. secondaryBg,
372
+ class_ " fill"
373
+ ]
374
+ )
375
+ " Join testing (closed beta)" ,
376
+ Cell. mediumCell
377
+ $ Button. raised
378
+ ( Button. config
379
+ & Button. setIcon (Just " android" )
380
+ & Button. setOnClick (openBrowser googlePlayLink)
381
+ & Button. setAttributes
382
+ [ Theme. secondaryBg,
383
+ class_ " fill"
384
+ ]
385
+ )
386
+ " Google Play (closed beta)" ,
387
+ Cell. mediumCell
388
+ $ Button. raised
389
+ ( Button. config
390
+ & Button. setIcon (Just " download" )
391
+ & Button. setOnClick (openBrowser apkLink)
392
+ & Button. setAttributes
393
+ [ Theme. secondaryBg,
394
+ class_ " fill"
395
+ ]
396
+ )
397
+ " Download APK" ,
398
+ Cell. mediumCell
399
+ $ Button. raised
400
+ ( Button. config
401
+ & Button. setIcon (Just " code" )
402
+ & Button. setOnClick (openBrowser sourceLink)
403
+ & Button. setAttributes
404
+ [ Theme. secondaryBg,
405
+ class_ " fill"
406
+ ]
407
+ )
408
+ " Source" ,
409
+ Cell. mediumCell
410
+ $ Button. raised
411
+ ( Button. config
412
+ & Button. setIcon (Just " person" )
413
+ & Button. setOnClick (openBrowser functoraLink)
414
+ & Button. setAttributes
415
+ [ Theme. secondaryBg,
416
+ class_ " fill"
417
+ ]
418
+ )
419
+ " Author" ,
420
+ Cell. mediumCell
421
+ $ Button. raised
422
+ ( Button. config
423
+ & Button. setIcon (Just " volunteer_activism" )
424
+ & Button. setOnClick
425
+ ( PushUpdate $ do
426
+ doc <- liftIO Templates. newDonateDoc
427
+ pure
428
+ . ChanItem 0
429
+ $ (& # modelMenu .~ Closed )
430
+ . (& # modelLinks .~ Closed )
431
+ . (& # modelLoading .~ True )
432
+ . (& # modelState . # stDoc .~ doc)
433
+ )
434
+ & Button. setAttributes
435
+ [ Theme. secondaryBg,
436
+ class_ " fill"
437
+ ]
438
+ )
439
+ " Donate" ,
440
+ Cell. bigCell
441
+ $ Button. raised
442
+ ( Button. config
443
+ & Button. setOnClick closeWidget
444
+ & Button. setIcon (Just " arrow_back" )
445
+ & Button. setAttributes [class_ " fill" ]
446
+ )
447
+ " Back"
448
+ ]
449
+ ]
450
+ mempty
451
+ )
452
+ ]
453
+ )
405
454
where
406
- open =
455
+ openWidget = pureUpdate 0 (& # modelLinks .~ Opened )
456
+ closeWidget = pureUpdate 0 (& # modelLinks .~ Closed )
457
+ openBrowser =
407
458
Misc. openBrowserPageAction
408
459
. either impureThrow id
409
460
. URI. mkURI
0 commit comments