-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web-ui): post and reaction notification links (#317)
- Loading branch information
1 parent
d1e6408
commit 7800974
Showing
22 changed files
with
228 additions
and
58 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
src/webui/components/notification/elementary/AddedReaction.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
|
||
import type { AggregatedData as PostView } from '^/domain/post/aggregate/types'; | ||
import type { AggregatedData as NotificationView } from '^/domain/notification/aggregate/types'; | ||
import type { AggregatedData as ReactionView } from '^/domain/reaction/aggregate/types'; | ||
import { ClickArea, Image, Row, Text } from '^/webui/designsystem'; | ||
|
||
type Props = { | ||
readonly post: PostView; | ||
readonly onComicClick: (post: PostView) => void; | ||
readonly notification: NotificationView; | ||
readonly onReactionClick: (reaction: ReactionView) => void; | ||
}; | ||
|
||
export default function Component({ post, onComicClick }: Props) | ||
export default function Component({ notification, onReactionClick }: Props) | ||
{ | ||
return <Row alignX='justify' alignY='stretch' gap='medium'> | ||
<Text value='I added a reaction to your post.' /> | ||
<ClickArea onClick={() => onComicClick(post)}> | ||
<Image source={post.comic.image.dataUrl} width='150px' /> | ||
<ClickArea onClick={() => onReactionClick(notification.reaction as ReactionView)}> | ||
<Image source={notification.post?.comic.image.dataUrl as string} width='150px' /> | ||
</ClickArea> | ||
</Row>; | ||
} |
13 changes: 9 additions & 4 deletions
13
src/webui/components/notification/elementary/RatedComicReaction.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
|
||
import { Image, Row, Text } from '^/webui/designsystem'; | ||
import { ClickArea, Image, Row, Text } from '^/webui/designsystem'; | ||
|
||
import type { AggregatedData as ReactionView } from '^/domain/reaction/aggregate/types'; | ||
|
||
type Props = { | ||
readonly comicDataUrl: string; | ||
readonly reaction: ReactionView; | ||
readonly onReactionClick: (reaction: ReactionView) => void; | ||
}; | ||
|
||
export default function Component({ comicDataUrl }: Props) | ||
export default function Component({ reaction, onReactionClick }: Props) | ||
{ | ||
return <Row alignX='justify' alignY='stretch' gap='medium'> | ||
<Text value='I like your reaction.' /> | ||
<Image source={comicDataUrl} width='150px' /> | ||
<ClickArea onClick={() => onReactionClick(reaction)} > | ||
<Image source={reaction.comic?.image.dataUrl as string} width='150px' /> | ||
</ClickArea> | ||
</Row>; | ||
} |
18 changes: 11 additions & 7 deletions
18
src/webui/components/notification/elementary/RatedCommentReaction.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
|
||
import { Border, Column, Text } from '^/webui/designsystem'; | ||
import { Border, ClickArea, Column, Text } from '^/webui/designsystem'; | ||
|
||
import type { AggregatedData as ReactionView } from '^/domain/reaction/aggregate/types'; | ||
|
||
type Props = { | ||
readonly comment: string; | ||
readonly reaction: ReactionView; | ||
readonly onReactionClick: (reaction: ReactionView) => void; | ||
}; | ||
|
||
export default function Component({ comment }: Props) | ||
export default function Component({ reaction, onReactionClick }: Props) | ||
{ | ||
|
||
return <Column alignX='stretch' alignY='justify' gap='medium'> | ||
<Text value='I like your reaction.' /> | ||
<Border size='small' padding='small'> | ||
<Text size='small' wrap='normal' value={comment} /> | ||
</Border> | ||
<ClickArea onClick={() => onReactionClick(reaction)} > | ||
<Border size='small' padding='small'> | ||
<Text size='small' wrap='normal' value={reaction.comment?.message as string} /> | ||
</Border> | ||
</ClickArea> | ||
</Column>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
|
||
import { Image, Row, Text } from '^/webui/designsystem'; | ||
import { ClickArea, Image, Row, Text } from '^/webui/designsystem'; | ||
|
||
import type { AggregatedData as PostView } from '^/domain/post/aggregate/types'; | ||
|
||
type Props = { | ||
readonly comicDataUrl: string; | ||
readonly post: PostView; | ||
readonly onPostClick: (post: PostView) => void; | ||
}; | ||
|
||
export default function Component({ comicDataUrl }: Props) | ||
export default function Component({ post, onPostClick }: Props) | ||
{ | ||
return <Row gap='medium' alignX='justify'> | ||
<Text value='I like your comic.' /> | ||
<Image source={comicDataUrl} width='150px' /> | ||
<ClickArea onClick={() => onPostClick(post)} > | ||
<Image source={post.comic.image.dataUrl} width='150px' /> | ||
</ClickArea> | ||
</Row>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
import { ClickArea, Row, Text } from '^/webui/designsystem'; | ||
|
||
type Props = { | ||
readonly onShowClick: () => void; | ||
}; | ||
|
||
export default function Component({ onShowClick }: Props) | ||
{ | ||
return <Row alignY='stretch' alignX='justify' > | ||
<Text value='single reaction' /> | ||
<ClickArea onClick={onShowClick}> | ||
<Text value='all reactions' /> | ||
</ClickArea> | ||
</Row>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.