Skip to content

Commit

Permalink
init workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Jan 4, 2024
1 parent d45ea18 commit f5539bc
Show file tree
Hide file tree
Showing 45 changed files with 2,587 additions and 5,528 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/release-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Deploy Components to Mainnet
on:
push:
branches: [main]
jobs:
deploy-mainnet:
uses: NEARBuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
deploy-env: "mainnet"
app-name: "bos-blocks"
deploy-account-address: devs.near
signer-account-address: devs.near
signer-public-key: ${{ vars.DEVS_PUBLIC_KEY }}
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.DEVS_PRIVATE_KEY }}
15 changes: 15 additions & 0 deletions .github/workflows/release-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Deploy Components to Testnet
on:
push:
branches: [develop]
jobs:
deploy-mainnet:
uses: NEARBuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
deploy-env: "testnet"
app-name: "bos-blocks"
deploy-account-address: nearbuilders.testnet
signer-account-address: nearbuilders.testnet
signer-public-key: ${{ vars.NEARBUILDERS_TESTNET_PUBLIC_KEY }}
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.NEARBUILDERS_TESTNET_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bos-blocks
# BOS Blocks

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion apps/archive/bos.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"appAccount": "old.near"
"appAccount": "nodeploy.near"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,56 @@ if (!context.accountId) {

const indexKey = props.indexKey ?? "main";
const draftKey = props.indexKey ?? "draft";
const draft = Storage.privateGet(draftKey);
const draft = Storage.privateGet(draftKey); // this should depend on feed key
const groupId = props.groupId;
const postType = props.postType;

if (draft === null) {
return "";
}

const [initialText] = useState(draft);
const [initialText] = useState(draft || postType.template);

function generateUID() {
const maxHex = 0xffffffff;
const randomNumber = Math.floor(Math.random() * maxHex);
return randomNumber.toString(16).padStart(8, "0");
}

const composeData = () => {
const thingId = generateUID();
const data = {
update: {
[thingId]: {
"": JSON.stringify({
content: state.content.text || "",
}),
metadata: {
type: postType.type,
},
},
},
post: {
main: JSON.stringify(Object.assign({ groupId }, state.content)),
main: JSON.stringify({
type: "md",
text: `[EMBED](${context.accountId}/${postType.type}/${thingId})`,
}),
},
index: {
post: JSON.stringify({
key: indexKey,
value: {
type: "md",
post: JSON.stringify([
{
key: indexKey,
value: {
type: "md",
},
},
}),
{
key: postType.type,
value: {
type: "md",
},
},
]),
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

const { Feed } = VM.require("devs.near/widget/Feed") || (() => {});
const { Create } = VM.require("devs.near/widget/Create") || (() => {});
// const { Create } = VM.require("/*__@appAccount__*//widget/Create") || (() => {});

const accountId = context.accountId;

Expand Down Expand Up @@ -36,12 +36,13 @@ function getPersonalizedIndex() {
}
}

// this comes from settings
const availableFeeds = [
{
name: "main",
description: "Main feed",
type: "social",
postTemplate: "devs.near/widget/Post",
postTemplate: "/*__@appAccount__*//widget/Post",
props: {
index: [
{
Expand Down Expand Up @@ -75,7 +76,7 @@ const availableFeeds = [
name: "#dev",
description: "hashtag feed",
type: "social",
postTemplate: "devs.near/widget/Post",
postTemplate: "/*__@appAccount__*//widget/Post",
props: {
index: {
action: "hashtag",
Expand Down Expand Up @@ -103,16 +104,53 @@ const availableFeeds = [
options: {
limit: 10,
order: "desc",
accountId: ["efiz.near"],
accountId: ["/*__@appAccount__*/"],
},
},
},
},
{
name: "updates",
description: "update feed",
type: "social",
postTemplate: "embeds.near/widget/Post.Index",
postType: {
type: "update",
template: `
🔔 DAILY UPDATE: TODAY's DATE
📆 YESTERDAY:
- yesterday I did this [hyperlink proof](link_here)
- I also did this
💻 WHAT I AM DOING TODAY:
- task 1
[+EMBED](https://near.social/)
🛑 BLOCKERS:
-@anyone that is causing a blocker or outline any blockers in general
`,
},
props: {
index: [
{
action: "post",
key: "update",
options: {
limit: 10,
order: "desc",
accountId: undefined,
},
},
],
},
},
{
name: "personalized",
description: "personalized feed",
type: "social",
postTemplate: "mob.near/widget/N.Post",
postTemplate: "mob.near/widget/MainPage.N.Post",
props: {
index: getPersonalizedIndex(),
},
Expand All @@ -128,51 +166,54 @@ const toggleShowCreate = () => {
};

function Content({ data }) {
const { props, postTemplate } = data;
const { props, postTemplate, postType } = data;
return (
<div key={data.name} className="border p-4 rounded">
{showCreate ? (
<Create />
) : (
<Feed
index={props.index}
Item={({ accountId, path, blockHeight, type }) => {
return (
<Widget
src={postTemplate}
props={{
accountId,
path,
blockHeight,
type,
}}
loading={<div className="w-100" style={{ height: "200px" }} />}
/>
);
{context.accountId && (
<Widget
src="/*__@appAccount__*//widget/Compose"
props={{
postType: postType,
}}
Layout={Grid}
/>
)}
<Feed
index={props.index}
Item={({ accountId, path, blockHeight, type }) => {
return (
<Widget
src={postTemplate}
props={{
accountId,
path,
blockHeight,
type,
}}
loading={<div className="w-100" style={{ height: "200px" }} />}
/>
);
}}
/>
</div>
);
}

return (
<div className="container py-4">
<div className="navbar">
<Link className="navbar-brand" to="/devs.near/widget/Dashboard">
<Link className="navbar-brand" to="//*__@appAccount__*//widget/Dashboard">
<h1 className="display-1">every feed</h1>
</Link>
</div>
<div className="row">
<div className="col-md-3 p-4">
<div className="d-flex flex-column gap-2">
<button
{/* <button
className="bg-primary text-white p-2 rounded"
onClick={toggleShowCreate}
>
create
</button>
</button> */}
{availableFeeds.map((it, index) => (
<button
key={index}
Expand Down
41 changes: 0 additions & 41 deletions apps/archive/widget/Module/Feed.jsx

This file was deleted.

Loading

0 comments on commit f5539bc

Please sign in to comment.