├── .eslintignore ├── .eslintrc.json ├── .github ├── CONTRIBUTING.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── build.yml │ ├── stale.yml │ ├── trello-issues.yml │ └── trello-prs.yml ├── .gitignore ├── .gitpod.yml ├── .husky ├── .gitignore └── pre-commit ├── .idea ├── .gitignore ├── discord.xml ├── inspectionProfiles │ └── Project_Default.xml ├── jsLinters │ └── eslint.xml ├── launcher.iml ├── markdown.xml ├── modules.xml ├── vcs.xml └── watcherTasks.xml ├── .prettierignore ├── .prettierrc.json ├── .vscode └── settings.json ├── PRIVACY-POLICY.md ├── README.md ├── dapps.json ├── dotenv ├── index.html ├── package.json ├── postcss.config.js ├── public └── img │ ├── Stakes-social.svg │ ├── chainwiz.png │ └── uzomia.png ├── renovate.json ├── src ├── App.tsx ├── components │ ├── BackButton │ │ └── index.tsx │ ├── Background │ │ └── index.tsx │ ├── Card │ │ └── index.tsx │ ├── CheckBox │ │ └── index.tsx │ ├── ConnectButton │ │ └── index.tsx │ ├── CopyButton │ │ └── index.tsx │ ├── DPLHeader │ │ └── index.tsx │ ├── DPLHr │ │ └── index.tsx │ ├── DPLTitleBar │ │ └── index.tsx │ ├── Detail │ │ └── index.tsx │ ├── Footer │ │ └── index.tsx │ ├── Form │ │ ├── FormInput.tsx │ │ ├── FormInputLabel.tsx │ │ └── index.tsx │ ├── HSButton │ │ └── index.tsx │ ├── HSTextField │ │ └── index.tsx │ ├── HomeNavItem │ │ └── index.tsx │ ├── HowItWorks │ │ ├── FaqCard.tsx │ │ ├── StepsCard.tsx │ │ └── index.tsx │ ├── NavTabs │ │ └── index.tsx │ ├── ProgressStepper │ │ ├── ProgressStep.tsx │ │ ├── ProgressStepper.scss │ │ └── index.tsx │ ├── Spinner │ │ └── index.tsx │ ├── TitleSubSection │ │ └── index.tsx │ └── Tweet │ │ └── index.tsx ├── const │ ├── cache-path.ts │ └── index.ts ├── context │ ├── tokenizeContext.tsx │ └── walletContext.ts ├── css │ └── background.css ├── env.d.ts ├── favicon.svg ├── hooks │ ├── useAddToWalletList.ts │ ├── useAllowance.ts │ ├── useApprove.ts │ ├── useEnabledMarkets.ts │ ├── useMarket.ts │ ├── useMetrics.ts │ ├── usePosition.ts │ ├── usePositionsOfOwner.ts │ ├── usePropertyBalances.ts │ ├── usePropertyDetails.ts │ └── useTerms.ts ├── img │ ├── ANPAO.svg │ ├── CARD.svg │ ├── FOOTER_IMG_ Powered by Dev Protocol.png │ ├── FOOTER_IMG_Powered by Dev Protocol.svg │ ├── HEADING_TEXTURE.png │ ├── PURSE.svg │ ├── SEEDLING.svg │ ├── g-logo.png │ ├── logo.png │ ├── og.png │ └── uzomia.svg ├── index.css ├── main.tsx ├── pages │ ├── apps │ │ ├── AppGridItem.tsx │ │ └── index.tsx │ ├── auth-callback │ │ ├── DiscordAuthCallback.tsx │ │ ├── YouTubeAuthCallback.tsx │ │ └── index.tsx │ ├── errors │ │ └── 404.tsx │ ├── growth │ │ └── index.tsx │ ├── home │ │ └── index.tsx │ ├── how-it-works │ │ └── index.tsx │ ├── markdown-page │ │ ├── MarkdownPage.module.scss │ │ └── index.tsx │ ├── network-select │ │ └── index.tsx │ ├── properties │ │ ├── PropertyTabsContainer │ │ │ └── index.tsx │ │ ├── ProperySummary │ │ │ └── index.tsx │ │ ├── index.tsx │ │ ├── property-holders │ │ │ └── index.tsx │ │ ├── property-overview │ │ │ ├── StakeOption.tsx │ │ │ ├── fetch-token-data.hook.tsx │ │ │ └── index.tsx │ │ ├── property-stakers │ │ │ ├── index.tsx │ │ │ └── useSTokensPositionsOfProperty.ts │ │ └── stake │ │ │ ├── StakeStep.tsx │ │ │ ├── index.tsx │ │ │ └── useLockup.ts │ ├── tokenize-form │ │ ├── DiscordForm.tsx │ │ ├── GithubForm.tsx │ │ ├── TermsModal.tsx │ │ ├── YouTubeForm.tsx │ │ └── index.tsx │ ├── tokenize-market-select │ │ ├── TokenizeLink.tsx │ │ └── index.tsx │ ├── tokenize-submit │ │ ├── TokenizePreviewSubmit.tsx │ │ ├── TokenizeResult.tsx │ │ ├── index.tsx │ │ └── tokenize-submit.hooks.ts │ ├── user-positions-list │ │ ├── UserPositionListItem.tsx │ │ └── index.tsx │ ├── user-properties-list │ │ ├── UserTokenListItem.tsx │ │ ├── fetchUserProperties.hook.tsx │ │ └── index.tsx │ └── wait-market │ │ └── index.tsx ├── types │ ├── AddressContractContainer.ts │ └── TokenizeWindowState.ts ├── utils │ ├── utils.test.ts │ └── utils.ts ├── vite-env.d.ts └── vite.d.ts ├── tailwind.config.js ├── tsconfig.json ├── vercel.json ├── vite.config.ts └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | cjs 4 | esm 5 | __snapshots__ -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "node": true, 6 | "jest": true 7 | }, 8 | "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"], 9 | "globals": { 10 | "Atomics": "readonly", 11 | "SharedArrayBuffer": "readonly" 12 | }, 13 | "parser": "@typescript-eslint/parser", 14 | "parserOptions": { 15 | "sourceType": "module", 16 | "project": "./tsconfig.json", 17 | "tsconfigRootDir": ".", 18 | "ecmaFeatures": { 19 | "tsx": true 20 | } 21 | }, 22 | "plugins": ["@typescript-eslint", "react", "react-hooks"], 23 | "rules": { 24 | "no-unused-vars": "off", 25 | "@typescript-eslint/no-unused-vars": [ 26 | "warn", 27 | { 28 | "argsIgnorePattern": "^_", 29 | "varsIgnorePattern": "^_", 30 | "caughtErrorsIgnorePattern": "^_" 31 | } 32 | ], 33 | "react/prop-types": "off", 34 | "react-hooks/rules-of-hooks": "error", 35 | "react-hooks/exhaustive-deps": "warn", 36 | "require-atomic-updates": "off", 37 | "no-console": "off", 38 | "react/react-in-jsx-scope": "off" 39 | }, 40 | "settings": { 41 | "react": { 42 | "version": "detect" 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guide 2 | 3 | ## How to contribute? 4 | 5 | You can find problems from [Issues](https://github.com/dev-protocol/stakes.social/issues) or fix other problems. 6 | 7 | Basic Pull Request steps: 8 | 9 | 1. Fork this repository 10 | 1. Create your feature branch: `git checkout -b awesome-feature` 11 | 1. Commit your changes: `git commit -am "Add awesome feature"` 12 | 1. Push to the branch: `git push origin awesome-feature` 13 | 1. Submit a pull request to this repository 14 | 15 | ## How to start development? 16 | 17 | First as follows: 18 | 19 | ``` 20 | git clone git@github.com:YOUR-USERNAME/stakes.social.git 21 | cd stakes.social 22 | ``` 23 | 24 | How to run on local: 25 | 26 | ```bash 27 | # install npm packages 28 | $ yarn 29 | 30 | # build deps 31 | $ yarn build 32 | 33 | # web run 34 | $ yarn dev 35 | ``` 36 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Proposed Changes 2 | 3 | ## Implementation 4 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | node-version: ['18'] 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Use Node.js ${{ matrix.node-version }} 16 | uses: actions/setup-node@v2 17 | with: 18 | node-version: ${{ matrix.node-version }} 19 | 20 | - name: install deps 21 | run: yarn 22 | 23 | - name: lint 24 | run: yarn lint 25 | 26 | - name: build 27 | run: yarn build 28 | 29 | - name: test 30 | run: yarn test 31 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: 'Close stale issues and PRs' 2 | on: 3 | schedule: 4 | - cron: '30 1 * * *' 5 | 6 | permissions: 7 | issues: write 8 | pull-requests: write 9 | 10 | jobs: 11 | stale: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/stale@v4 15 | with: 16 | stale-issue-message: 'This issue is inactive and so will be closed automatically.' 17 | stale-pr-message: 'This pull-request is inactive and so will be closed automatically.' 18 | -------------------------------------------------------------------------------- /.github/workflows/trello-issues.yml: -------------------------------------------------------------------------------- 1 | name: Create Trello card on opened issues 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | create_trello_card_job: 9 | runs-on: ubuntu-latest 10 | name: Create Trello Card 11 | steps: 12 | - name: Call trello-github-actions 13 | uses: Yleisradio/github-action-trello-integration@v1.1.0 14 | with: 15 | action: issue_opened_create_card 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }} 19 | TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }} 20 | # TRELLO_BOARD_ID must match a board. GH repo should connect 21 | # to exactly one board, but Trello board may connect to multiple 22 | # GH repositories. 23 | TRELLO_BOARD_ID: 621c8575d0c3135b08c625f3 24 | # Backlog list ID 25 | TRELLO_LIST_ID: 621c85809ffbb6647c38fb07 26 | -------------------------------------------------------------------------------- /.github/workflows/trello-prs.yml: -------------------------------------------------------------------------------- 1 | name: Move Trello Card to Needs review list 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, reopened] 6 | #types: closed #for merged or just closed PRs 7 | branches: 8 | - main 9 | 10 | jobs: 11 | move_card_when_pull_request_merged_job: 12 | runs-on: ubuntu-latest 13 | name: Move Trello Card to Needs review when Card refers to the issue referred by PR 14 | steps: 15 | - name: Call trello-github-actions 16 | id: call-trello-github-actions 17 | uses: Yleisradio/github-action-trello-integration@v1.1.0 18 | with: 19 | action: pull_request_event_move_card 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }} 23 | TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }} 24 | TRELLO_BOARD_ID: 621c8575d0c3135b08c625f3 25 | # List "In progress" 26 | TRELLO_SOURCE_LIST_ID: 621c85809ffbb6647c38fb07 27 | # List "Needs review" 28 | TRELLO_TARGET_LIST_ID: 621f03bfc181d9161e31c14b 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | 7 | .vercel 8 | .env -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | tasks: 6 | - init: yarn install && yarn run build 7 | command: yarn run dev 8 | vscode: 9 | extensions: 10 | - dbaeumer.vscode-eslint 11 | 12 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint-staged --allow-empty 5 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.idea/discord.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/jsLinters/eslint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/launcher.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/markdown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | # Ignore artifacts: 3 | build 4 | coverage 5 | src/reportWebVitals.ts 6 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false, 4 | "printWidth": 120, 5 | "trailingComma": "none", 6 | "arrowParens": "avoid" 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll": true 4 | }, 5 | "editor.formatOnSave": true, 6 | "eslint.validate": ["javascript", "typescript"], 7 | "[typescript]": { 8 | "editor.defaultFormatter": "esbenp.prettier-vscode" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Niwa 2 | 3 | ## Development 4 | 5 | For local development please create a .env file using the dotenv file found in the root folder as a template 6 | 7 | ``` 8 | # this can be arbitrum-one, polygon-mainnet, or polygon-mumbai 9 | VITE_L2_NETWORK=polygon-mumbai 10 | VITE_INFURA_PROJECT_ID= 11 | VITE_INFURA_BASE_ENDPOINT= 12 | VITE_IS_ROOT= # boolean 13 | ``` 14 | 15 | Setting `VITE_IS_ROOT` to `true` will prompt the network select page. 16 | Otherwise, it will route to whatever `VITE_L2_NETWORK` you have setup with correct Infura details. 17 | 18 | ### use OAuth YouTube Account 19 | 20 | The following environment variables need to be set: 21 | 22 | ``` 23 | VITE_YOUTUBE_CLIENT_ID=XXX.apps.googleusercontent.com 24 | VITE_YOUTUBE_AUTH_REDIRECT_URI=https://HOST:PORT/auth/youtube/callback 25 | ``` 26 | 27 | See also: 28 | https://developers.google.com/youtube/v3/getting-started 29 | 30 | ### use OAuth Discord Account 31 | 32 | The following environment variables need to be set: 33 | 34 | ``` 35 | VITE_DISCORD_CLIENT_ID=YOUR_CLIENT_ID 36 | VITE_DISCORD_CLIENT_SECRET=YOUR_CLIENT_SECRET 37 | VITE_DISCORD_AUTH_REDIRECT_URI=http://HOST:PORT/auth/discord/callback 38 | ``` 39 | 40 | See also: 41 | https://discord.com/developers/docs/topics/oauth2 42 | 43 | ### Adding your dApp to the Apps Page 44 | 45 | Create a PR with your dapp added in `dapps.json` file in the root directory. 46 | -------------------------------------------------------------------------------- /dapps.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Stakes Social", 4 | "url": "https://stakes.social", 5 | "description": "Explore projects and support your favorite creators", 6 | "logoUrl": "/img/Stakes-social.svg" 7 | }, 8 | { 9 | "name": "μ-zomia", 10 | "url": "https://mzomia.social/", 11 | "description": "μ-zomia is a platform and community for people who love music, people who are involved in music, and people who want to support it to support each other.", 12 | "logoUrl": "/img/uzomia.png" 13 | }, 14 | { 15 | "name": "Chainwiz", 16 | "url": "https://www.chainwhiz.app/", 17 | "description": "Chainwhiz is an open-source bounty marketplace connecting Web3 projects with builders and communities. Work on bounties from fields like Front End, Back End, Design, Article-writing, and others and get paid in cryptocurrency.", 18 | "logoUrl": "/img/chainwiz.png" 19 | } 20 | ] -------------------------------------------------------------------------------- /dotenv: -------------------------------------------------------------------------------- 1 | # this can be arbitrum-one, polygon-mainnet, or polygon-mumbai 2 | 3 | VITE_L2_NETWORK=polygon-mumbai 4 | VITE_INFURA_PROJECT_ID= 5 | VITE_INFURA_BASE_ENDPOINT= 6 | VITE_IS_ROOT= 7 | 8 | # for YouTube 9 | 10 | VITE_YOUTUBE_CLIENT_ID=XXX.apps.googleusercontent.com 11 | VITE_YOUTUBE_AUTH_REDIRECT_URI=https://HOST:PORT/auth/youtube/callback 12 | 13 | #for Discord 14 | VITE_DISCORD_CLIENT_ID=YOUR_CLIENT_ID 15 | VITE_DISCORD_CLIENT_SECRET=YOUR_CLIENT_SECRET 16 | VITE_DISCORD_AUTH_REDIRECT_URI=http://HOST:PORT/auth/discord/callback 17 | VITE_WALLET_CONNECT_PROJECT_ID=VITE_WALLET_CONNECT_PROJECT_ID 18 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Niwa 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 26 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "launchpad", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "tsc && vite build", 7 | "preview": "vite preview", 8 | "lint": "eslint --fix -c ./.eslintrc.json './src/**/*.{ts,tsx}'", 9 | "test": "vitest", 10 | "coverage": "vitest --coverage" 11 | }, 12 | "dependencies": { 13 | "@devprotocol/dev-kit": "6.0.9", 14 | "@devprotocol/khaos-kit": "^1.4.0", 15 | "@devprotocol/util-ts": "^2.2.1", 16 | "@metamask/detect-provider": "^1.2.0", 17 | "@typescript-eslint/eslint-plugin": "^6.7.0", 18 | "@typescript-eslint/parser": "^6.7.0", 19 | "@walletconnect/web3-provider": "^1.7.1", 20 | "@web3modal/wagmi": "3.0.0-alpha.5", 21 | "browserify-zlib": "^0.2.0", 22 | "eslint": "^8.49.0", 23 | "eslint-config-prettier": "^9.0.0", 24 | "eslint-plugin-prettier": "^5.0.0", 25 | "eslint-plugin-react": "^7.33.2", 26 | "eslint-plugin-react-hooks": "^4.6.0", 27 | "ethers": "^5.5.2", 28 | "events": "^3.3.0", 29 | "prettier": "^3.0.3", 30 | "prettier-plugin-tailwindcss": "^0.5.4", 31 | "process": "^0.11.10", 32 | "react": "^17.0.2", 33 | "react-dom": "^17.0.2", 34 | "react-icons": "^4.3.1", 35 | "react-markdown": "^9.0.0", 36 | "react-router-dom": "^6.2.1", 37 | "rehype-raw": "^7.0.0", 38 | "sass": "^1.49.0", 39 | "stream-browserify": "^3.0.0", 40 | "swr": "^1.1.2", 41 | "tailwindcss": "^3.0.18", 42 | "util": "^0.12.4", 43 | "viem": "^1.10.9", 44 | "wagmi": "^1.4.1", 45 | "web3": "^1.6.1" 46 | }, 47 | "devDependencies": { 48 | "@babel/preset-react": "7.16.7", 49 | "@devprotocol/khaos-core": "1.6.0", 50 | "@rollup/plugin-inject": "4.0.4", 51 | "@types/jest": "27.4.1", 52 | "@types/react": "17.0.43", 53 | "@types/react-dom": "17.0.14", 54 | "@vitejs/plugin-react": "1.3.0", 55 | "autoprefixer": "10.4.16", 56 | "postcss": "8.4.12", 57 | "typescript": "^5.2.2", 58 | "vite": "2.9.1", 59 | "vite-plugin-markdown": "2.1.0", 60 | "vitest": "0.9.3" 61 | }, 62 | "exports": { 63 | ".": { 64 | "import": "./index.esm.js", 65 | "require": "./index.cjs.js" 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/img/Stakes-social.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/img/chainwiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-protocol/niwa/66eb9dedc30ce9700ff636fa09fcffeeae479649/public/img/chainwiz.png -------------------------------------------------------------------------------- /public/img/uzomia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dev-protocol/niwa/66eb9dedc30ce9700ff636fa09fcffeeae479649/public/img/uzomia.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "enabled": false 3 | } -------------------------------------------------------------------------------- /src/App.tsx: -------------------------------------------------------------------------------- 1 | import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom' 2 | import Home from './pages/home' 3 | import UserPropertiesListPage from './pages/user-properties-list' 4 | import UserPositionsListPage from './pages/user-positions-list' 5 | import GrowthPage from './pages/growth' 6 | import PropertyOverviewPage from './pages/properties/property-overview' 7 | import TokenizeMarketSelect from './pages/tokenize-market-select' 8 | import TokenizeFormPage from './pages/tokenize-form' 9 | import TokenizeSubmit from './pages/tokenize-submit' 10 | import AuthCallbackPage from './pages/auth-callback' 11 | 12 | import ConnectButton from './components/ConnectButton' 13 | import DPLHeader from './components/DPLHeader' 14 | 15 | import { useWalletProviderContext, WalletContext } from './context/walletContext' 16 | import { TokenizeProvider } from './context/tokenizeContext' 17 | 18 | import PageNotFound from './pages/errors/404' 19 | import StakePage from './pages/properties/stake' 20 | import NetworkSelectPage from './pages/network-select' 21 | import { Background } from './components/Background' 22 | import WaitMarketPage from './pages/wait-market' 23 | import MarkdownPage from './pages/markdown-page' 24 | import { ReactComponent as PrivacyPolicy } from '../PRIVACY-POLICY.md' 25 | import Footer from './components/Footer' 26 | import PropertyHoldersPage from './pages/properties/property-holders' 27 | import PropertyOutlet from './pages/properties' 28 | import PropertyTabsContainer from './pages/properties/PropertyTabsContainer' 29 | import AppsPage from './pages/apps' 30 | import HowItWorksPage from './pages/how-it-works' 31 | import PropertyStakersPage from './pages/properties/property-stakers' 32 | import { useTerms } from './hooks/useTerms' 33 | import ReactMarkdown from 'react-markdown' 34 | import rehypeRaw from 'rehype-raw' 35 | 36 | function App() { 37 | const walletProviderContext = useWalletProviderContext() 38 | const isRoot = import.meta.env.VITE_IS_ROOT === 'true' 39 | const { terms } = useTerms() 40 | 41 | return ( 42 |
43 | 44 |
45 | {isRoot && ( 46 | 47 |
48 |
49 | 50 |
51 | 52 | } /> 53 | {}} /> 54 | 58 | {{terms}} 59 | 60 | } 61 | /> 62 | } /> 63 | } /> 64 | 65 |
66 |
67 |
68 |
69 |
70 | )} 71 | 72 | {!isRoot && ( 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 |
81 | 82 | 83 | } /> 84 | } /> 85 | } /> 86 | } /> 87 | 88 | }> 89 | } /> 90 | }> 91 | } /> 92 | } /> 93 | } /> 94 | 95 | 96 | } /> 97 | } /> 98 | } /> 99 | } /> 100 | } /> 101 | } /> 102 | {}} /> 103 | 107 | {{terms}} 108 | 109 | } 110 | /> 111 | } /> 112 | } /> 113 | 114 | 115 |
116 |
117 |
119 |
120 |
121 | )} 122 |
123 |
124 | ) 125 | } 126 | 127 | export default App 128 | -------------------------------------------------------------------------------- /src/components/BackButton/index.tsx: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | import { FaChevronLeft } from 'react-icons/fa' 3 | import { Link } from 'react-router-dom' 4 | 5 | interface BackButtonProps { 6 | title: string 7 | path: string 8 | } 9 | 10 | const BackButton: FunctionComponent = ({ title, path }) => { 11 | return ( 12 |
13 | 14 | 15 | {title} 16 | 17 |
18 | ) 19 | } 20 | 21 | export default BackButton 22 | -------------------------------------------------------------------------------- /src/components/Background/index.tsx: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | 3 | interface BackgroundProps {} 4 | 5 | const Background: FunctionComponent = () => { 6 | return
7 | } 8 | 9 | export { Background } 10 | -------------------------------------------------------------------------------- /src/components/Card/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface CardProps { 4 | isDisabled?: boolean 5 | } 6 | 7 | const Card: React.FC = ({ children, isDisabled = false }) => { 8 | return ( 9 |
14 | {children} 15 |
16 | ) 17 | } 18 | 19 | export default Card 20 | -------------------------------------------------------------------------------- /src/components/CheckBox/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface CheckBoxProps { 4 | isChecked: boolean 5 | text: string 6 | name: string 7 | onChange: () => {} 8 | } 9 | 10 | const CheckBox: React.FC = ({ isChecked, text, name, onChange }) => { 11 | return ( 12 | 16 | ) 17 | } 18 | 19 | export default CheckBox 20 | -------------------------------------------------------------------------------- /src/components/ConnectButton/index.tsx: -------------------------------------------------------------------------------- 1 | import { providers } from 'ethers' 2 | import { whenDefined } from '@devprotocol/util-ts' 3 | import React, { useEffect, useState } from 'react' 4 | import { useProvider } from '../../context/walletContext' 5 | import HSButton from '../HSButton' 6 | import { Link } from 'react-router-dom' 7 | import { FaChevronRight, FaExclamationTriangle } from 'react-icons/fa' 8 | import { crunchAddress, deployedNetworkToReadable } from '../../utils/utils' 9 | import { WagmiConfig } from 'wagmi' 10 | import { watchWalletClient } from '@wagmi/core' 11 | import { polygonMumbai, polygon, mainnet } from 'wagmi/chains' 12 | import { createWeb3Modal, defaultWagmiConfig, useWeb3Modal } from '@web3modal/wagmi/react' 13 | 14 | type ConnectButtonParams = {} 15 | 16 | const web3ModalProjectId = import.meta.env.VITE_WALLET_CONNECT_PROJECT_ID || '' 17 | const chains = [polygonMumbai, polygon, mainnet] 18 | const wagmiConfig = defaultWagmiConfig({ chains, projectId: web3ModalProjectId, appName: 'Niwa' }) 19 | createWeb3Modal({ wagmiConfig, projectId: web3ModalProjectId, chains }) 20 | 21 | const ConnectButton: React.FC = () => { 22 | const [address, setAddress] = useState(null) 23 | 24 | const web3Modal = useWeb3Modal() 25 | const { ethersProvider, setEthersProvider, isValidConnectedNetwork } = useProvider() 26 | 27 | useEffect(() => { 28 | watchWalletClient({}, wallet => { 29 | whenDefined(wallet, async wal => { 30 | const connectedProvider = wal.transport 31 | const newProvider = whenDefined(connectedProvider, p => new providers.Web3Provider(p)) 32 | setEthersProvider(newProvider) 33 | }) ?? setEthersProvider(undefined) 34 | }) 35 | }) 36 | 37 | useEffect(() => { 38 | const getProvider = async (): Promise => { 39 | if (ethersProvider) { 40 | const currentAddress = await ethersProvider.getSigner().getAddress() 41 | setAddress(currentAddress) 42 | } else { 43 | setAddress(null) 44 | } 45 | } 46 | 47 | getProvider() 48 | }, [ethersProvider]) 49 | 50 | return ( 51 | 52 |
53 | {address && ( 54 |
55 |
56 | {isValidConnectedNetwork && ( 57 |
58 | {deployedNetworkToReadable()} 59 |
60 |
61 | 62 | {crunchAddress(address)} 63 | 64 | 65 |
66 |
67 | )} 68 | {!isValidConnectedNetwork && ( 69 |
70 | 71 |
72 | Connect Wallet to {deployedNetworkToReadable()} 73 |
74 |
75 | )} 76 |
77 |
78 | )} 79 | {!address && ( 80 | web3Modal.open()} type="filled"> 81 | Connect Wallet 82 | 83 | )} 84 |
85 |
86 | ) 87 | } 88 | 89 | export default ConnectButton 90 | -------------------------------------------------------------------------------- /src/components/CopyButton/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { FaRegCopy } from 'react-icons/fa' 3 | 4 | interface CopyButtonProps { 5 | textToCopy: string 6 | } 7 | 8 | const CopyButton: React.FC = ({ textToCopy }) => { 9 | const copyToClipboard = () => navigator.clipboard.writeText(textToCopy) 10 | 11 | return ( 12 | 15 | ) 16 | } 17 | 18 | export default CopyButton 19 | -------------------------------------------------------------------------------- /src/components/DPLHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router-dom' 3 | 4 | interface LauncherHeaderProps { 5 | // Props 6 | } 7 | 8 | const LauncherHeader: React.FC = ({ children }) => { 9 | return ( 10 |
11 |
12 | 13 |

