Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed May 22, 2024
1 parent 8c1ffeb commit d416e3e
Show file tree
Hide file tree
Showing 244 changed files with 10,028 additions and 16,052 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/every-core-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy 'every.near' App Components to Mainnet

on:
push:
branches: [main]

jobs:
deploy-mainnet:
uses: nearbuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
bw-legacy: false
deploy-env: "mainnet"
app-name: "core"
deploy-account-address: every.near
signer-account-address: every.near
signer-public-key:
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.EVERY_CORE_SIGNER_PRIVATE_KEY_MAINNET }}
18 changes: 18 additions & 0 deletions .github/workflows/every-core-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy 'every.near' App Components to Testnet

on:
push:
branches: [develop]

jobs:
deploy-mainnet:
uses: nearbuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
bw-legacy: false
deploy-env: "testnet"
app-name: "core"
deploy-account-address: allthethings.testnet
signer-account-address: allthethings.testnet
signer-public-key:
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.EVERY_CORE_SIGNER_PRIVATE_KEY_TESTNET }}
18 changes: 18 additions & 0 deletions .github/workflows/every-video-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy 'every.video.near' App Components to Mainnet

on:
push:
branches: [main]

jobs:
deploy-mainnet:
uses: nearbuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
bw-legacy: false
deploy-env: "mainnet"
app-name: "video"
deploy-account-address: video.every.near
signer-account-address: video.every.near
signer-public-key: ed25519:4u1tcYqemMsr84btLphGq5wnUKgPSGgTH1ft8tFPhozB
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.EVERY_VIDEO_SIGNER_PRIVATE_KEY_MAINNET }}
18 changes: 18 additions & 0 deletions .github/workflows/every-video-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy 'every.video.near' App Components to Testnet

on:
push:
branches: [main]

jobs:
deploy-mainnet:
uses: nearbuilders/bos-workspace/.github/workflows/deploy.yml@main
with:
bw-legacy: false
deploy-env: "testnet"
app-name: "video"
deploy-account-address: video.allthethings.testnet
signer-account-address: video.allthethings.testnet
signer-public-key:
secrets:
SIGNER_PRIVATE_KEY: ${{ secrets.EVERY_VIDEO_SIGNER_PRIVATE_KEY_TESTNET }}
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
node_modules
.vscode
.DS_Store
/node_modules
/build

/build
/dist
tree.json

test-results
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": false,
"trailingComma": "es5",
"semi": true
}
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
# sdks.near
# every.near

## Setup & Development
## Getting started

Install packages:
1. Install packages

```cmd
yarn
yarn install
```

Start development version:
2. Start dev environment

```cmd
yarn dev
```

This will start both a local gateway (http://127.0.0.1:4040) and http server for loading your local components.

Optionally, to open local widgets in existing, supported gateways:

1. Visit either of the following sites:

- https://near.org/flags
- https://everything.dev/flags

2. Paste the Bos Loader Http URL (http://127.0.0.1:4040/api/loader)
yarn run dev
```
4 changes: 4 additions & 0 deletions aliases.mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mob": "mob.near",
"near": "near"
}
4 changes: 4 additions & 0 deletions aliases.testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mob": "mike.testnet",
"near": "discom.testnet"
}
10 changes: 10 additions & 0 deletions apps/core/bos.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"account": "every.near",
"aliases": ["../../aliases.mainnet.json"],
"overrides": {
"testnet": {
"account": "allthethings.testnet",
"aliases": ["../../aliases.testnet.json"]
}
}
}
3 changes: 3 additions & 0 deletions apps/core/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"every.near": {}
}
18 changes: 18 additions & 0 deletions apps/core/widget/components.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { Avatar } = VM.require("${config_account}/widget/components.ui.avatar");
const { AvatarGroup } = VM.require("${config_account}/widget/components.ui.avatar-group");
const { Badge } = VM.require("${config_account}/widget/components.ui.badge");
const { Button } = VM.require("${config_account}/widget/components.ui.button");
const { Chip } = VM.require("${config_account}/widget/components.ui.chip");
const { Container } = VM.require("${config_account}/widget/components.ui.container");
const { Logo } = VM.require("${config_account}/widget/components.ui.logo");
const { Tag } = VM.require("${config_account}/widget/components.ui.tag");
return {
Avatar,
AvatarGroup,
Badge,
Button,
Chip,
Container,
Logo,
Tag,
};
53 changes: 53 additions & 0 deletions apps/core/widget/components/chips.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const { Chip } = VM.require("${config_account}/widget/components") || {
Chip: () => <></>,
};

const items = props.items ?? [];
const onSelect = props.onSelect ?? (() => {});

const [selectedItems, setSelectedItems] = useState([]);

const handleClick = (item) => {
if (props.multiple) {
if (!selectedItems.includes(item)) {
setSelectedItems((prev) => [...prev, item]);
} else if (selectedItems.includes(item)) {
setSelectedItems((prev) => prev.filter((i) => i !== item));
}
} else {
if (selectedItems !== item) {
setSelectedItems(item);
} else if (selectedItems === item) {
setSelectedItems(null);
}
}
};

useEffect(() => {
onSelect(selectedItems);
}, [selectedItems, onSelect]);

if (items.length === 0) {
return <div>No items passed</div>;
}

const duplicates = items.filter((item, index) => items.indexOf(item) !== index);
if (duplicates.length > 0) {
return <div>Duplicate Items Found</div>;
}

return (
<div className="d-flex align-items-center gap-2 flex-wrap">
{items.map((item) => (
<Chip
key={item}
selected={props.multiple ? selectedItems.includes(item) : selectedItems === item}
onClick={() => handleClick(item)}
size={props.size}
multiple={props.multiple}
>
{item}
</Chip>
))}
</div>
);
Loading

0 comments on commit d416e3e

Please sign in to comment.