Skip to content

Commit

Permalink
Merge pull request #180 from NEARBuilders/develop
Browse files Browse the repository at this point in the history
Projects
  • Loading branch information
Megha-Dev-19 authored Apr 22, 2024
2 parents a04c38c + fd960a3 commit 812f0d3
Show file tree
Hide file tree
Showing 148 changed files with 5,627 additions and 5,349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
uses: nearbuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
deploy-env: "mainnet"
bw-legacy: false
app-name: "builddao"
deploy-account-address: ${{ vars.BOS_SIGNER_ACCOUNT_ID }}
signer-account-address: ${{ vars.BOS_SIGNER_ACCOUNT_ID }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
branches: [develop]

jobs:
deploy-testnet:
deploy-staging:
uses: nearbuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
build-env: "testnet"
deploy-env: "testnet"
bw-legacy: false
app-name: "builddao"
deploy-account-address: ${{ vars.BOS_TESTNET_SIGNER_ACCOUNT_ID }}
signer-account-address: ${{ vars.BOS_TESTNET_SIGNER_ACCOUNT_ID }}
signer-public-key: ${{ vars.BOS_TESTNET_SIGNER_PUBLIC_KEY }}
deploy-account-address: builddao.testnet
signer-account-address: builddao.testnet
signer-public-key: ed25519:6ycWXZES2zEGPurZqP35AUQx92aAzuS7r9ea1GcSQQiT
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.BOS_TESTNET_SIGNER_PRIVATE_KEY }}
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "apps/devs.near"]
path = apps/devs.near
url = https://github.com/NEARBuilders/devs.near
branch = develop
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Build DAO
# Build DAO Gateway

Let's connect, collaborate, and create solutions together!

This repository holds the front-end widgets for [Build DAO Gateway](https://nearbuilders.org/). This project is configured as a [bos-workspace](https://github.com/nearbuilders/bos-workspace).

## Setup & Development

Install packages:
1. Initialize submodules and install packages:

```
yarn
```cmd
yarn run init
```

Start development version:
2. Start development version in mainnet:

```
```cmd
yarn dev
```

This will start both the gateway and http server for loading your local components.
Or start the development version in testnet:

To view your local developments, either visit them through a gateway ${gateway_url}/flags

For example, to use this local gateway, use:
```cmd
yarn dev:testnet
```

- Set the flag (something like http://127.0.0.1:4040/api/loader) at localhost:3000/flags
This will start a gateway at http://127.0.0.1:8080 which will render your local widgets. The entry point for this app is [buildhub.near/widget/app](http://127.0.0.1:8080/buildhub.near/widget/app).

### Community Page

Expand Down
6 changes: 6 additions & 0 deletions apps/builddao/aliases.mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"devs": "devs.near",
"mob": "mob.near",
"near": "near",
"socialdb": "social.near"
}
6 changes: 6 additions & 0 deletions apps/builddao/aliases.testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"devs": "neardevs.testnet",
"mob": "mike.testnet",
"near": "discom.testnet",
"socialdb": "v1.social08.testnet"
}
9 changes: 8 additions & 1 deletion apps/builddao/bos.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"appAccount": "buildhub.near"
"account": "buildhub.near",
"aliases": ["./aliases.mainnet.json"],
"overrides": {
"testnet": {
"account": "builddao.testnet",
"aliases": ["./aliases.testnet.json"]
}
}
}
3 changes: 3 additions & 0 deletions apps/builddao/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"buildhub.near": {}
}
16 changes: 8 additions & 8 deletions apps/builddao/widget/Comment/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const extractNotifyAccountId = (item) => {
return `${accountId}/post/main` === item.path ? accountId : undefined;
};

const link = `/mob.near/widget/MainPage.N.Comment.Page?accountId=${accountId}&blockHeight=${blockHeight}${groupIdLinkPart}`;
const link = `/${alias_mob}/widget/MainPage.N.Comment.Page?accountId=${accountId}&blockHeight=${blockHeight}${groupIdLinkPart}`;

