diff --git a/.eslintrc.json b/.eslintrc.json index 7d1400ec..8f4f836e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,9 +1,5 @@ { - "extends": [ - "plugin:storybook/recommended", - "next/core-web-vitals", - "prettier" - ], + "extends": ["next/core-web-vitals", "prettier"], "rules": { "no-unused-vars": "warn", "no-undef": "warn", @@ -13,15 +9,5 @@ "react/no-unescaped-entities": "off", "@next/next/no-page-custom-font": "off", "no-duplicate-imports": ["error", { "includeExports": true }] - }, - "overrides": [ - { - "files": ["*.stories.@(ts|tsx|js|jsx|mjs|cjs)"], - "rules": { - "storybook/hierarchy-separator": "error", - "storybook/default-exports": "off", - "import/no-anonymous-default-export": "off" - } - } - ] + } } diff --git a/.github/labeler.yml b/.github/labeler.yml index ee750d1d..064ab196 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,19 +1,16 @@ -# Storybook -'πŸ“documentation': - - src/stories/**/* - - README.md - - CONTRIBUTING.md - - '*.md' +documentation: + - any: ['docs/**/*', '*.md'] + +workflow: + - any: + ['.github/**/*', '.husky/**/*', '.vscode/**/*', '.github/workflow/**/*'] # Chore 'chore': - dependencies/**/* - public/**/* - package.json - - .github/**/* - - .vscode/**/* - - .storybook/**/* - '*' -'⚠️BREAKING CHANGES!!!': +'BREAKING CHANGES': - src/assets/**/* diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a5c9c335..081e75b4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,17 +1,12 @@ - - ## Description - -### Type of change +#### Type of change -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Refactor ( rewrite or restructure code) -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- ### Checklist: @@ -27,3 +22,5 @@ - none + + diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 0c206f14..ca94af3f 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,31 +1,36 @@ name-template: 'v$RESOLVED_VERSION' tag-template: 'v$RESOLVED_VERSION' + categories: + - title: '⚠️Breaking Changes' + labels: + - 'breaking-changes' + - 'BREAKING CHANGES' - title: 'πŸš€ Features' labels: - 'feat' - - 'feature' - 'enhancement' - - 'chore:pages' - 'styles' - title: 'πŸ› Bug Fixes' labels: - 'fix' - - 'bugfix' - 'bug' - title: '🧰 Maintenance' labels: - 'chore' - 'styles:global' - - 'source' + - 'refactor' + - 'workflow' - title: '🧺 Miscellaneous' #Everything except ABAP labels: - 'misc' - 'utils' - 'assests' - - 'workflow' + collapse-after: 3 + change-template: '- $TITLE @$AUTHOR (#$NUMBER)' change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. + version-resolver: major: labels: @@ -37,19 +42,59 @@ version-resolver: labels: - 'patch' default: patch + +exclude-labels: + - 'release:changelog' + - 'skip' + template: | - ## Changes + ## What's Changed $CHANGES + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION + autolabeler: - label: 'bug' branch: - '/fix\/.+/' title: - '/fix/i' + + - label: 'chore' + branch: + - '/chore\/.+/' + - '/ci\/.+/' + title: + - '/chore/i' + - '/ci/i' + - label: 'feat' + title: + - '/feat/i' branch: - '/feat\/.+/' - body: - - '/\/issues\//' + + - label: 'refactor' + branch: + - '/refactor\/.+/' + title: + - '/refactor:/i' + + - label: 'style' + branch: + - '/style\/.+/' + title: + - '/style:/i' + + - label: 'test' + branch: + - '/test\/.+/' + title: + - '/test/i' + + - label: 'workflow' + branch: + - '/ci\/.+/' + title: + - '/ci:/i' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 6627974e..ca694de4 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -8,6 +8,7 @@ jobs: contents: read pull-requests: write runs-on: ubuntu-latest + if: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/labeler@v4 with: diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index a72f2877..3886a68e 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -14,17 +14,31 @@ permissions: contents: read jobs: - update_release_draft: + auto_labeler: + name: auto-label + runs-on: ubuntu-latest + if: ${{ github.ref != 'refs/heads/main' }} permissions: contents: write # for release-drafter/release-drafter to create a github release pull-requests: write # for release-drafter/release-drafter to add label to PR + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + update_release_draft: + name: release-drafter runs-on: ubuntu-latest + if: ${{github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'}} + permissions: + contents: write # for release-drafter/release-drafter to create a github release + pull-requests: write # for release-drafter/release-drafter to add label to PR steps: # Drafts your next Release notes as Pull Requests are merged into "main" - uses: release-drafter/release-drafter@v5 # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true + with: + # config-name: my-config.yml + disable-autolabeler: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 12fc200f..0f417fa2 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -17,8 +17,9 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: - commit-message: update changelog + commit-message: 'build: update changelog' title: Update Changelog body: Update changelog to reflect release changes branch: update-changelog base: main + labels: release:changelog diff --git a/.gitignore b/.gitignore index 90dd3335..57cb272d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ # production /build /dist -/storybook-static # misc .DS_Store diff --git a/.storybook/main.js b/.storybook/main.js deleted file mode 100644 index 4e3d18c6..00000000 --- a/.storybook/main.js +++ /dev/null @@ -1,30 +0,0 @@ -const path = require('path'); - -module.exports = { - stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], - addons: [ - '@storybook/addon-links', - '@storybook/addon-essentials', - 'storybook-theme-toggle', - ], - framework: '@storybook/react', - core: { - builder: 'webpack5', - }, - presets: ['@storybook/preset-scss'], - webpackFinal: async (config) => { - config.resolve.alias = { - ...config.resolve.alias, - assets: path.resolve(__dirname, '../src/assets'), - components: path.resolve(__dirname, '../src/components'), - contexts: path.resolve(__dirname, '../src/contexts'), - hooks: path.resolve(__dirname, '../src/hooks'), - pages: path.resolve(__dirname, '../src/pages'), - styles: path.resolve(__dirname, '../src/styles'), - types: path.resolve(__dirname, '../src/types'), - utils: path.resolve(__dirname, '../src/utils'), - }; - - return config; - }, -}; diff --git a/.storybook/manager.js b/.storybook/manager.js deleted file mode 100644 index c63bbdd9..00000000 --- a/.storybook/manager.js +++ /dev/null @@ -1,13 +0,0 @@ -import { addons } from '@storybook/addons'; -import { themes } from '@storybook/theming'; -import theme from './theme'; - -addons.setConfig({ - docs: { - theme: themes.dark, - }, - sidebar: { - showRoots: true, - }, - theme, -}); diff --git a/.storybook/preview.js b/.storybook/preview.js deleted file mode 100644 index bb40d86f..00000000 --- a/.storybook/preview.js +++ /dev/null @@ -1,20 +0,0 @@ -// .storybook/preview.js -import * as NextImage from 'next/image'; -import '../src/styles/globals.scss'; - -const OriginalNextImage = NextImage.default; - -Object.defineProperty(NextImage, 'default', { - configurable: true, - value: (props) => , -}); - -export const parameters = { - actions: { argTypesRegex: '^on[A-Z].*' }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/, - }, - }, -}; diff --git a/.storybook/theme.js b/.storybook/theme.js deleted file mode 100644 index 14ab5f0f..00000000 --- a/.storybook/theme.js +++ /dev/null @@ -1,14 +0,0 @@ -import { create } from '@storybook/theming'; -import NexusLogo from '../src/assets/branding/NexusLogoBlue1250x225.png'; - -export default create({ - base: 'dark', - // UI - appBg: '#012235', - // Toolbar default and active colors - barBg: '#e3f6ff', - // Brand - brandTitle: 'Nexus Explorer', - brandUrl: 'https://explorer.nexus.io/', - brandImage: NexusLogo, -}); diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..bd096c58 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,400 @@ +# Changelog + +## v1.0.6 (26/09/2022) +## What's Changed + +## πŸ› Bug Fixes + +- fix: about page contributer @shrivatsabhat (#281) +- fix: case handle trust value being negative @rayanfer32 (#279) +- fix: case when trust = 0 @rayanfer32 (#278) + +## 🧰 Maintenance + +- ci: fix relase drafter generation pr @shrivatsabhat (#280) + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v1.0.5...v1.0.6 + +--- + +## v1.0.5 (25/09/2022) +## What's Changed + +## πŸ› Bug Fixes +* fix: trust address scan error by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/274 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v1.0.4...v1.0.5 +--- + +## v1.0.4 (18/09/2022) +## What's Changed + +## ⚠️Breaking Changes + +- fix: scan page not showing error @rayanfer32 (#260) + +## πŸš€ Features + +- feat: merge isLoading, isError to single component @shrivatsabhat (#264) +- feat: add new error message card @shrivatsabhat (#261) + +## πŸ› Bug Fixes + +- fix: scan page not showing error @rayanfer32 (#260) +- fix: scan layout not showing @rayanfer32 (#259) +- fix: passing boolean to class methods @shrivatsabhat (#258) + +## 🧰 Maintenance + +- feat: merge isLoading, isError to single component @shrivatsabhat (#264) +- ci: improve the template and labeller @shrivatsabhat (#263) +- chore: update next, react and react-dom @shrivatsabhat (#257) +- style: remove unused styles and rearrange @shrivatsabhat (#262) + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v1.0.3...v1.0.4 + +--- + +## v1.0.3 (08/09/2022) +## Changes + +- package version bump @github-actions (#254) +- refactor: charts @shrivatsabhat (#247) +- refactor: the layout of pages and separate from adding to globally @shrivatsabhat (#246) +- Update bump-version.yml @shrivatsabhat (#240) +- reverse merge @shrivatsabhat (#234) +- build: package update @shrivatsabhat (#233) + +## πŸš€ Features + +- feat: market price number precision to 6 digits @shrivatsabhat (#249) +- feat: detail card active ticker style revamp @shrivatsabhat (#248) +- feat: automate version bump and changelog @shrivatsabhat (#235) + +## πŸ› Bug Fixes + +- fix: high and medium static code analysis / deepscan @rayanfer32 (#250) +- fix: add force push @shrivatsabhat (#244) + +## 🧰 Maintenance + +- Release v1.0.3 @rayanfer32 (#253) +- revert: remove storybook @shrivatsabhat (#251) +- docs: add some badges to readme @rayanfer32 (#252) +- fix: high and medium static code analysis / deepscan @rayanfer32 (#250) +- fix: add force push @shrivatsabhat (#244) +- Update bump-version.yml @shrivatsabhat (#239) +- Update bump-version.yml @shrivatsabhat (#238) +- ci: move to dev dependency @shrivatsabhat (#236) +- feat: automate version bump and changelog @shrivatsabhat (#235) + +--- + +## v1.0.2 (26/08/2022) +## Changes + +## πŸš€ Features + +- feat: hide the dao on test net #203 @shrivatsabhat (#226) +- feat: show node version in footer @rayanfer32 (#220) +- feat: add version number to footer @shrivatsabhat (#219) + +## πŸ› Bug Fixes + +- fix: compact card text overlap on image @shrivatsabhat (#231) +- fix: disable refetch of data on window focus @rayanfer32 (#227) +- hotfix: update dependency and fix bugs @shrivatsabhat (#222) +- fix: menu page on mobile view @shrivatsabhat (#221) + +## 🧰 Maintenance + +- Release v1.0.2 @rayanfer32 (#232) +- refactor: pull out pages styles into separate file @shrivatsabhat (#228) +- refactor: pull out home page files to different file @shrivatsabhat (#229) +- hotfix: update dependency and fix bugs @shrivatsabhat (#222) +- build(deps): bump terser from 4.8.0 to 4.8.1 @dependabot (#213) + +--- + +## v1.0.1 (31/07/2022) +## Changes + +- refactor: support util function for multiple classnames @shrivatsabhat (#212) + +## πŸš€ Features + +- feat: separate invoice page and modal @shrivatsabhat (#210) +- feat: change theme toggle for desktop @shrivatsabhat (#208) + +## πŸ› Bug Fixes + +- feat: separate invoice page and modal @shrivatsabhat (#210) +- feat: invoice scan with standard url pattern @rayanfer32 (#209) +- fix: console error on loading env @rayanfer32 (#207) + +## 🧰 Maintenance + +- ci: Update release-drafter.yml @shrivatsabhat (#211) + +--- + +## v1.0.0 (11/07/2022) +## Changes + +- Fix/nav uneven flow @shrivatsabhat (#195) +- refactor: pages and components @shrivatsabhat (#193) +- ⚑️ Static ISR for Richlist @rayanfer32 (#189) +- increase ssg interval to 5 min @rayanfer32 (#188) +- ♻️ refactor metrics page @rayanfer32 (#187) + +## πŸš€ Features + +- feat: add caching for invoices @rayanfer32 (#204) +- fix: add highlights \& icons to links @rayanfer32 (#198) +- feat: add new custom dynamic link @shrivatsabhat (#196) +- feat: Add DAO\_KEYS, Invoice API's, Fetch DAO balances, Invoices Table, Invoice Modal @rayanfer32 (#194) +- feat: add new page ambassador dao @shrivatsabhat (#191) + +## πŸ› Bug Fixes + +- Fix/clear console errors @shrivatsabhat (#200) +- fix: add highlights \& icons to links @rayanfer32 (#198) + +## 🧰 Maintenance + +- Release: v1.0.0 @rayanfer32 (#205) +- ci: remove non essential workflows @shrivatsabhat (#199) +- chore: add danger file and refactor workflows @shrivatsabhat (#197) + +--- + +## Release v0.0.9a (15/05/2022) +## What's Changed +* πŸ› Convert richlist api to post api by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/183 +* fix: txn_id to txid by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/181 +* ✨ add ID column for trustlist by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/182 +* Release v0.0.9a by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/184 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.9...v0.0.9a +--- + +## Release v0.0.9 (04/05/2022) +## What's Changed +* refactor: ♻️ renamed to scss, change font to Rubik by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/153 +* πŸ“ Add link to nexus docs by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/155 +* ⚑️ fetch contributors statically by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/154 +* πŸ’„ Hide navbar on scroll by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/156 +* fix(meta): update meta urls by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/157 +* feat(meta): added extra meta details by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/158 +* Create codeql-analysis.yml by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/159 +* Create dependency-review.yml by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/160 +* fix: header disappears while scrolling by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/162 +* revamp: update github issue/pr template by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/163 +* πŸ’„ show three dots by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/165 +* ✨ Dynamic Endless pagination for trustlist by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/142 +* Fix: Dynamic Pagination for Account and Trust Transaction Details by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/166 +* refactor: convert styles file to clusters by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/164 +* fix: style module import error by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/168 +* refactor: delete duplicate detail-card file by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/169 +* chore: dependency package upgrade by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/171 +* fix: lint errors by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/174 +* dynamic pagination for richlist WIP by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/167 +* fix: initial theme toggle output icon by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/172 +* feat: support niamey font by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/175 +* Release v0.0.9 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/176 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.8...v0.0.9 +--- + +## Release v0.0.8 (05/04/2022) +## What's Changed +* πŸš‘ fix: page count showing 0 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/139 +* hotfix: page-count showing zero by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/140 +* feat: add meta images and details by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/143 +* πŸ‘· Added Proxy middleware by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/141 +* πŸ‘½οΈ fix: calc market cap based on metrics total supply by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/144 +* Docs/sample env by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/145 +* fix: husky git hooks by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/146 +* πŸ› fix: scan address API route by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/147 +* ✨ Show trust score and stake rate instead of pending and unconfirmed by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/148 +* pr labeler for .md file by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/149 +* ✨ Show USD conversions by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/150 +* Release v0.0.8 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/151 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.7...v0.0.8 +--- + +## Release v0.0.7 (11/03/2022) +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.6...v0.0.7 + +## What's Changed +* πŸ› added stake rate, fix color for trust by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/126 +* feat: pass page title/description as optional prop by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/131 +* fix: account page detail bar improve by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/130 +* fix: double scroll appearance by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/129 +* fix: moveout links from app context by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/133 +* refactor: remove unused files and properties by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/134 +* revamp: search bar refactored by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/136 +* Show account name ,show only upto 20 recent transactions (reduce load on node) by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/135 +* feat: header is stikcy to the top on scroll by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/137 +* Release v0.0.7 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/138 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.6...v0.0.7 +--- + +## Release v0.0.6 (06/03/2022) +## What's Changed +* fix: chart misplace in safari ios by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/121 +* fix: details card style by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/120 +* feat: add page title and description by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/119 +* Release 0.0.6-beta by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/122 +* πŸ› fix: Show Ellipsis based on device by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/123 +* Cache less frequently updated pages by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/124 +* Release v0.0.6 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/125 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.5...v0.0.6 +--- + +## Release v0.0.6-beta (03/03/2022) +## What's Changed +* fix: chart misplace in safari ios by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/121 +* fix: details card style by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/120 +* feat: add page title and description by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/119 +* Release 0.0.6-beta by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/122 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.5...v0.0.6-beta +--- + +## Release v0.0.5 (03/03/2022) +## What's Changed +* chore: support multi app context update and added post-merge husky config by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/97 +* fix#103 Make pages mobile friendly, remove real-time table for mobile users by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/104 +* refactor: components styles and performance by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/106 +* 🚚 revamp: metrics page improvised by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/107 +* refactor: account page files restructure by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/108 +* πŸ› fix crashing of about page by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/110 +* chore: πŸ”¨ add env detection by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/111 +* fix+feat: update metrics, hide chart toolbar for mobile by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/113 +* ✨ added Error Component by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/112 +* revamp: home page block list/transaction list table by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/114 +* fix: panel 2 misplace for small screen by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/118 +* Release version 0.0.5 by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/115 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.4...v0.0.5 +--- + +## Release v0.0.4 (23/02/2022) +## What's Changed +* ♻️ refactor: theme-toggle button by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/93 +* fix: testnet chart showing wrong initial data, update metrics metadata, refactor navbar by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/91 +* πŸ› prevent going below 0 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/95 +* πŸ’„ fix text color by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/100 +* πŸ› fix: #98 Only query for NXS token by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/99 +* Release v0.0.4 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/101 +* version bump up v0.0.4 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/102 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.3...v0.0.4 +--- + +## Release v0.0.3 (15/02/2022) +## What's Changed +* feat: custom hooks for get device type info by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/48 +* chore: πŸ“ˆ update template by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/49 +* πŸ’„ fix mulitple contracts by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/50 +* chore: πŸ‘·add labeler actions by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/51 +* feat: πŸ‘· add/update workflows by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/53 +* feat+fix: Donut Chart, namespaces and tokens page, CopyText Component, update readme and contributing by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/54 +* chore: ♻️ refactor workflow by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/56 +* feat: ✨ add copied check mark by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/55 +* update the pagination style by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/57 +* Added Globalnames page and moved about to footer by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/58 +* feat+style: Added Dynamic pagination for blocks and Transactions, subtle card borders by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/59 +* feat: get device screen width by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/60 +* Added local charting api support by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/61 +* styles: πŸ’„ improvise the styles by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/62 +* review-fixes: Removed owner columns,fix to 2 decimals, removed NXS typo, updated code structure by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/64 +* capitalize the all constants by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/63 +* refactor: 🎨 footer redesign by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/71 +* fix: AppContext causing slow down #76 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/77 +* added new scroll to top feature button by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/78 +* ♻️ refactor/style: change slideIn Animation to FadeIn by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/79 +* Feature/testnet by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/84 +* Feature/testnet by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/85 +* feat+fix: increase api limit ,dynamically fetch contributors by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/86 +* Improve page load speed, load blocks data during SSG by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/87 +* prevent breaking of copy button, fix RTT table overflow by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/88 +* Release v0.0.3 by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/89 + + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.2...v0.0.3 +--- + +## Beta Release (30/01/2022) +## What's Changed +* docs: update the readme by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/1 +* add eslint rules by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/2 +* feat: linter update and add GitHub template by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/3 +* Feat/component by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/4 +* feat: πŸ’„update style and add detail card by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/5 +* Feat/tables by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/6 +* feat: style update add search & theme component by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/7 +* Enhancement: minor update by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/8 +* feat: 🎨 improve the txn table row by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/9 +* style: πŸ’„ improve table row style by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/10 +* Style/revamp by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/11 +* fix: πŸ› adjust spacing by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/12 +* refactor: pannel one responsive by @shrivatsabhatp in https://github.com/rayanfer32/nexus-explorer-next/pull/13 +* Refactor/styles by @shrivatsabhatp in https://github.com/rayanfer32/nexus-explorer-next/pull/15 +* revert: hide chart for small screen by @shrivatsabhatp in https://github.com/rayanfer32/nexus-explorer-next/pull/16 +* Refactor/styles by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/14 +* Refactor/styles by @shrivatsabhatp in https://github.com/rayanfer32/nexus-explorer-next/pull/17 +* fix: styles by @shrivatsabhatp in https://github.com/rayanfer32/nexus-explorer-next/pull/19 +* Refactor/styles by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/18 +* revert: solve merge error by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/20 +* Rayan by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/21 +* chore: support scss styling by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/22 +* chore: add storybook by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/24 +* Rayan by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/23 +* feat: add component loader by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/25 +* Feat/component by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/26 +* chore(deps): bump next from 12.0.2 to 12.0.5 by @dependabot in https://github.com/rayanfer32/nexus-explorer-next/pull/27 +* Feat/component by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/28 +* πŸ’„ chore: update favicon by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/31 +* feat: added loaders ,fix: useQuery api , graph fetching by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/30 +* Api and bug fixes by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/32 +* feat: replace loading with shimmer by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/33 +* Removed antd and added React Table by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/34 +* sidebar: modify the style and event on click by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/36 +* update about page style by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/37 +* chore(deps): bump follow-redirects from 1.14.5 to 1.14.7 by @dependabot in https://github.com/rayanfer32/nexus-explorer-next/pull/38 +* feat: Scan Api update by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/39 +* feat: added pagination and trust / account info component by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/40 +* chore(deps): bump nanoid from 3.1.30 to 3.2.0 by @dependabot in https://github.com/rayanfer32/nexus-explorer-next/pull/41 +* feat: NXS distrubution chart & Transaction info page by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/42 +* chore: support yarn run clean platform independency by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/43 +* feat: 🎨 add sub category by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/35 +* feat: ✨ introduce custom toast messager by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/44 +* feat: SSG and collapsible Infocards by @rayanfer32 in https://github.com/rayanfer32/nexus-explorer-next/pull/45 +* release 0.02 by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/46 +* release v0.0.2 by @shrivatsabhat in https://github.com/rayanfer32/nexus-explorer-next/pull/47 + +## New Contributors +* @shrivatsabhat made their first contribution in https://github.com/rayanfer32/nexus-explorer-next/pull/1 +* @rayanfer32 made their first contribution in https://github.com/rayanfer32/nexus-explorer-next/pull/6 +* @shrivatsabhatp made their first contribution in https://github.com/rayanfer32/nexus-explorer-next/pull/13 +* @dependabot made their first contribution in https://github.com/rayanfer32/nexus-explorer-next/pull/27 + +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/compare/v0.0.1...v0.0.2 +--- + +## Initial Release (30/01/2022) +**Full Changelog**: https://github.com/rayanfer32/nexus-explorer-next/commits/v0.0.1 \ No newline at end of file diff --git a/README.md b/README.md index 8b80c8ce..c71290e8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![DeepScan grade](https://deepscan.io/api/teams/18758/projects/22054/branches/652904/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=18758&pid=22054&bid=652904) +[![DeepScan grade](https://deepscan.io/api/teams/18758/projects/22054/branches/652904/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=18758&pid=22054&bid=652904) ![Vercel](https://therealsujitk-vercel-badge.vercel.app/?app=nexplorer-dev) ![GitHub last commit](https://img.shields.io/github/last-commit/rayanfer32/nexus-explorer-next) ![License](https://img.shields.io/badge/license-MIT-blue) +![Uptime Robot ratio (30 days)](https://img.shields.io/uptimerobot/ratio/m792639503-14123c76ffe5540620263065) This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). diff --git a/dependencies/storybook-theme-toggle/Icons/Moon.js b/dependencies/storybook-theme-toggle/Icons/Moon.js deleted file mode 100644 index 593573c4..00000000 --- a/dependencies/storybook-theme-toggle/Icons/Moon.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = void 0; - -var _react = _interopRequireDefault(require("react")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var Moon = function Moon() { - return /*#__PURE__*/_react["default"].createElement("svg", { - className: "w-6 h-6", - fill: "none", - stroke: "currentColor", - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" - }, /*#__PURE__*/_react["default"].createElement("path", { - strokeLinecap: "round", - strokeLinejoin: "round", - strokeWidth: 2, - d: "M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" - })); -}; - -var _default = Moon; -exports["default"] = _default; \ No newline at end of file diff --git a/dependencies/storybook-theme-toggle/Icons/Sun.js b/dependencies/storybook-theme-toggle/Icons/Sun.js deleted file mode 100644 index 262edd03..00000000 --- a/dependencies/storybook-theme-toggle/Icons/Sun.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = void 0; - -var _react = _interopRequireDefault(require("react")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var Sun = function Sun() { - return /*#__PURE__*/_react["default"].createElement("svg", { - className: "w-6 h-6", - fill: "none", - stroke: "currentColor", - viewBox: "0 0 24 24", - xmlns: "http://www.w3.org/2000/svg" - }, /*#__PURE__*/_react["default"].createElement("path", { - strokeLinecap: "round", - strokeLinejoin: "round", - strokeWidth: 2, - d: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" - })); -}; - -var _default = Sun; -exports["default"] = _default; \ No newline at end of file diff --git a/dependencies/storybook-theme-toggle/ToggleTheme.js b/dependencies/storybook-theme-toggle/ToggleTheme.js deleted file mode 100644 index 918c7bfe..00000000 --- a/dependencies/storybook-theme-toggle/ToggleTheme.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports["default"] = void 0; - -var _react = _interopRequireWildcard(require("react")); - -var _components = require("@storybook/components"); - -var _Moon = _interopRequireDefault(require("./Icons/Moon")); - -var _Sun = _interopRequireDefault(require("./Icons/Sun")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -var ToggleTheme = function ToggleTheme(_ref) { - var api = _ref.api; - - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - isDark = _useState2[0], - setDark = _useState2[1]; - - var updateMode = function updateMode() { - setDark(!isDark); - }; - - (0, _react.useEffect)(function () { - var _iframe$contentWindow; - - var iframe = document.getElementById('storybook-preview-iframe'); - var iframeDocument = iframe.contentDocument || ((_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow.document); - iframeDocument.documentElement.setAttribute('data-color-theme', isDark ? 'dark' : 'light'); - iframeDocument.documentElement.setAttribute('style', 'height:100%'); - }, [isDark]); - return /*#__PURE__*/_react["default"].createElement(_components.IconButton, { - key: "theme-toggle", - active: false, - title: isDark ? 'Change to light theme' : 'Change to dark theme', - onClick: updateMode - }, isDark ? /*#__PURE__*/_react["default"].createElement(_Sun["default"], null) : /*#__PURE__*/_react["default"].createElement(_Moon["default"], null)); -}; - -var _default = ToggleTheme; -exports["default"] = _default; \ No newline at end of file diff --git a/dependencies/storybook-theme-toggle/preset.js b/dependencies/storybook-theme-toggle/preset.js deleted file mode 100644 index b4bdc3a0..00000000 --- a/dependencies/storybook-theme-toggle/preset.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.managerEntries = managerEntries; - -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function managerEntries() { - var entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - return [].concat(_toConsumableArray(entry), [require.resolve('./register')]); -} \ No newline at end of file diff --git a/dependencies/storybook-theme-toggle/register.js b/dependencies/storybook-theme-toggle/register.js deleted file mode 100644 index 90d91d77..00000000 --- a/dependencies/storybook-theme-toggle/register.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -var _react = _interopRequireDefault(require("react")); - -var _addons = _interopRequireWildcard(require("@storybook/addons")); - -var _ToggleTheme = _interopRequireDefault(require("./ToggleTheme")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -_addons["default"].register('storybook-theme-toggle', function (api) { - _addons["default"].add('sstorybook-theme-toggle', { - title: 'Toggle Theme', - type: _addons.types.TOOL, - match: function match(_ref) { - var viewMode = _ref.viewMode; - return viewMode === 'story' || viewMode === 'docs'; - }, - render: function render() { - return /*#__PURE__*/_react["default"].createElement(_ToggleTheme["default"], { - api: api - }); - } - }); -}); \ No newline at end of file diff --git a/package.json b/package.json index 56cc615e..42fae8f9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nexus-explorer-next", "private": true, - "version": "1.0.2", + "version": "1.0.6", "scripts": { "dev": "next dev", "build": "next build", @@ -10,11 +10,8 @@ "lint": "next lint", "format": "prettier -w ./src", "prepare": "husky install", - "clean:cache": "rimraf .next", - "clean": "rimraf node_modules", + "clean": "rimraf .next && rimraf dist", "clean:deep": "rimraf .next && rimraf dist && rimraf node_modules", - "storybook": "start-storybook -p 6006 -s ./public", - "build-storybook": "build-storybook -s public", "overrideChangelog": "gren changelog --override" }, "dependencies": { @@ -22,12 +19,12 @@ "axios": "^0.27.2", "http-proxy-middleware": "^2.0.6", "js-cookie": "^3.0.1", - "next": "12.1.5", + "next": "12.3.0", "next-pwa": "^5.5.2", "prop-types": "^15.8.1", - "react": "18.1.0", + "react": "18.2.0", "react-apexcharts": "^1.4.0", - "react-dom": "18.1.0", + "react-dom": "18.2.0", "react-icons": "^4.3.1", "react-qr-code": "^2.0.7", "react-query": "^3.38.0", @@ -36,30 +33,15 @@ "sharp": "^0.30.7" }, "devDependencies": { - "@babel/core": "^7.17.9", - "@storybook/addon-actions": "^6.4.22", - "@storybook/addon-essentials": "^6.4.22", - "@storybook/addon-links": "^6.4.22", - "@storybook/addons": "^6.4.22", - "@storybook/builder-webpack5": "^6.4.22", - "@storybook/manager-webpack5": "^6.4.22", - "@storybook/preset-scss": "^1.0.3", - "@storybook/react": "^6.4.22", - "@storybook/theming": "^6.4.22", - "babel-loader": "^8.2.5", - "css-loader": "^6.7.1", "danger": "^11.1.1", "eslint": "8.14.0", "eslint-config-next": "12.1.5", "eslint-config-prettier": "^8.5.0", - "eslint-plugin-storybook": "^0.5.11", + "github-release-notes": "^0.17.3", "husky": "^7.0.4", "lint-staged": "^12.4.1", "prettier": "2.6.2", - "rimraf": "^3.0.2", - "sass-loader": "^12.6.0", - "storybook-theme-toggle": "file:dependencies/storybook-theme-toggle", - "style-loader": "^3.3.1" + "rimraf": "^3.0.2" }, "lint-staged": { "**/*.{js,jsx,ts,tsx}": [ @@ -70,4 +52,4 @@ "prettier --write --ignore-unknown" ] } -} +} \ No newline at end of file diff --git a/src/assets/images/error-bill.svg b/src/assets/images/error-bill.svg new file mode 100644 index 00000000..b11996c7 --- /dev/null +++ b/src/assets/images/error-bill.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/HOC/PromiseLayout/index.jsx b/src/components/HOC/PromiseLayout/index.jsx new file mode 100644 index 00000000..66b3b3ed --- /dev/null +++ b/src/components/HOC/PromiseLayout/index.jsx @@ -0,0 +1,27 @@ +import ErrorMessage from 'components/common/NE_ErrorMessage'; +import Loader from 'components/common/NE_Loader'; +import { Fragment } from 'react'; +import TYPES from 'types'; + +export default function PromiseLayout(props) { + const { + children = <>, + error = {}, + isError = false, + isLoading = false, + loaderType = TYPES.LOADER.CIRCLE, + loaderSize = '5rem', + } = props; + + return ( + + {isLoading && ( +
+ +
+ )} + {isError && } + {!isLoading && !isError && children} +
+ ); +} diff --git a/src/components/Panel3/Panel3.jsx b/src/components/Panel3/Panel3.jsx index 21ec61ec..b0cb1cfc 100644 --- a/src/components/Panel3/Panel3.jsx +++ b/src/components/Panel3/Panel3.jsx @@ -57,6 +57,10 @@ function Panel3({ blocks }) { try { let newRows = []; for (let txidx = 0; txidx < newRowData.length; txidx++) { + if (!newRowData[txidx].contracts?.length) { + Warn('there is no contract for newRowData[txidx]'); + continue; + } for (let cidx = 0; cidx < newRowData[txidx].contracts.length; cidx++) { newRows.push( { const [pageIndex, setPageIndex] = useState(0); @@ -19,18 +18,6 @@ export const TransactionDetails = ({ type, data }) => { const { network, getAccountTransactions, getTrustTransactions } = useNetwork(); - const LoaderDiv = () => ( -
- -
- ); - const accountTransactionsRQ = useQuery( [ 'accountTransactions', @@ -81,7 +68,6 @@ export const TransactionDetails = ({ type, data }) => { ['CREDIT', 'CREATE', 'TRUST'].includes(props.row.values.operation) ) { cellColor = TYPES.COLORS.MARKET_GREEN; - sign = '+'; } else if (['DEBIT', 'FEE'].includes(props.row.values.operation)) { cellColor = TYPES.COLORS.MARKET_RED; sign = '-'; @@ -136,26 +122,28 @@ export const TransactionDetails = ({ type, data }) => { }, }; - if (accountTransactionsRQ.isLoading) { - return ; - } - return (
- -
- +
- - {accountTransactionsRQ.data?.error && ( - - )} +
+ +
+ ); }; diff --git a/src/components/Views/About/About.jsx b/src/components/Views/About/About.jsx index 02374071..5b2af14f 100644 --- a/src/components/Views/About/About.jsx +++ b/src/components/Views/About/About.jsx @@ -52,9 +52,8 @@ const About = ({ data }) => {

{Array.isArray(data) && data.map((item) => { - if (item.author.type === 'Bot') { - return; - } + if (item.author.type === 'Bot') return; + if (item.author.login === 'web-flow') return; return ( getInvoices(username, pageIndex, pageSize) ); @@ -44,18 +43,6 @@ function InvoicesView({ username }) { ...columns, ]; - if (isLoading) { - return ( -

- ); - } - - if (error) { - return ; - } - const dynamicPageControls = { canPreviousPage: pageIndex > 0, canNextPage: pageIndex < pageCount - 1, @@ -88,7 +75,12 @@ function InvoicesView({ username }) { }; return ( - <> +

@@ -102,7 +94,7 @@ function InvoicesView({ username }) { data={modalData} onClose={handleModalClose}> )} - + ); } diff --git a/src/components/Views/Richlist/Richlist.jsx b/src/components/Views/Richlist/Richlist.jsx index 896d8e37..d9d7f601 100644 --- a/src/components/Views/Richlist/Richlist.jsx +++ b/src/components/Views/Richlist/Richlist.jsx @@ -1,7 +1,6 @@ import Table from 'components/Table/Table'; import { useQuery } from 'react-query'; import styles from './richlist.module.scss'; -import Loader from 'components/common/NE_Loader'; import { intlNum } from 'utils/converter'; import ApexPie from 'components/common/NE_Chart/ChartApexPie'; import TYPES from 'types'; @@ -10,7 +9,8 @@ import { useNetwork } from 'hooks/useNetwork/useNetwork'; import { useEffect, useState } from 'react'; import Pagination from 'components/common/NE_Pagination'; import { NETWORKS } from 'types/ConstantsTypes'; -import ErrorMessage from 'components/common/ErrorMessage'; +import PromiseLayout from 'components/HOC/PromiseLayout'; +import { pathOr } from 'utils'; export default function Richlist(props) { const [pageIndex, setPageIndex] = useState(0); @@ -22,15 +22,13 @@ export default function Richlist(props) { // * api calls const { network, getRichlist, getMetrics } = useNetwork(); const isMainnet = network.name === NETWORKS.MAINNET.name; - const { isLoading, data, error } = useQuery( + const { isLoading, data, error, isError } = useQuery( ['richlist', pageIndex, pageSize, network.name], () => getRichlist(pageIndex, pageSize), { placeholderData: pageIndex == 0 - ? isMainnet - ? { data: props.data.data.slice(0, pageSize) } - : undefined + ? isMainnet && { data: props.data.data.slice(0, pageSize) } : undefined, // * for testnet we don't have data in the props staleTime: 1000 * 60, // * 1 min } @@ -114,39 +112,29 @@ export default function Richlist(props) { } }, [richlist111.data]); - if (error) { - return ; - } - return ( <>

- {/* // * Pie chart */} -
-

NXS Distrubution

- {pieData && } -
- - {/* // * Table with dual pagination */} - {isLoading ? ( -
- + + {/* // * Pie chart */} +
+

NXS Distrubution

+ {pieData && }
- ) : ( + + {/* // * Table with dual pagination */}
{pageSize > 10 && }
-
+
- )} + ); diff --git a/src/components/Views/Trustlist/Trustlist.jsx b/src/components/Views/Trustlist/Trustlist.jsx index 74ef7dd7..cdf0e917 100644 --- a/src/components/Views/Trustlist/Trustlist.jsx +++ b/src/components/Views/Trustlist/Trustlist.jsx @@ -1,16 +1,14 @@ import Table from 'components/Table/Table'; +import { useState } from 'react'; import { useQuery } from 'react-query'; import styles from './trustlist.module.scss'; -import Loader from 'components/common/NE_Loader'; -import { intlNum } from 'utils/converter'; import CopyText from 'components/common/NE_CopyText/CopyText'; import { useNetwork } from 'hooks/useNetwork/useNetwork'; -import ErrorCard from 'components/common/NE_ErrorCard'; import PageHeader from 'components/Header/PageHeader'; import DynamicPagination from 'components/common/NE_Pagination'; -// import DynamicPagination from 'components/Table/DynamicPagination'; -import { useState } from 'react'; -import ErrorMessage from 'components/common/ErrorMessage'; +import PromiseLayout from 'components/HOC/PromiseLayout'; +import { intlNum, pathOr } from 'utils'; +import TYPES from 'types'; export default function Trustlist() { const [pageIndex, setPageIndex] = useState(0); @@ -18,7 +16,7 @@ export default function Trustlist() { const [pageCount] = useState(Infinity); const { network, getTrustlist } = useNetwork(); - const { isLoading, data, error } = useQuery( + const { isLoading, data, error, isError } = useQuery( ['trustlist', pageIndex, pageSize, network.name], getTrustlist ); @@ -56,35 +54,6 @@ export default function Trustlist() { }, ]; - if (isLoading) { - return ( -
- -
- ); - } - - if (error) { - return ( -
- -
- ); - } - - const newData = data.data?.result?.map((item, index) => ({ - key: index, - ...item, - stake: item.stake, - balance: item.balance, - })); - const dynamicPageControls = { canPreviousPage: pageIndex > 0, canNextPage: pageIndex < pageCount - 1, @@ -113,18 +82,25 @@ export default function Trustlist() { <>
-
-
- -
- {data.data?.error && } + + {data && ( +
+ )} +
+ +
+ ); diff --git a/src/components/common/NE_Card/NE_CompactCard/index.jsx b/src/components/common/NE_Card/NE_CompactCard/index.jsx index 8ece59bf..b55fbc76 100644 --- a/src/components/common/NE_Card/NE_CompactCard/index.jsx +++ b/src/components/common/NE_Card/NE_CompactCard/index.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import styles from './CompactCard.module.scss'; import { Nexus_SVG_Icon } from 'assets/icons'; import TYPES from 'types'; +import { cls } from 'utils'; /** * Compact card component with icon @@ -24,7 +25,7 @@ export const NE_CompactCard = (props) => {

{props.label}

@@ -35,7 +36,7 @@ export const NE_CompactCard = (props) => { onClick={props.onClick}> {props.text && }

{props.value}

diff --git a/src/components/common/NE_Card/NE_DetailCard/index.jsx b/src/components/common/NE_Card/NE_DetailCard/index.jsx index 3434747d..da3db450 100644 --- a/src/components/common/NE_Card/NE_DetailCard/index.jsx +++ b/src/components/common/NE_Card/NE_DetailCard/index.jsx @@ -51,7 +51,7 @@ const Card_Footer = ({ footerLabel, footerValue }) => ( const ValueUnit = ({ value, unit }) => ( -

{value}

+

{value.toString()}

{unit}
); diff --git a/src/components/common/NE_ErrorMessage/ErrorMessage.module.scss b/src/components/common/NE_ErrorMessage/ErrorMessage.module.scss new file mode 100644 index 00000000..7e1c09c2 --- /dev/null +++ b/src/components/common/NE_ErrorMessage/ErrorMessage.module.scss @@ -0,0 +1,27 @@ +.error-container { + background: var(--theme-tab-bg); + border-radius: 0.5rem; + box-shadow: var(--card-shadow); + display: flex; + // align-items: center; + gap: 2vw; + + .error-detail { + flex-basis: 90%; + margin-top: 2vmin; + h3 { + font-size: var(--font-xxl); + font-size: clamp(var(--font-normal), 5vw, var(--font-xxl)); + } + } + .error-code { + font-size: var(--font-normal); + text-transform: capitalize; + color: var(--theme-page-text-secondary); + } + .error-message { + font-size: var(--font-l); + text-transform: capitalize; + color: var(--theme-page-text); + } +} diff --git a/src/components/common/NE_ErrorMessage/index.jsx b/src/components/common/NE_ErrorMessage/index.jsx new file mode 100644 index 00000000..b0e64e84 --- /dev/null +++ b/src/components/common/NE_ErrorMessage/index.jsx @@ -0,0 +1,22 @@ +import { cls } from 'utils'; +import styles from './ErrorMessage.module.scss'; +import Image from 'next/image'; +import Billy from 'assets/images/error-bill.svg'; +import Logger from 'utils/customLog'; + +export default function ErrorMessage({ error }) { + const { code = '', message = '' } = error; + Logger.error(error); + return ( +
+ +
+

Oops!, Something's not right

+

{message}

+

+ code: {code} +

+
+
+ ); +} diff --git a/src/hooks/useNetwork/useNetwork.jsx b/src/hooks/useNetwork/useNetwork.jsx index 23c3bf32..f12e6a8e 100644 --- a/src/hooks/useNetwork/useNetwork.jsx +++ b/src/hooks/useNetwork/useNetwork.jsx @@ -56,7 +56,7 @@ export function useNetwork() { order: 'desc', }, }); - return res; + return res.data; }; const getRichlist = async (page = 0, limit = 111) => { diff --git a/src/pages/scan/[addr].js b/src/pages/scan/[addr].js index 97e4f3a5..3f49538c 100644 --- a/src/pages/scan/[addr].js +++ b/src/pages/scan/[addr].js @@ -1,20 +1,19 @@ import axios from 'axios'; import { InfoCard } from 'components/common/InfoCard'; import Button from 'components/common/NE_Button'; -import Loader from 'components/common/NE_Loader'; -import ErrorMessage from 'components/common/ErrorMessage'; import UserAccount from 'components/UserAccount'; import { useNetwork } from 'hooks/useNetwork/useNetwork'; import { useState } from 'react'; import { useQuery } from 'react-query'; import { isDev } from 'utils/middleware'; import { Log } from 'utils/customLog'; -import ErrorCard from 'components/common/NE_ErrorCard'; import PageHeader from 'components/Header/PageHeader'; import { CARD_TYPES } from 'types/ConstantsTypes'; import { InvoiceWithData } from 'components/Views/Dao/InvoiceModal'; import { useRouter } from 'next/router'; import Layout from 'components/Layout'; +import PromiseLayout from 'components/HOC/PromiseLayout'; +import { pathOr } from 'utils'; export const getServerSideProps = async (context) => { let address = context.params.addr; @@ -60,16 +59,29 @@ function Scan({ addr }) { }; type = 'invoice'; } else if (addr.length === 51) { - // ? might be trust acc or user acc address, so query for both and identify which one is correct - endpoint = 'finance/get/account'; + // * address might be trust acc or user acc address, so query for both and identify which one is correct + Log('Checking if the addr is trust / account'); + + const trustEndpoint = 'finance/get/trust'; + const accountEndpoint = 'finance/get/account'; + params = { address: addr }; - const res = await axios.get(`${network.url}/${endpoint}`, { - params: params, - }); - if (res.data.error) { - endpoint = 'finance/get/trust'; + const resolvedAccountTypeResponse = await Promise.any([ + axios.get(`${network.url}/${accountEndpoint}`, { + params: params, + }), + axios.get(`${network.url}/${trustEndpoint}`, { + params: params, + }), + ]); + + Log('[RESOLVED]:', resolvedAccountTypeResponse); + + if (resolvedAccountTypeResponse.data.result.hasOwnProperty('trust')) { + endpoint = trustEndpoint; type = 'trust'; } else { + endpoint = accountEndpoint; type = 'user'; } } else if (addr.length === 128) { @@ -88,7 +100,7 @@ function Scan({ addr }) { return { endpoint, params, type }; } - const { isLoading, data, error } = useQuery( + const { isLoading, data, error, isError } = useQuery( ['scan', addr, network.name], async () => { const { endpoint, params, type } = await getAPI(addr); @@ -98,26 +110,6 @@ function Scan({ addr }) { } ); - if (isLoading) { - return ( -
- -
- ); - } - - if (error) { - return ( -
- -
- ); - } - - if (data?.error) { - return ; - } - const rawInfo = (
@@ -137,18 +129,28 @@ function Scan({ addr }) {
- {[CARD_TYPES.BLOCK, CARD_TYPES.TRANSACTION].includes(cardType) && ( - - )} - {[CARD_TYPES.TRUST, CARD_TYPES.USER].includes(cardType) && ( - - )} - {cardType === CARD_TYPES.INVOICE && ( - <> - {/* */} - - - )} + + {data?.result && ( + <> + {[CARD_TYPES.BLOCK, CARD_TYPES.TRANSACTION].includes( + cardType + ) && } + {[CARD_TYPES.TRUST, CARD_TYPES.USER].includes(cardType) && ( + + )} + {cardType === CARD_TYPES.INVOICE && ( + + )} + + )} + {isDev && rawInfo}
diff --git a/src/pages/scan/index.js b/src/pages/scan/index.js index 2c102331..7abc1fd6 100644 --- a/src/pages/scan/index.js +++ b/src/pages/scan/index.js @@ -1,47 +1,31 @@ -import ErrorMessage from 'components/common/ErrorMessage'; -import ErrorCard from 'components/common/NE_ErrorCard'; -import Loader from 'components/common/NE_Loader'; import Layout from 'components/Layout'; import { InvoiceWithData } from 'components/Views/Dao/InvoiceModal'; import { useNetwork } from 'hooks/useNetwork/useNetwork'; import { useRouter } from 'next/router'; import React from 'react'; import { useQuery } from 'react-query'; +import PromiseLayout from 'components/HOC/PromiseLayout'; +import { pathOr } from 'utils'; +import TYPES from 'types'; export default function Index() { const router = useRouter(); const { network, getInvoice } = useNetwork(); - const { data, error, isLoading } = useQuery( + const { data, error, isLoading, isError } = useQuery( ['invoice', network.name, router.query.invoice], () => getInvoice(router.query.invoice) ); - if (isLoading) { - return ( -
- -
- ); - } - - if (error) { - return ( -
- -
- ); - } - - if (data.error) { - return ; - } - return ( - + + {data && } + ); - - // return
{JSON.stringify(data, null, 2)}
; } diff --git a/src/stories/Example/Button.jsx b/src/stories/Example/Button.jsx deleted file mode 100644 index 17a4daac..00000000 --- a/src/stories/Example/Button.jsx +++ /dev/null @@ -1,53 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './button.css'; - -/** - * Primary UI component for user interaction - */ -export const Button = ({ primary, backgroundColor, size, label, ...props }) => { - const mode = primary - ? 'storybook-button--primary' - : 'storybook-button--secondary'; - return ( - - ); -}; - -Button.propTypes = { - /** - * Is this the principal call to action on the page? - */ - primary: PropTypes.bool, - /** - * What background color to use - */ - backgroundColor: PropTypes.string, - /** - * How large should the button be? - */ - size: PropTypes.oneOf(['small', 'medium', 'large']), - /** - * Button contents - */ - label: PropTypes.string.isRequired, - /** - * Optional click handler - */ - onClick: PropTypes.func, -}; - -Button.defaultProps = { - backgroundColor: null, - primary: false, - size: 'medium', - onClick: undefined, -}; diff --git a/src/stories/Example/Button.stories.jsx b/src/stories/Example/Button.stories.jsx deleted file mode 100644 index 61f6e19e..00000000 --- a/src/stories/Example/Button.stories.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; - -import { Button } from './Button'; - -// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export -export default { - title: 'Example/Button', - component: Button, - // More on argTypes: https://storybook.js.org/docs/react/api/argtypes - argTypes: { - backgroundColor: { control: 'color' }, - }, -}; - -// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args -const Template = (args) =>
- - -); - -Header.propTypes = { - user: PropTypes.shape({}), - onLogin: PropTypes.func.isRequired, - onLogout: PropTypes.func.isRequired, - onCreateAccount: PropTypes.func.isRequired, -}; - -Header.defaultProps = { - user: null, -}; diff --git a/src/stories/Example/Header.stories.jsx b/src/stories/Example/Header.stories.jsx deleted file mode 100644 index 16f41aa3..00000000 --- a/src/stories/Example/Header.stories.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; - -import { Header } from './Header'; - -export default { - title: 'Example/Header', - component: Header, -}; - -const Template = (args) =>
; - -export const LoggedIn = Template.bind({}); -LoggedIn.args = { - user: {}, -}; - -export const LoggedOut = Template.bind({}); -LoggedOut.args = {}; diff --git a/src/stories/Example/Page.jsx b/src/stories/Example/Page.jsx deleted file mode 100644 index 2dba8703..00000000 --- a/src/stories/Example/Page.jsx +++ /dev/null @@ -1,89 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -import { Header } from './Header'; -import './page.css'; - -export const Page = ({ user, onLogin, onLogout, onCreateAccount }) => ( -
-
- -
-

Pages in Storybook

-

- We recommend building UIs with a{' '} - - component-driven - {' '} - process starting with atomic components and ending with pages. -

-

- Render pages with mock data. This makes it easy to build and review page - states without needing to navigate to them in your app. Here are some - handy patterns for managing page data in Storybook: -

-
    -
  • - Use a higher-level connected component. Storybook helps you compose - such data from the "args" of child component stories -
  • -
  • - Assemble data in the page component from your services. You can mock - these services out using Storybook. -
  • -
-

- Get a guided tutorial on component-driven development at{' '} - - Storybook tutorials - - . Read more in the{' '} - - docs - - . -

-
- Tip Adjust the width of the canvas with the{' '} - - - - - - Viewports addon in the toolbar -
-
-
-); -Page.propTypes = { - user: PropTypes.shape({}), - onLogin: PropTypes.func.isRequired, - onLogout: PropTypes.func.isRequired, - onCreateAccount: PropTypes.func.isRequired, -}; - -Page.defaultProps = { - user: null, -}; diff --git a/src/stories/Example/Page.stories.jsx b/src/stories/Example/Page.stories.jsx deleted file mode 100644 index 948ad67a..00000000 --- a/src/stories/Example/Page.stories.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; - -import { Page } from './Page'; -import * as HeaderStories from './Header.stories'; - -export default { - title: 'Example/Page', - component: Page, -}; - -const Template = (args) => ; - -export const LoggedIn = Template.bind({}); -LoggedIn.args = { - // More on composing args: https://storybook.js.org/docs/react/writing-stories/args#args-composition - ...HeaderStories.LoggedIn.args, -}; - -export const LoggedOut = Template.bind({}); -LoggedOut.args = { - ...HeaderStories.LoggedOut.args, -}; diff --git a/src/stories/Example/button.css b/src/stories/Example/button.css deleted file mode 100644 index dc91dc76..00000000 --- a/src/stories/Example/button.css +++ /dev/null @@ -1,30 +0,0 @@ -.storybook-button { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 700; - border: 0; - border-radius: 3em; - cursor: pointer; - display: inline-block; - line-height: 1; -} -.storybook-button--primary { - color: white; - background-color: #1ea7fd; -} -.storybook-button--secondary { - color: #333; - background-color: transparent; - box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; -} -.storybook-button--small { - font-size: 12px; - padding: 10px 16px; -} -.storybook-button--medium { - font-size: 14px; - padding: 11px 20px; -} -.storybook-button--large { - font-size: 16px; - padding: 12px 24px; -} diff --git a/src/stories/Example/header.css b/src/stories/Example/header.css deleted file mode 100644 index acadc9ec..00000000 --- a/src/stories/Example/header.css +++ /dev/null @@ -1,26 +0,0 @@ -.wrapper { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 15px 20px; - display: flex; - align-items: center; - justify-content: space-between; -} - -svg { - display: inline-block; - vertical-align: top; -} - -h1 { - font-weight: 900; - font-size: 20px; - line-height: 1; - margin: 6px 0 6px 10px; - display: inline-block; - vertical-align: top; -} - -button + button { - margin-left: 10px; -} diff --git a/src/stories/Example/page.css b/src/stories/Example/page.css deleted file mode 100644 index fbc32aea..00000000 --- a/src/stories/Example/page.css +++ /dev/null @@ -1,69 +0,0 @@ -section { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 24px; - padding: 48px 20px; - margin: 0 auto; - max-width: 600px; - color: #333; -} - -section h2 { - font-weight: 900; - font-size: 32px; - line-height: 1; - margin: 0 0 4px; - display: inline-block; - vertical-align: top; -} - -section p { - margin: 1em 0; -} - -section a { - text-decoration: none; - color: #1ea7fd; -} - -section ul { - padding-left: 30px; - margin: 1em 0; -} - -section li { - margin-bottom: 8px; -} - -section .tip { - display: inline-block; - border-radius: 1em; - font-size: 11px; - line-height: 12px; - font-weight: 700; - background: #e7fdd8; - color: #66bf3c; - padding: 4px 12px; - margin-right: 10px; - vertical-align: top; -} - -section .tip-wrapper { - font-size: 13px; - line-height: 20px; - margin-top: 40px; - margin-bottom: 40px; -} - -section .tip-wrapper svg { - display: inline-block; - height: 12px; - width: 12px; - margin-right: 4px; - vertical-align: top; - margin-top: 3px; -} - -section .tip-wrapper svg path { - fill: #1ea7fd; -} diff --git a/src/stories/Introduction.stories.mdx b/src/stories/Introduction.stories.mdx deleted file mode 100644 index 1fdb8e84..00000000 --- a/src/stories/Introduction.stories.mdx +++ /dev/null @@ -1,213 +0,0 @@ -import { Meta } from '@storybook/addon-docs'; -import Code from './assets/code-brackets.svg'; -import Colors from './assets/colors.svg'; -import Comments from './assets/comments.svg'; -import Direction from './assets/direction.svg'; -import Flow from './assets/flow.svg'; -import Plugin from './assets/plugin.svg'; -import Repo from './assets/repo.svg'; -import StackAlt from './assets/stackalt.svg'; - - - - - -# Welcome to Storybook - -Storybook helps you build UI components in isolation from your app's business logic, data, and context. -That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA. - -Browse example stories now by navigating to them in the sidebar. -View their code in the `src/stories` directory to learn how they work. -We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages. - -
Configure
- - - -
Learn
- - - -
- TipEdit the Markdown in{' '} - src/stories/Introduction.stories.mdx -
diff --git a/src/stories/assets/code-brackets.svg b/src/stories/assets/code-brackets.svg deleted file mode 100644 index 73de9477..00000000 --- a/src/stories/assets/code-brackets.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/code-brackets \ No newline at end of file diff --git a/src/stories/assets/colors.svg b/src/stories/assets/colors.svg deleted file mode 100644 index 17d58d51..00000000 --- a/src/stories/assets/colors.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/colors \ No newline at end of file diff --git a/src/stories/assets/comments.svg b/src/stories/assets/comments.svg deleted file mode 100644 index 6493a139..00000000 --- a/src/stories/assets/comments.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/comments \ No newline at end of file diff --git a/src/stories/assets/direction.svg b/src/stories/assets/direction.svg deleted file mode 100644 index 65676ac2..00000000 --- a/src/stories/assets/direction.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/direction \ No newline at end of file diff --git a/src/stories/assets/flow.svg b/src/stories/assets/flow.svg deleted file mode 100644 index 8ac27db4..00000000 --- a/src/stories/assets/flow.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/flow \ No newline at end of file diff --git a/src/stories/assets/plugin.svg b/src/stories/assets/plugin.svg deleted file mode 100644 index 29e5c690..00000000 --- a/src/stories/assets/plugin.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/plugin \ No newline at end of file diff --git a/src/stories/assets/repo.svg b/src/stories/assets/repo.svg deleted file mode 100644 index f386ee90..00000000 --- a/src/stories/assets/repo.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/repo \ No newline at end of file diff --git a/src/stories/assets/stackalt.svg b/src/stories/assets/stackalt.svg deleted file mode 100644 index 9b7ad274..00000000 --- a/src/stories/assets/stackalt.svg +++ /dev/null @@ -1 +0,0 @@ -illustration/stackalt \ No newline at end of file diff --git a/src/stories/components/Button.stories.js b/src/stories/components/Button.stories.js deleted file mode 100644 index bfe0eb15..00000000 --- a/src/stories/components/Button.stories.js +++ /dev/null @@ -1,28 +0,0 @@ -import Button from 'components/common/NE_Button'; -import TYPES from 'types'; - -// eslint-disable-next-line import/no-anonymous-default-export -export default { - title: 'Components/Button', - component: Button, -}; - -const Template = (args) =>