Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2da2244

Browse files
author
Mike Solomon
committed
Switches back to main
1 parent56d0bf0 commit2da2244

File tree

2 files changed

+31
-37
lines changed

2 files changed

+31
-37
lines changed

‎packages.dhall‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ let overrides =
2222
}
2323

2424
in upstream// overrides
25-

‎src/Components/Article.purs‎

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import Data.Maybe (Maybe(..), fromMaybe, maybe)
1313
importData.Tuple.Nested ((/\))
1414
importDate (prettyDate)
1515
importDeku.Attribute ((:=))
16-
importDeku.Control (dyn_,text,text_)
17-
importDeku.Core (classKorok,Domable,insert_)
16+
importDeku.Control (ezDyn_,text,text_)
17+
importDeku.Core (classKorok,Domable)
1818
importDeku.DOMasD
19-
importDeku.Do (useMemoized,useRemoval,useState,useState')
19+
importDeku.Do (useMemoized,useState,useState')
2020
importDeku.DoasDeku
2121
importDeku.Listeners (click,injectElementT)
2222
importDeku.Pursx (nut, (~~))
@@ -274,37 +274,32 @@ articleLoaded
274274
, articleHeader: nut $D.h2_ [ text_ title ]
275275
, favoritesCount1: fCount
276276
, favoritesCount2: fCount
277-
, commentList: nut $ dyn_D.div
278-
( ({ cu: _, com: _ } <$> currentUser <*> (newComment <|> oneOfMap pure comments)) <#> \{ cu, com }->Deku.do
279-
setRemove /\ remove<- useRemoval
280-
let profile = pure (D.Href :="/#/profile/" <> com.author.username)
281-
let
282-
common =
283-
{ body: nut (text_ com.body)
284-
, imgsrc: pure (D.Src := com.author.image)
285-
, profile1: profile
286-
, profile2: profile
287-
, username: nut (text_ com.author.username)
288-
, date: nut (text_ (prettyDate com.updatedAt))
289-
}
290-
remove <|>
291-
( pure
292-
$ insert_
293-
$ maybe (theirComment_ ~~ common)
294-
( \u->do
295-
let
296-
deleteAction = click $ puredo
297-
launchAff_ $ deleteComment u.token slug com.id
298-
setRemove
299-
300-
myComment_ ~~ (common`union` { deleteAction })
301-
)
302-
(case cuof
303-
SignedIn u
304-
| u.username == com.author.username->Just u
305-
| otherwise->Nothing
306-
SignedOut->Nothing
307-
)
308-
)
309-
)
277+
, commentList: nut $ ezDyn_D.div $
278+
({ cu: _, com: _ } <$> currentUser <*> (newComment <|> oneOfMap pure comments)) <#> \{ cu, com } { remove }->do
279+
let profile = pure (D.Href :="/#/profile/" <> com.author.username)
280+
let
281+
common =
282+
{ body: nut (text_ com.body)
283+
, imgsrc: pure (D.Src := com.author.image)
284+
, profile1: profile
285+
, profile2: profile
286+
, username: nut (text_ com.author.username)
287+
, date: nut (text_ (prettyDate com.updatedAt))
288+
}
289+
maybe (theirComment_ ~~ common)
290+
( \u->do
291+
let
292+
deleteAction = click $ puredo
293+
launchAff_ $ deleteComment u.token slug com.id
294+
remove
295+
296+
myComment_ ~~ (common`union` { deleteAction })
297+
)
298+
(case cuof
299+
SignedIn u
300+
| u.username == com.author.username->Just u
301+
| otherwise->Nothing
302+
SignedOut->Nothing
303+
304+
)
310305
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp