diff --git a/apps/builddao/widget/components/Post.jsx b/apps/builddao/widget/components/Post.jsx index 733a50a3..9bffe3e2 100644 --- a/apps/builddao/widget/components/Post.jsx +++ b/apps/builddao/widget/components/Post.jsx @@ -1,7 +1,5 @@ -const { User, Button } = VM.require("buildhub.near/widget/components") || { - User: () => <>, - Button: () => <>, -}; +const { Button } = + VM.require("buildhub.near/widget/components") || (() => <>); const StyledPost = styled.div` margin-bottom: 1rem; @@ -318,16 +316,19 @@ return ( >
- {fullPostLink ? ( <>); -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); - } - } -`; - const Wrapper = styled.div` color: #fff; @@ -84,18 +47,8 @@ const Wrapper = styled.div` `; const accountId = props.accountId; -const blockHeight = props.blockHeight; -const pinned = !!props.pinned; -const hideMenu = !!props.hideMenu; const name = props.name || Social.get(`${accountId}/profile/name`); - -const postType = props.postType ?? "post"; -const link = props.link; const isPremium = !!props.isPremium; -const flagItem = props.flagItem; -const customActions = props.customActions ?? []; -const showTime = props.showTime ?? true; -const toggleModal = props.toggleModal; const Overlay = (props) => ( ( ); return ( -
- -
- - -
-

{name || "No-Name Profile"}

-
- -
-
-

{accountId}

- {showTime && ( -

- {blockHeight === "now" ? ( - "now" - ) : ( - - - - )} -

- )} - - {pinned && ( - - - - )} -
- - {!pinned && !hideMenu && blockHeight !== "now" && ( - - -
    -
  • - - View raw markdown source - -
  • -
  • + +
    + + +
    +

    {name || "No-Name Profile"}

    +
    -
  • - {flagItem && ( -
  • - -
  • - )} - {customActions.length > 0 && - customActions.map((action) => ( -
  • - -
  • - ))} -
-
- )} -
+
+
+

{accountId}

+ + + ); diff --git a/apps/builddao/widget/components/post/Header.jsx b/apps/builddao/widget/components/post/Header.jsx new file mode 100644 index 00000000..7930170e --- /dev/null +++ b/apps/builddao/widget/components/post/Header.jsx @@ -0,0 +1,207 @@ +const { Avatar } = + VM.require("buildhub.near/widget/components") || (() => <>); + +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); + } + } +`; + +const Wrapper = styled.div` + color: #fff; + + p { + color: #fff; + color: var(--White-100, #fff); + + font-size: ${(props) => (props.variant === "mobile" ? "13px" : "14px")}; + font-style: normal; + font-weight: 500; + line-height: normal; + margin: 0; + } + + p.username { + color: var(--White-50, #cdd0d5); + font-size: ${(props) => (props.variant === "mobile" ? "10px" : "13px")}; + margin: 0; + } + + p.time { + color: var(--White-100, #fff); + font-size: ${(props) => (props.variant === "mobile" ? "10px" : "13px")}; + margin: 0; + } + + @media screen and (max-width: 768px) { + ${(props) => + !props.variant && + ` + p { + font-size: 13px !important; + } + + p.username { + font-size: 10px !important; + } + + p.time { + font-size: 10px !important; + } + `} + } +`; + +const accountId = props.accountId; +const blockHeight = props.blockHeight; +const pinned = !!props.pinned; +const hideMenu = !!props.hideMenu; +const name = props.name || Social.get(`${accountId}/profile/name`); + +const postType = props.postType ?? "post"; +const link = props.link; +const isPremium = !!props.isPremium; +const flagItem = props.flagItem; +const customActions = props.customActions ?? []; +const showTime = props.showTime ?? true; +const toggleModal = props.toggleModal; + +const Overlay = (props) => ( + + + +); + +return ( +
+ +
+ + +
+

{name || "No-Name Profile"}

+
+ +
+
+

{accountId}

+ {showTime && ( +

+ {blockHeight === "now" ? ( + "now" + ) : ( + + + + )} +

+ )} +
+ {pinned && ( + + + + )} +
+
+ {!pinned && !hideMenu && blockHeight !== "now" && ( + + +
    +
  • + + View raw markdown source + +
  • +
  • + +
  • + {flagItem && ( +
  • + +
  • + )} + {customActions.length > 0 && + customActions.map((action) => ( +
  • + +
  • + ))} +
+
+ )} +
+);