Niwa

14 | 15 | Social Token Launcher for DAOs 16 |
17 |
{children}
18 |
19 | ) 20 | } 21 | 22 | export default LauncherHeader 23 | -------------------------------------------------------------------------------- /src/components/DPLHr/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface DPLHrProps { 4 | // Props 5 | } 6 | 7 | const DPLHr: React.FC = () => { 8 | return
9 | } 10 | 11 | export { DPLHr } 12 | -------------------------------------------------------------------------------- /src/components/DPLTitleBar/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface DPLTitleBarProps { 4 | title: string 5 | className?: string 6 | } 7 | 8 | const DPLTitleBar: React.FC = ({ title, className }) => { 9 | return ( 10 | <> 11 |

14 | {title} 15 |

16 | 17 | ) 18 | } 19 | 20 | export default DPLTitleBar 21 | -------------------------------------------------------------------------------- /src/components/Detail/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface DetailProps { 4 | label: string 5 | valueElem: React.ReactElement 6 | } 7 | 8 | const Detail: React.FC = ({ label, valueElem }) => { 9 | return ( 10 |
11 | {label} 12 | {valueElem} 13 |
14 | ) 15 | } 16 | 17 | export default Detail 18 | -------------------------------------------------------------------------------- /src/components/Footer/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { FaDiscord, FaGithubSquare } from 'react-icons/fa' 3 | import { Link } from 'react-router-dom' 4 | import { DEPLOYMENTS } from '../../const' 5 | import { DPLHr } from '../DPLHr' 6 | import FooterImg from '../../img/FOOTER_IMG_Powered by Dev Protocol.svg' 7 | 8 | interface FooterProps {} 9 | 10 | interface DPLFooterProps { 11 | className?: string 12 | } 13 | 14 | const DPLFooter: React.FC = ({ className, children }) => { 15 | return ( 16 |
17 | 18 |
{children}
19 |
20 | ) 21 | } 22 | 23 | const DPLFooterSection: React.FC = ({ children }) => { 24 | return
{children}
25 | } 26 | 27 | const Footer: React.FC = () => { 28 | return ( 29 | 30 |
31 | 32 |
33 | 42 | 48 |
49 |
    50 |
  • 51 | Terms and Conditions 52 |
  • 53 |
  • 54 | Privacy Policy 55 |
  • 56 |
57 | 69 |
70 | 71 | 72 | Footer Image 73 | 74 | 75 |
76 |
77 | ) 78 | } 79 | 80 | export default Footer 81 | -------------------------------------------------------------------------------- /src/components/Form/FormInput.tsx: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | 3 | interface FormInputProps { 4 | id: string 5 | placeholder?: string 6 | value: string 7 | onChange: (val: string) => void 8 | disabled: boolean 9 | } 10 | 11 | const FormInput: FunctionComponent = ({ id, placeholder, value, onChange, disabled }) => { 12 | return ( 13 | onChange(e.target.value)} 18 | disabled={disabled} 19 | /> 20 | ) 21 | } 22 | 23 | export default FormInput 24 | -------------------------------------------------------------------------------- /src/components/Form/FormInputLabel.tsx: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from 'react' 2 | 3 | interface FormInputLabelProps { 4 | label: string 5 | id: string 6 | required: boolean 7 | } 8 | 9 | const FormInputLabel: FunctionComponent = ({ label, id, required }) => { 10 | return ( 11 | 15 | ) 16 | } 17 | 18 | export default FormInputLabel 19 | -------------------------------------------------------------------------------- /src/components/Form/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import HSTextField from '../HSTextField' 3 | 4 | interface FormFieldProps { 5 | label: string 6 | id: string 7 | required?: boolean 8 | placeholder?: string 9 | disabled?: boolean 10 | value: string 11 | isError?: boolean 12 | onChange?: (val: string) => void 13 | } 14 | 15 | const FormField: React.FC = ({ 16 | label, 17 | id, 18 | required = false, 19 | disabled = false, 20 | placeholder, 21 | value, 22 | onChange, 23 | isError, 24 | children 25 | }) => { 26 | return ( 27 |
28 | (onChange ? onChange(val) : () => {})} 35 | isError={isError} 36 | isRequired={required} 37 | isDisabled={disabled} 38 | > 39 | {children} 40 | 41 |
42 | ) 43 | } 44 | 45 | export default FormField 46 | -------------------------------------------------------------------------------- /src/components/HSButton/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router-dom' 3 | 4 | type ButtonStyle = 'outlined' | 'filled' | 'danger' | 'success' 5 | 6 | interface HSButtonProps { 7 | label?: string 8 | icon?: React.ReactElement | string 9 | type?: ButtonStyle 10 | link?: string 11 | context?: 'button' | 'submit' | 'reset' | undefined 12 | onClick?: React.MouseEventHandler | (() => void) 13 | isDisabled?: boolean 14 | } 15 | 16 | const HSButton: React.FC = ({ 17 | label, 18 | icon, 19 | type = 'filled', 20 | link, 21 | onClick, 22 | isDisabled, 23 | children, 24 | context = 'button' 25 | }) => { 26 | const assertBackground = (type: ButtonStyle) => { 27 | switch (type) { 28 | case 'filled': 29 | return 'bg-black' 30 | case 'danger': 31 | case 'success': 32 | return 'bg-white' 33 | 34 | case 'outlined': 35 | return 'transparent' 36 | 37 | default: 38 | return 'bg-blue-500' 39 | } 40 | } 41 | 42 | const assertText = (type: ButtonStyle) => { 43 | switch (type) { 44 | case 'filled': 45 | return 'text-white' 46 | case 'outlined': 47 | return 'text-blue' 48 | case 'danger': 49 | return 'text-red' 50 | case 'success': 51 | return 'text-success' 52 | 53 | default: 54 | return 'bg-blue-500' 55 | } 56 | } 57 | 58 | const assertBorder = (type: ButtonStyle) => { 59 | switch (type) { 60 | case 'outlined': 61 | return 'border-blue-400 border-2 hover:border-blue-700' 62 | case 'danger': 63 | return 'border-red-500' 64 | case 'success': 65 | return 'border-success' 66 | case 'filled': 67 | default: 68 | return 'border-transparent' 69 | } 70 | } 71 | 72 | const btnStyles = { 73 | background: assertBackground(type), 74 | text: assertText(type), 75 | border: assertBorder(type) 76 | } 77 | 78 | const ButtonBase = ( 79 | 91 | ) 92 | 93 | if (!link) { 94 | return ButtonBase 95 | } else { 96 | const isLinkExternal: boolean = link.charAt(0) !== '/' && link.charAt(0) !== '#' 97 | return isLinkExternal ? ( 98 | 99 | {ButtonBase} 100 | 101 | ) : ( 102 | {ButtonBase} 103 | ) 104 | } 105 | } 106 | 107 | export default HSButton 108 | -------------------------------------------------------------------------------- /src/components/HSTextField/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | interface HSTextFieldProps { 4 | name: string 5 | label: string 6 | type: string 7 | placeholder?: string 8 | value?: string 9 | isError?: boolean 10 | isRequired?: boolean 11 | isDisabled?: boolean 12 | onChange: (val: string) => void 13 | } 14 | 15 | const HSTextField: React.FC = ({ 16 | name, 17 | label, 18 | type, 19 | placeholder, 20 | value, 21 | isError, 22 | isRequired, 23 | isDisabled, 24 | onChange, 25 | children 26 | }) => { 27 | const inputClasses = 'border border-gray-300 rounded py-2 px-sm' 28 | 29 | return ( 30 |