From 590a0ef20c9789e57562b1bbf13d7cac9e57652b Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:14:46 -0500 Subject: [PATCH] Revert "remove all unused components" --- apps/builddao/widget/{feed => }/Bookmarks.jsx | 0 apps/builddao/widget/Feed.jsx | 2 +- apps/builddao/widget/Post.jsx | 372 ++++++++++++++++++ apps/builddao/widget/Post/Header.jsx | 169 ++++++++ 4 files changed, 542 insertions(+), 1 deletion(-) rename apps/builddao/widget/{feed => }/Bookmarks.jsx (100%) create mode 100644 apps/builddao/widget/Post.jsx create mode 100644 apps/builddao/widget/Post/Header.jsx diff --git a/apps/builddao/widget/feed/Bookmarks.jsx b/apps/builddao/widget/Bookmarks.jsx similarity index 100% rename from apps/builddao/widget/feed/Bookmarks.jsx rename to apps/builddao/widget/Bookmarks.jsx diff --git a/apps/builddao/widget/Feed.jsx b/apps/builddao/widget/Feed.jsx index 1fc1b1d1..f1c47b1a 100644 --- a/apps/builddao/widget/Feed.jsx +++ b/apps/builddao/widget/Feed.jsx @@ -203,7 +203,7 @@ return ( }} /> ) : ( - + ) ) : ( :not(caption) > * > * { + padding: 0.3rem; + } + + &:hover { + background-color: rgba(0, 0, 0, 0.03); + .expand-post { + background-image: linear-gradient( + to bottom, + rgba(0, 0, 0, 0), + rgba(247.35, 247.35, 247.35, 1) 25% + ); + } + } + + .post-header { + margin: 4px 0; + } + } + + .post:not(:last-child):before { + content: ""; + position: absolute; + left: 30px; + top: 56px; + bottom: 0; + width: 2px; + background-color: #ddd; + z-index: -1; + } + + .post:not(:first-child):after { + content: ""; + position: absolute; + left: 30px; + top: 0; + width: 2px; + height: 8px; + background-color: #ddd; + z-index: -1; + } + + .left { + margin-right: 12px; + min-width: 40px; + width: 40px; + overflow: hidden; + } + .right { + margin-top: -4px; + flex-grow: 1; + min-width: 0; + } + + .buttons-placeholder { + padding-bottom: 10px; + } + + .buttons { + margin-top: 10px; + margin-bottom: 6px; + column-gap: 4px; + color: #888; + } + + .reposted { + padding-top: 30px; + } +`; + +const contentWidget = ( + + } + src="mob.near/widget/MainPage.N.Post.Content" + props={{ + content, + raw, + truncateContent: props.truncateContent, + noEmbed: props.noEmbed, + }} + /> +); + +return ( + + +
+
+ } + src="/*__@appAccount__*//widget/Post.Header" + props={{ + accountId, + blockHeight, + pinned, + hideMenu, + link, + postType: "post", + flagItem: item, + }} + /> + {fullPostLink ? ( + + {contentWidget} + + ) : ( + contentWidget + )} + {props.customButtons ? ( + props.customButtons + ) : !pinned && !hideButtons && blockHeight !== "now" ? ( +
+ State.update({ showReply: !state.showReply }), + }} + /> + + + +
+ ) : ( +
+ )} +
+
+ {state.showReply && ( +
+ State.update({ showReply: false }), + }} + /> +
+ )} + {props.customComments + ? props.customComments + : !props.hideComments && ( +
+ +
+ )} + + +); diff --git a/apps/builddao/widget/Post/Header.jsx b/apps/builddao/widget/Post/Header.jsx new file mode 100644 index 00000000..d08ddf0b --- /dev/null +++ b/apps/builddao/widget/Post/Header.jsx @@ -0,0 +1,169 @@ +const accountId = props.accountId; +const blockHeight = props.blockHeight; +const pinned = !!props.pinned; +const hideMenu = !!props.hideMenu; +const name = Social.get(`${accountId}/profile/name`); + +const postType = props.postType ?? "post"; +const link = props.link; +const isPremium = !!props.isPremium; + +const Overlay = (props) => ( + + + +); + +const DotsSvg = ( + + + +); + +const Button = styled.div` + line-height: 20px; + min-height: 20px; + display: inline-flex; + align-items: center; + justify-content: left; + background: inherit; + color: #6c757d; + font-size: 16px; + .icon { + position: relative; + &:before { + margin: -8px; + content: ""; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + border-radius: 50%; + } + } + + &:not([disabled]) { + cursor: pointer; + } + + &:not([disabled]):hover { + opacity: 1 !important; + color: DeepSkyBlue; + + .icon:before { + background: rgba(0, 191, 255, 0.1); + } + } +`; + +return ( +
+
+
+
+ +
+
+
+ {name && ( + +
{name}
+
+ )} +
+ +
+
+
+
+ +
@{accountId}
+
+
+ {!pinned && ( +
+ {blockHeight === "now" ? ( + "now" + ) : ( + + + + )} +
+ )} +
+
+
+
+ {pinned && ( + + + + )} + {!pinned && !hideMenu && blockHeight !== "now" && ( + + + + + )} +
+);