Skip to content

Commit

Permalink
Added notification item code (#528)
Browse files Browse the repository at this point in the history
* add notification item code

* suggestive changes
  • Loading branch information
Megha-Dev-19 authored Dec 4, 2023
1 parent 28c201f commit 3d43c38
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/DevGov/Notification/Item/Left.jsx
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 ..."
);
20 changes: 20 additions & 0 deletions src/DevGov/Notification/Item/Right.jsx
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>
</>
);

0 comments on commit 3d43c38

Please sign in to comment.