From be71b63c4b18359d1d63d4cb24ea0de2299d9fbb Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Thu, 28 Dec 2023 03:06:13 +0500 Subject: [PATCH 1/2] Make "See more" button more visible (#602) * feat: Update See more UI for posts * fix: remove unnecesary space * Remove hide more as it is broken on smaller posts --- src/devhub/entity/post/Post.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/devhub/entity/post/Post.jsx b/src/devhub/entity/post/Post.jsx index dbddc77bc..0a156ff49 100644 --- a/src/devhub/entity/post/Post.jsx +++ b/src/devhub/entity/post/Post.jsx @@ -721,6 +721,12 @@ const clampedContent = needClamp ? contentArray.slice(0, 3).join("\n") : snapshot.description; +const SeeMore = styled.a` + cursor: pointer; + color: #00b774 !important; + font-weight: bold; +`; + // Should make sure the posts under the currently top viewed post are limited in size. const descriptionArea = isUnderPost ? ( @@ -749,13 +755,9 @@ const descriptionArea = isUnderPost ? ( {state.clamp ? ( ) : ( <> From 424c0a4894934009521c075605cdfb09274239d7 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Thu, 28 Dec 2023 12:29:42 -0500 Subject: [PATCH 2/2] migrates neardevgov to devhub (#610) --- .../components/molecule/BadgeDetails.jsx | 78 +++++++++++++++++++ .../components/molecule/MarkdownViewer.jsx | 2 +- .../components/molecule/ProfileCard.jsx | 2 +- .../components/molecule/ProfileLine.jsx | 21 +++++ src/devhub/entity/community/Teams.jsx | 2 +- src/devhub/entity/post/Post.jsx | 2 +- src/devhub/page/admin/moderatorsTab.jsx | 2 +- 7 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 src/devhub/components/molecule/BadgeDetails.jsx create mode 100644 src/devhub/components/molecule/ProfileLine.jsx diff --git a/src/devhub/components/molecule/BadgeDetails.jsx b/src/devhub/components/molecule/BadgeDetails.jsx new file mode 100644 index 000000000..c3a8c2d27 --- /dev/null +++ b/src/devhub/components/molecule/BadgeDetails.jsx @@ -0,0 +1,78 @@ +const nearDevGovBadgesContractId = "neardevgov.near"; + +let badgeId, ownerAccountId; +if (props.tokenId) { + let [_badgeId, _ownerAccountId] = props.tokenId.split(":", 2); + badgeId = _badgeId; + ownerAccountId = _ownerAccountId; +} else { + badgeId = props.badgeId; +} + +if (!badgeId) { + return ( + <> + Please, provide
badgeId
or
tokenId
to the + DevGovBadgeDetails component + + ); +} + +let badgeMetadata = + props.badgeMetadata ?? + Near.view(nearDevGovBadgesContractId, "get_badge", { + badge_id: badgeId, + }).badge_metadata; + +if (!badgeMetadata) { + return <>Loading...; +} + +return ( + <> +
+
+
+ +
+
+
+
+
+
+
+

+ {badgeMetadata.title} +

+
+
+
+
+ Awarded to + {badgeMetadata.copies} + developers +
+
+
+ +
+
+
+
+
+ +); diff --git a/src/devhub/components/molecule/MarkdownViewer.jsx b/src/devhub/components/molecule/MarkdownViewer.jsx index e53b6b37a..ace6662f9 100644 --- a/src/devhub/components/molecule/MarkdownViewer.jsx +++ b/src/devhub/components/molecule/MarkdownViewer.jsx @@ -43,7 +43,7 @@ const renderMention = ((accountId) => ( {
{inner} + + + +); diff --git a/src/devhub/entity/community/Teams.jsx b/src/devhub/entity/community/Teams.jsx index 7d099569e..e5bf76376 100644 --- a/src/devhub/entity/community/Teams.jsx +++ b/src/devhub/entity/community/Teams.jsx @@ -33,7 +33,7 @@ const UserList = ({ name, users }) => ( style={{ fontWeight: 500 }} > diff --git a/src/devhub/entity/post/Post.jsx b/src/devhub/entity/post/Post.jsx index 0a156ff49..700c26507 100644 --- a/src/devhub/entity/post/Post.jsx +++ b/src/devhub/entity/post/Post.jsx @@ -648,7 +648,7 @@ const postExtra =
Supervisor:{" "}
diff --git a/src/devhub/page/admin/moderatorsTab.jsx b/src/devhub/page/admin/moderatorsTab.jsx index 5c83dce84..c98534efc 100644 --- a/src/devhub/page/admin/moderatorsTab.jsx +++ b/src/devhub/page/admin/moderatorsTab.jsx @@ -108,7 +108,7 @@ return ( moderators.map((child) => (