Skip to content

Commit 497b032

Browse files
committed
wip
1 parent 660107f commit 497b032

File tree

2 files changed

+26
-17
lines changed
  • ghcjs
    • delivery-calculator/src/App/Widgets
    • miso-functora/src/Functora/Miso/Widgets

2 files changed

+26
-17
lines changed

ghcjs/delivery-calculator/src/App/Widgets/Asset.hs

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,25 @@ assetsViewer st = do
1717

1818
assetViewer :: Model -> Int -> [View Action]
1919
assetViewer st idx =
20-
[ h1_
21-
mempty
22-
[ text title,
23-
button_
24-
[ onClick
25-
. PushUpdate
26-
. Instant
27-
. PureUpdate
28-
$ cloneTraversal modalOptic
29-
.~ Opened
30-
]
31-
[ text "settings"
32-
]
33-
]
20+
[ fieldset_ mempty
21+
$ [ legend_
22+
mempty
23+
[ text title,
24+
text " ",
25+
button_
26+
[ onClick
27+
. PushUpdate
28+
. Instant
29+
. PureUpdate
30+
$ cloneTraversal modalOptic
31+
.~ Opened
32+
]
33+
[ icon Icon.IconEdit,
34+
text " Edit"
35+
]
36+
]
37+
]
38+
<> FieldPairs.fieldPairsViewer args
3439
]
3540
<> ( Dialog.dialog
3641
( Dialog.defOpts @Model @Action
@@ -39,7 +44,8 @@ assetViewer st idx =
3944
& #optsFooterRight
4045
.~ const
4146
[ button_
42-
[ onClick
47+
[ type_ "reset",
48+
onClick
4349
. PushUpdate
4450
. Instant
4551
$ Jsm.removeAt
@@ -51,7 +57,8 @@ assetViewer st idx =
5157
text " Remove"
5258
],
5359
button_
54-
[ onClick closeAction
60+
[ type_ "submit",
61+
onClick closeAction
5562
]
5663
[ icon Icon.IconSave,
5764
text " Save"
@@ -70,7 +77,6 @@ assetViewer st idx =
7077
.~ False
7178
}
7279
)
73-
<> FieldPairs.fieldPairsViewer args
7480
where
7581
args =
7682
FieldPairs.Args

ghcjs/miso-functora/src/Functora/Miso/Widgets/Icon.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ data Icon
2929
| IconTelegram
3030
| IconDelete
3131
| IconSave
32+
| IconEdit
3233
deriving stock (Eq, Ord, Show, Read, Data, Generic, Enum, Bounded)
3334

3435
class (From Icon a) => IsIcon a where
@@ -55,6 +56,7 @@ data Fa
5556
| FaTelegram
5657
| FaTrash
5758
| FaFloppyDisk
59+
| FaPenToSquare
5860
deriving stock (Eq, Ord, Show, Read, Data, Generic, Enum, Bounded)
5961

6062
instance From Icon Fa where
@@ -79,6 +81,7 @@ instance From Icon Fa where
7981
IconTelegram -> FaTelegram
8082
IconDelete -> FaTrash
8183
IconSave -> FaFloppyDisk
84+
IconEdit -> FaPenToSquare
8285

8386
instance IsIcon Fa where
8487
icon x =

0 commit comments

Comments
 (0)