-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add notification item code * suggestive changes
- Loading branch information
1 parent
28c201f
commit 3d43c38
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
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,34 @@ | ||
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url") || (() => {}); | ||
|
||
if (!props.type) { | ||
return "Loading ..."; | ||
} | ||
|
||
const type = props.type.split("/")[1]; | ||
return props.type ? ( | ||
<> | ||
{type == "like" | ||
? "liked your" | ||
: type == "reply" | ||
? "replied to your" | ||
: type == "edit" | ||
? "edited your" | ||
: type == "mention" | ||
? "mentioned you in their" | ||
: "???"}{" "} | ||
<a | ||
className="fw-bold text-muted" | ||
href={href({ | ||
widgetSrc: "${REPL_DEVHUB}/widget/app", | ||
params: { | ||
page: "post", | ||
id: props.post, | ||
}, | ||
})} | ||
> | ||
DevHub post | ||
</a> | ||
</> | ||
) : ( | ||
"Loading ..." | ||
); |
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,20 @@ | ||
const { href } = VM.require("${REPL_DEVHUB}/widget/core.lib.url") || (() => {}); | ||
|
||
return props.post === undefined ? ( | ||
"Loading ..." | ||
) : ( | ||
<> | ||
<a | ||
className="btn btn-outline-dark" | ||
href={href({ | ||
widgetSrc: "${REPL_DEVHUB}/widget/app", | ||
params: { | ||
page: "post", | ||
id: props.post, | ||
}, | ||
})} | ||
> | ||
View DevHub post | ||
</a> | ||
</> | ||
); |