Skip to content

Commit

Permalink
Blogs (NEAR-DevHub#345)
Browse files Browse the repository at this point in the history
* feat: adds workflow to deploy to testnet

* fix: prettier

* fix: build script

* feature: devhub.testnet workflow

* feat: creates dev script

* feat: replaces release workflow

* feature: init root

* feature: pass props for widgets accountId and contract accountId

* feature: demo for new root

* feature: adds the configurators wip

* feature: branding configurator

* feature: about and information configurator

* feature: adds new addon flow

* fix: communities metadata

* fix: pass widgets to addon configurator

* fix: formatting and centering

* feature: refactored configurator

* feature: working information, about, and access control editors

* fix: branding for upload, but broken preview

* feature: blog start

* feature: tab links

* refactor: working communities with new root

* feature: implements feed

* fix: format

* feature: addons and configs with swapping config

* feat: puts in replacements for the refactor

* fix: name casing

* fix: format

* Implement server side search (NEAR-DevHub#298)

* Implement server side search

* case insensitive search on content

* add search test

* Update deploy-dev-testnet.yml

* feature: adds addons and their configurators (NEAR-DevHub#326)

* fix: bos-loader pulls from cargo

* fix: links and replacements

* chore: dummy data

* feature: rename page

* wip: plugins

* feature: able to configure addons from community config

* feat: dummy data

* fix: key in tab selection

* feat: telegram configurator

* feature: init github

* refactor: moves configurators inside of configuration

* refactor: posts and blog

* fix: replace mob

* fix: broken link

* fix: move app and clean-up

* refactor: structure

* fix: scripts

* fix: bos-loader pulls from cargo

* fix: links and replacements

* feat: adds workflow to deploy to testnet (NEAR-DevHub#305)

* feat: adds workflow to deploy to testnet

* fix: prettier

* fix: build script

* feature: devhub.testnet workflow

* feat: creates dev script

* feat: replaces release workflow

* feat: adds weekly promotion of develop to main

* fix: adds replacements for mainnet (NEAR-DevHub#318)

* Fix community posting (NEAR-DevHub#308)

* chore: Format

* Fix community post button

---------

Co-authored-by: Bo Yao <[email protected]>

* fix: main branch deploy action (NEAR-DevHub#319)

* fix: adds replacements for mainnet
* fix: changes devhub.testnet to devhubtest.testnet

* Improve search ux (NEAR-DevHub#317)

* big improvement on search ux

* add search icon

* feat: adds workflow to deploy to testnet

* feat: creates dev script

* refactor: structure clean up and fixes (NEAR-DevHub#330)

* fix: adds replacements for mainnet (NEAR-DevHub#318)

* Fix community posting (NEAR-DevHub#308)

* chore: Format

* Fix community post button

---------

Co-authored-by: Bo Yao <[email protected]>

* fix: main branch deploy action (NEAR-DevHub#319)

* fix: adds replacements for mainnet
* fix: changes devhub.testnet to devhubtest.testnet

* Improve search ux (NEAR-DevHub#317)

* big improvement on search ux

* add search icon

* fix: bos-loader pulls from cargo

* fix: links and replacements

* fix: formatting

* fix: bos-loader pulls from cargo

* feat: adds workflow to deploy to testnet (NEAR-DevHub#305)

* feat: adds workflow to deploy to testnet

* fix: prettier

* fix: build script

* feature: devhub.testnet workflow

* feat: creates dev script

* feat: replaces release workflow

* feat: adds weekly promotion of develop to main

* fix: adds replacements for mainnet (NEAR-DevHub#318)

* Fix community posting (NEAR-DevHub#308)

* chore: Format

* Fix community post button

---------

Co-authored-by: Bo Yao <[email protected]>

* fix: main branch deploy action (NEAR-DevHub#319)

* fix: adds replacements for mainnet
* fix: changes devhub.testnet to devhubtest.testnet

* Improve search ux (NEAR-DevHub#317)

* big improvement on search ux

* add search icon

* feat: adds workflow to deploy to testnet

* feat: creates dev script

* refactor: rename to devhub

* chore: removes hello

* refactor: renames from DevHub to devhub references in code

* fix: marks legacy and makes new feed test

* feature: catches up to main

* fix: formatting

* feature: wrapped kanban and github wip

* test: adds tests for community

* fix: formatting

* fix: bash explicit

* fix: adds check for jq

---------

Co-authored-by: Carina.Akaia.near <[email protected]>
Co-authored-by: Bo Yao <[email protected]>

* refactor: structure clean up and fixes (NEAR-DevHub#330)

* fix: adds replacements for mainnet (NEAR-DevHub#318)

* Fix community posting (NEAR-DevHub#308)

* chore: Format

* Fix community post button

---------

Co-authored-by: Bo Yao <[email protected]>

* fix: main branch deploy action (NEAR-DevHub#319)

* fix: adds replacements for mainnet
* fix: changes devhub.testnet to devhubtest.testnet

* Improve search ux (NEAR-DevHub#317)

* big improvement on search ux

* add search icon

* fix: bos-loader pulls from cargo

* fix: links and replacements

* fix: formatting

* fix: bos-loader pulls from cargo

* feat: adds workflow to deploy to testnet (NEAR-DevHub#305)

* feat: adds workflow to deploy to testnet

* fix: prettier

* fix: build script

* feature: devhub.testnet workflow

* feat: creates dev script

* feat: replaces release workflow

* feat: adds weekly promotion of develop to main

* fix: adds replacements for mainnet (NEAR-DevHub#318)

* Fix community posting (NEAR-DevHub#308)

* chore: Format

* Fix community post button

---------

Co-authored-by: Bo Yao <[email protected]>

* fix: main branch deploy action (NEAR-DevHub#319)

* fix: adds replacements for mainnet
* fix: changes devhub.testnet to devhubtest.testnet

* Improve search ux (NEAR-DevHub#317)

* big improvement on search ux

* add search icon

* feat: adds workflow to deploy to testnet

* feat: creates dev script

* refactor: rename to devhub

* chore: removes hello

* refactor: renames from DevHub to devhub references in code

* fix: marks legacy and makes new feed test

* feature: catches up to main

* fix: formatting

* feature: wrapped kanban and github wip

* test: adds tests for community

* fix: formatting

* fix: bash explicit

* fix: adds check for jq

---------

Co-authored-by: Carina.Akaia.near <[email protected]>
Co-authored-by: Bo Yao <[email protected]>

* refactor: moves over search post feature

* refactor: converts legacy

* refactor: replaces a with Link and separates out community card and spawner

* refactor: simplfies configurator wip

* fix: community configurator

* feat: blog configuration

* feat: improved configurator for wiki

* feat: blog editor

* fix: tag component

* Website Redesign (NEAR-DevHub#336)

* Rebase to develop branch

* fix: organize componnets according to atomic design

* feat: Add hrefs to navlinks

* fix: remove duplicate banner

* fix: remove duplicate Navbar dropdown

* fix: remove comments from app layout

* feat: add visual indicator to navbar on selected link

feat: adds deploy script

fix: access control configurator

fix: ids for addons

fix: formatting

fix: communities test

* refactor: new devhub root and refactor of current app

chore: removes homepage work

chore: removes homepage from app.js

fix: removes from contributing

fix: cleans pull request

fix: removes change to deploy-dev workflow step

* feat: configures tests for different wallet connection scenarios

fix: remove deploy

fix: removes deploy script

* fix: formatting

* feat: adds community addon framework, wiki and telegram plugins

* fix: formatting

* test: bootstraps addon test wip

* fix: formatting

* test: modifies test criteria

* initial commit

* feat: work in progress

* fix: formatting

* feat: clean feed component

* refactor: change tags to labels

* fix: formatting

* feat: sets post template

* feat: blog page

* fix: Page is module

* fix: formatting

---------

Co-authored-by: Thomas <[email protected]>
Co-authored-by: Bo Yao <[email protected]>
Co-authored-by: Carina.Akaia.near <[email protected]>
Co-authored-by: Zeeshan Ahmad <[email protected]>
  • Loading branch information
5 people authored Nov 1, 2023
1 parent cc4c730 commit 4b0b770
Show file tree
Hide file tree
Showing 14 changed files with 1,125 additions and 30 deletions.
9 changes: 9 additions & 0 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ function Page() {
/>
);
}
// ?page=blog
case "blog": {
return (
<Widget
src={"${REPL_DEVHUB}/widget/devhub.page.blog"}
props={passProps}
/>
);
}
default: {
// TODO: 404 page
return <p>404</p>;
Expand Down
16 changes: 8 additions & 8 deletions src/core/adapter/devhub-contract.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 6 additions & 1 deletion src/devhub/components/molecule/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
Expand Down
158 changes: 158 additions & 0 deletions src/devhub/entity/addon/blog/Card.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<Container>
<InfoContainer>
<InfoText color="#F40303" fontWeight="700">
{category && category.toUpperCase()}
</InfoText>
<Separator>·</Separator>
<InfoText>{date && formatDate(date)}</InfoText>
</InfoContainer>
<TitleContainer>
<Title>{title}</Title>
</TitleContainer>
<DescriptionContainer>
<Description>
<DescriptionText>{description}</DescriptionText>
</Description>
<TagsContainer>
{(labels || []).map((label, index) => (
<div key={label}>
{index > 0 && <Separator />}
<InfoText fontWeight="700">{label}</InfoText>
</div>
))}
</TagsContainer>
</DescriptionContainer>
</Container>
);
}

return { Card };
Loading

0 comments on commit 4b0b770

Please sign in to comment.