diff --git a/src/app.jsx b/src/app.jsx
index fbd9c061e..5a009f016 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -112,6 +112,15 @@ function Page() {
/>
);
}
+ // ?page=blog
+ case "blog": {
+ return (
+
404
; diff --git a/src/core/adapter/devhub-contract.jsx b/src/core/adapter/devhub-contract.jsx index fbbac46d9..979a747ee 100644 --- a/src/core/adapter/devhub-contract.jsx +++ b/src/core/adapter/devhub-contract.jsx @@ -129,14 +129,14 @@ function getAvailableAddons() { // configurator_widget: // "${REPL_DEVHUB}/widget/devhub.entity.addon.kanban.Configurator", // }, - // { - // id: "blog", - // title: "Blog", - // description: "Create a blog for your community", - // view_widget: "${REPL_DEVHUB}/widget/devhub.entity.addon.blog.Viewer", - // configurator_widget: - // "${REPL_DEVHUB}/widget/devhub.entity.addon.blog.Configurator", - // }, + { + id: "blog", + title: "Blog", + description: "Create a blog for your community", + view_widget: "${REPL_DEVHUB}/widget/devhub.entity.addon.blog.Viewer", + configurator_widget: + "${REPL_DEVHUB}/widget/devhub.entity.addon.blog.Configurator", + }, ]; // return Near.view("${REPL_DEVHUB_CONTRACT}", "get_available_addons") ?? null; } diff --git a/src/devhub/components/molecule/Input.jsx b/src/devhub/components/molecule/Input.jsx index 69b27c7e2..79c9d34c0 100644 --- a/src/devhub/components/molecule/Input.jsx +++ b/src/devhub/components/molecule/Input.jsx @@ -14,7 +14,12 @@ const TextInput = ({ ...otherProps }) => { const typeAttribute = - type === "text" || type === "password" || type === "number" ? type : "text"; + type === "text" || + type === "password" || + type === "number" || + type === "date" + ? type + : "text"; const renderedLabels = [ (label?.length ?? 0) > 0 ? ( diff --git a/src/devhub/entity/addon/blog/Card.jsx b/src/devhub/entity/addon/blog/Card.jsx new file mode 100644 index 000000000..b5256f8d5 --- /dev/null +++ b/src/devhub/entity/addon/blog/Card.jsx @@ -0,0 +1,158 @@ +const cidToURL = (cid) => `https://ipfs.near.social/ipfs/${cid}`; + +const Container = styled.div` + width: 100%; + height: 100%; + padding: 24px; + background: #fffefe; + border-radius: 16px; + overflow: hidden; + border: 1px rgba(129, 129, 129, 0.3) solid; + display: inline-flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + gap: 24px; +`; + +const InfoContainer = styled.div` + padding-right: 16px; + display: inline-flex; + justify-content: flex-start; + align-items: center; + gap: 16px; +`; + +const InfoText = styled.div` + color: ${(props) => props.color || "#818181"}; + font-size: 16px; + font-family: ${(props) => props.fontFamily || "Aeonik Fono"}; + font-weight: ${(props) => props.fontWeight || "400"}; + line-height: 20px; + word-wrap: break-word; +`; + +const TitleContainer = styled.div` + width: 344px; + padding-right: 16px; + display: inline-flex; + justify-content: flex-start; + align-items: center; + gap: 8px; +`; + +const Title = styled.div` + width: 422px; + color: #151515; + font-size: 36px; + font-family: "Aeonik"; + font-weight: 700; + line-height: 39.6px; + word-wrap: break-word; +`; + +const DescriptionContainer = styled.div` + align-self: stretch; + height: 155px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; +`; + +const Description = styled.div` + align-self: stretch; + height: 103px; + padding-bottom: 16px; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + gap: 16px; +`; + +const DescriptionText = styled.div` + align-self: stretch; + color: #151515; + font-size: 24px; + font-family: "Aeonik"; + font-weight: 400; + line-height: 28.8px; + word-wrap: break-word; +`; + +const TagsContainer = styled.div` + padding: 16px; + border-radius: 360px; + overflow: hidden; + display: inline-flex; + justify-content: flex-start; + align-items: center; + gap: 16px; +`; + +const Separator = styled.div` + color: #8a8e93; + font-size: 16px; + font-family: "Circular Std"; + font-weight: 400; + line-height: 19.2px; + word-wrap: break-word; +`; + +function Card({ labels, data }) { + const { + title, + subtitle, + description, + category, + author, + image, + community, + date, + } = data; + + function formatDate(date) { + const options = { + weekday: "short", + year: "numeric", + month: "short", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + timeZoneName: "short", + }; + return date.toLocaleString("en-US", options).replace(",", ""); + } + + return ( +No posts
+ )} ++ Written by {author || "AUTHOR"} in{" "} + {community || "COMMUNITY"} +
+