const item = {
type: "social",
Expand Down Expand Up @@ -231,7 +231,7 @@ return (
<div className="right">
<div className="mb-3">
<Widget
src="buildhub.near/widget/components.post.Header"
src="${config_account}/widget/components.post.Header"
props={{
accountId,
blockHeight,
Expand All @@ -248,7 +248,7 @@ return (
style={{ minHeight: "100px" }}
/>
}
src="mob.near/widget/MainPage.N.Post.Content"
src="${alias_mob}/widget/MainPage.N.Post.Content"
props={{ content, raw }}
/>
{blockHeight !== "now" ? (
Expand All @@ -257,7 +257,7 @@ return (
<div key="comment">
<Widget
loading=""
src="mob.near/widget/N.CommentButton"
src="${alias_mob}/widget/N.CommentButton"
props={{
disabled: permissions.disableComment,
onClick: () =>
Expand All @@ -268,23 +268,23 @@ return (
)}
<Widget
loading=""
src="mob.near/widget/N.RepostButton"
src="${alias_mob}/widget/N.RepostButton"
props={{
item,
disabled: true,
}}
/>
<Widget
loading=""
src="mob.near/widget/N.LikeButton"
src="${alias_mob}/widget/N.LikeButton"
props={{
notifyAccountId,
item,
}}
/>
<Widget
loading=""
src="mob.near/widget/MainPage.N.Post.ShareButton"
src="${alias_mob}/widget/MainPage.N.Post.ShareButton"
props={{ accountId, blockHeight, postType: "comment", groupId }}
/>
</div>
Expand All @@ -296,7 +296,7 @@ return (
{state.showReply && (
<div className="mb-2" key="reply">
<Widget
src="buildhub.near/widget/Comment.Compose"
src="${config_account}/widget/Comment.Compose"
props={{
initialText: `@${accountId}, `,
notifyAccountId: extractNotifyAccountId(parentItem),
Expand Down
4 changes: 2 additions & 2 deletions apps/builddao/widget/Comment/Compose.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ State.init({
return (
<>
<Widget
src="devs.near/widget/Common.Compose"
src="${alias_devs}/widget/Common.Compose"
props={{
placeholder: "Reply",
initialText: props.initialText,
Expand Down Expand Up @@ -125,7 +125,7 @@ return (
<div className="px-3">
<Widget
key="post-preview"
src="buildhub.near/widget/Comment.Comment"
src="${config_account}/widget/Comment.Comment"
props={{
item,
accountId: context.accountId,
Expand Down
4 changes: 2 additions & 2 deletions apps/builddao/widget/Comment/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const renderItem = (a) =>
<Widget
key={JSON.stringify(a)}
loading={<div className="w-100 mb-2" style={{ minHeight: "200px" }} />}
src="buildhub.near/widget/Comment.Comment"
src="${config_account}/widget/Comment.Comment"
props={{
accountId: a.accountId,
blockHeight: a.blockHeight,
Expand Down Expand Up @@ -56,7 +56,7 @@ const ShowMore = styled.div`
return (
<Widget
loading={false}
src="mob.near/widget/FilteredIndexFeed"
src="${alias_mob}/widget/FilteredIndexFeed"
props={{
loading: false,
index,
Expand Down
8 changes: 4 additions & 4 deletions apps/builddao/widget/Compose.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Button } = VM.require("buildhub.near/widget/components") || {
const { Button } = VM.require("${config_account}/widget/components") || {
Button: () => <></>,
};

Expand Down Expand Up @@ -102,7 +102,7 @@ return (
>
<div>
<Widget
src="devs.near/widget/Common.Compose"
src="${alias_devs}/widget/Common.Compose"
props={{
placeholder: "What's happening?",
onChange: state.onChange,
Expand Down Expand Up @@ -159,7 +159,7 @@ return (
<div className="px-3">
<Widget
key="post-preview"
src="buildhub.near/widget/components.Post"
src="${config_account}/widget/components.Post"
props={{
accountId: context.accountId,
content: state.content || { type: "md", text: "" },
Expand All @@ -171,7 +171,7 @@ return (
)}
</div>
<Widget
src="near/widget/DIG.Toast"
src="${alias_near}/widget/DIG.Toast"
props={{
title: "Post Submitted Successfully",
type: "success",
Expand Down
14 changes: 7 additions & 7 deletions apps/builddao/widget/Feed.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { Feed } = VM.require("devs.near/widget/Feed") || {
const { Feed } = VM.require("${alias_devs}/widget/Feed") || {
Feed: () => <></>,
};
const { Post, Button } = VM.require("buildhub.near/widget/components") || {
const { Post, Button } = VM.require("${config_account}/widget/components") || {
Post: () => <></>,
Button: () => <></>,
};
const { Header } = VM.require("buildhub.near/widget/components.Header") || {
const { Header } = VM.require("${config_account}/widget/components.Header") || {
Header: () => <></>,
};

Expand All @@ -26,7 +26,7 @@ const LoginContainer = styled.div`
margin-bottom: 1rem;
`;

const { name: feedName, template, requiredHashtags, customActions } = props;
const { feedName, template, requiredHashtags, customActions } = props;

// for modals
const [item, setItem] = useState(null);
Expand Down Expand Up @@ -56,7 +56,7 @@ return (
<Header>{feedName} Feed</Header>
{/* Modals */}
<Widget
src="buildhub.near/widget/components.modals.CreateProposal"
src="${config_account}/widget/components.modals.CreateProposal"
loading=""
props={{
showModal: showProposeModal,
Expand All @@ -82,7 +82,7 @@ return (
style={{ height: 400 }}
></div>
}
src="buildhub.near/widget/Compose"
src="${config_account}/widget/Compose"
props={{
draftKey: feedName,
template: template,
Expand Down Expand Up @@ -110,7 +110,7 @@ return (
accountId={p.accountId}
blockHeight={p.blockHeight}
noBorder={true}
currentPath={`/buildhub.near/widget/app?page=feed`}
currentPath={`/${config_account}/widget/app?page=feed`}
customActions={customActions}
modalToggles={modalToggles}
setItem={setItem}
Expand Down
6 changes: 3 additions & 3 deletions apps/builddao/widget/MetadataEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ return (
</label>
<CustomImageUpload>
<Widget
src="mob.near/widget/ImageEditorTabs"
src="${alias_mob}/widget/ImageEditorTabs"
props={{
image: state.image,
onChange: (image) => State.update({ image }),
Expand All @@ -124,7 +124,7 @@ return (
{options.backgroundImage.label ?? "Background image"}
</label>
<Widget
src="mob.near/widget/ImageEditorTabs"
src="${alias_mob}/widget/ImageEditorTabs"
props={{
image: state.backgroundImage,
onChange: (backgroundImage) => State.update({ backgroundImage }),
Expand Down Expand Up @@ -158,7 +158,7 @@ return (
<CustomTagEditor className="mb-3">
<label className="mb-2">{options.tags.label ?? "Tags"}</label>
<Widget
src="mob.near/widget/TagsEditor"
src="${alias_mob}/widget/TagsEditor"
props={{
initialTagsObject: metadata.tags,
tagsPattern: options.tags.pattern,
Expand Down
4 changes: 2 additions & 2 deletions apps/builddao/widget/N/Compose.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ return (
>
<div>
<Widget
src="devs.near/widget/Common.Compose"
src="${alias_devs}/widget/Common.Compose"
props={{
placeholder: "What's happening?",
onChange: state.onChange,
Expand Down Expand Up @@ -147,7 +147,7 @@ return (
<div className="px-3">
<Widget
key="post-preview"
src="buildhub.near/widget/components.Post"
src="${config_account}/widget/components.Post"
props={{
accountId: context.accountId,
content: state.content || { type: "md", text: "" },
Expand Down
4 changes: 2 additions & 2 deletions apps/builddao/widget/Notification/Item/Left.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { href } = VM.require("buildhub.near/widget/lib.url") || {
href: () => {}
const { href } = VM.require("${config_account}/widget/lib.url") || {
href: () => {},
};

if (!props.type) {
Expand Down
8 changes: 4 additions & 4 deletions apps/builddao/widget/Notification/Item/Right.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { href } = VM.require("buildhub.near/widget/lib.url") || {
href: () => {}
const { href } = VM.require("${config_account}/widget/lib.url") || {
href: () => {},
};

if (!props.type) {
Expand All @@ -15,8 +15,8 @@ return (
page: props.page,
proposalId: props.params.proposalId,
tab: props.params.tab,
daoId: props.params.daoId
}
daoId: props.params.daoId,
},
})}
>
View
Expand Down
8 changes: 4 additions & 4 deletions apps/builddao/widget/Notification/Item/buildhub.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ const { value } = props;

return (
<Widget
src="mob.near/widget/Notification.Item.LR"
src="${alias_mob}/widget/Notification.Item.LR"
props={{
L: (
<Widget
src="buildhub.near/widget/notification.Item.Left"
src="${config_account}/widget/notification.Item.Left"
props={{ ...value }}
/>
),
R: (
<Widget
src="buildhub.near/widget/notification.Item.Right"
src="${config_account}/widget/notification.Item.Right"
props={{ ...value }}
/>
),
...props
...props,
}}
/>
);
Loading

0 comments on commit 812f0d3

Please sign in to comment.