diff --git a/.env-temp b/.env-temp new file mode 100644 index 0000000..a9738c9 --- /dev/null +++ b/.env-temp @@ -0,0 +1,5 @@ +TAKO_ANALYTICS_KEY= +NFT_STORAGE_KEY= +ETHERSCAN_API= +DEV=true +AKKORO_ENV=dev \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11f3ac8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/.next +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.idea +out/ +public/sw.js +public/sw.js.map +public/workbox-* +.env + +.vscode/ diff --git a/Rarible.LICENSE.md b/Rarible.LICENSE.md new file mode 100644 index 0000000..a42d1b1 --- /dev/null +++ b/Rarible.LICENSE.md @@ -0,0 +1,20 @@ +Copyright (c) 2021, Rarible DAO + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..5aa1f89 --- /dev/null +++ b/next.config.js @@ -0,0 +1,46 @@ +const withPWA = require('next-pwa'); + +const nextConfig = { + assetPrefix: './', + trailingSlash: true, + reactStrictMode: true, + pwa: { + dest: 'public', + }, + devIndicators: { + autoPrerender: true, + }, + typescript: { + // !! WARN !! + // Dangerously allow production builds to successfully complete even if + // your project has type errors. + // !! WARN !! + ignoreBuildErrors: true, + }, + webpackDevMiddleware: (config) => { + // Solve compiling problem via vagrant + config.watchOptions = { + poll: 1000, // Check for changes every second + aggregateTimeout: 800, // delay before rebuilding + }; + return config; + }, + async rewrites() { + return []; + }, + images: { + domains: [ + 'ipfs.io', + 'rarible.mypinata.cloud', + 'akkoros.mypinata.cloud', + 'ipfs.akkoros.xyz', + ], + }, + env: { + NFT_STORAGE_KEY: process.env.NFT_STORAGE_KEY, + ETHERSCAN_API: process.env.ETHERSCAN_API, + DEV: process.env.DEV, + AKKORO_ENV: process.env.AKKORO_ENV, + }, +}; +module.exports = withPWA(nextConfig); diff --git a/package.json b/package.json new file mode 100644 index 0000000..102b49f --- /dev/null +++ b/package.json @@ -0,0 +1,117 @@ +{ + "name": "takolabs", + "version": "0.0.1", + "private": true, + "dependencies": { + "@apollo/client": "^3.4.16", + "@apollo/react-hooks": "^3.1.5", + "@emotion/react": "^11.8.1", + "@emotion/styled": "^11.8.1", + "@fortawesome/fontawesome-svg-core": "^1.3.0-beta3", + "@fortawesome/free-regular-svg-icons": "^6.0.0-beta3", + "@fortawesome/free-solid-svg-icons": "^6.0.0-beta3", + "@fortawesome/react-fontawesome": "^0.1.17", + "@mui/lab": "^5.0.0-alpha.68", + "@mui/material": "^5.4.2", + "@rarible/connector": "latest", + "@rarible/connector-beacon": "latest", + "@rarible/connector-fcl": "latest", + "@rarible/connector-fortmatic": "latest", + "@rarible/connector-helper": "latest", + "@rarible/connector-iframe": "latest", + "@rarible/connector-mew": "latest", + "@rarible/connector-phantom": "latest", + "@rarible/connector-portis": "latest", + "@rarible/connector-solflare": "latest", + "@rarible/connector-torus": "latest", + "@rarible/connector-walletconnect": "latest", + "@rarible/connector-walletlink": "latest", + "@rarible/estimate-middleware": "latest", + "@rarible/sdk": "latest", + "@rarible/web3-ethereum": "latest", + "@rixio/atom": "^0.12.1", + "@rixio/react": "^0.12.1", + "@testing-library/jest-dom": "^5.16.2", + "@testing-library/react": "^12.1.3", + "@testing-library/user-event": "^13.5.0", + "@types/jest": "^27.4.0", + "@types/lodash": "^4.14.178", + "@types/node": "^17.0.19", + "@types/react": "^17.0.2", + "@types/react-dom": "latest", + "@types/react-syntax-highlighter": "^13.5.2", + "apollo-server-micro": "^2.25.2", + "axios": "^0.24.0", + "bootstrap": "^5.1.3", + "child_process": "^1.0.2", + "classnames": "^2.3.1", + "dotenv": "^16.0.0", + "fflate": "^0.7.3", + "files-from-path": "^0.2.6", + "graphql": "^14.7.0", + "lodash": "^4.17.21", + "markdown-to-jsx": "^7.1.5", + "micro": "^9.3.4", + "mime-types": "^2.1.34", + "moment": "^2.29.3", + "next": "^12.0.9", + "next-pwa": "^5.4.4", + "nft.storage": "latest", + "node-sass": "^7.0.1", + "normalize.css": "^8.0.1", + "react": "latest", + "react-blockies": "^1.4.1", + "react-dom": "latest", + "react-helmet": "^6.1.0", + "react-hook-form": "^7.27.1", + "react-intersection-observer": "^8.33.0", + "react-lazy-load-image-component": "^1.5.1", + "react-pdf": "^5.7.2", + "react-redux": "^7.2.8", + "react-router-dom": "6", + "react-scripts": "^4.0.3", + "react-select": "^5.2.2", + "react-syntax-highlighter": "^15.4.5", + "redux": "^4.1.2", + "redux-devtools-extension": "^2.13.9", + "redux-persist": "^6.0.0", + "redux-persist-expire": "^1.1.0", + "redux-thunk": "^2.4.1", + "screenfull": "^6.0.1", + "tezos-sdk-module": "^0.0.52", + "typescript": "latest", + "url": "^0.11.0", + "web-vitals": "^1.0.1", + "web3": "latest" + }, + "resolutions": { + "//": "See https://github.com/facebook/create-react-app/issues/11773", + "react-error-overlay": "6.0.9" + }, + "scripts": { + "dev": "next dev", + "start": "next start", + "build": "next build", + "export": "next export", + "build:ipfs": "yarn build && yarn export && node storeDir ./out", + "lint": "next lint" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/pages/_app.tsx b/pages/_app.tsx new file mode 100644 index 0000000..05c93bd --- /dev/null +++ b/pages/_app.tsx @@ -0,0 +1,125 @@ +//@ts-nocheck +import React from 'react'; +import {ThemeProvider} from '@mui/material'; +import {appTheme} from '../src/theme'; +import {ApolloProvider} from '@apollo/client'; +import client from '../src/middleware/graphql/apollo-client'; +import type {AppProps /*, AppContext */, NextWebVitalsMetric} from 'next/app'; + +import {Provider} from 'react-redux'; +// @ts-ignore +import {store} from '../src/store'; +import Head from 'next/head'; +import metrics from '../src/metrics'; +import {SdkConnectionProvider} from '@/src/components/connector/sdk-connection-provider'; +import 'bootstrap/dist/css/bootstrap.min.css'; +import Navbar from '../src/components/Navbar'; +import dynamic from 'next/dynamic'; +const EnvironmentSelectorProvider = dynamic( + (): any => + import('../src/components/connector/environment-selector-provider').then( + (mod) => mod.EnvironmentSelectorProvider + ), + {ssr: false} +); + +function MyApp({Component, pageProps}: AppProps) { + return ( + <> + + + + + + + + + + {(connector: any): any => ( + + {/*TODO: Create Layout*/} +
+ +
+ {/* */} +
+ )} +
+
+
+ + ); +} + +export default MyApp; diff --git a/pages/_document.tsx b/pages/_document.tsx new file mode 100644 index 0000000..8d0d0a8 --- /dev/null +++ b/pages/_document.tsx @@ -0,0 +1,48 @@ +//@ts-nocheck +import React from 'react'; + +import Document, { + Html, + Head, + Main, + NextScript, + DocumentContext, +} from 'next/document'; +import {getLangFromReq} from '../src/utility/fromReq'; +interface langType { + lang: string; +} +const scriptTxt: string = ` +(function () { + const { pathname } = window.location + const ipfsMatch = /.*\\/Qm\\w{44}\\//.exec(pathname) + const base = document.createElement('base') + + base.href = ipfsMatch ? ipfsMatch[0] : '/' + document.head.append(base) +})(); +`; +class MyDocument extends Document { + static async getInitialProps(ctx: DocumentContext) { + const initialProps = await Document.getInitialProps(ctx); + const lang = getLangFromReq(ctx.req); + return {...initialProps, lang}; + } + + render(): JSX.Element { + const {lang}: langType = this.props; + return ( + + +