From aab23928a0a74ddefae7aa762aaa71b91b0930a1 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 1 Mar 2023 12:56:39 +0100 Subject: [PATCH] Reorganise directory structure and include path in tsconfig.base.json --- apps/wallet-connect/src/App.css | 42 -------------- apps/wallet-connect/src/App.js | 56 ------------------- apps/wallet-connect/src/App.test.js | 9 --- apps/wallet-connect/src/index.css | 13 ----- apps/wallet-connect/src/index.js | 17 ------ .../src/{ => services}/RemixClient.js | 0 .../src/{ => services}/serviceWorker.js | 0 apps/wallet-connect/src/setupTests.js | 5 -- 8 files changed, 142 deletions(-) delete mode 100644 apps/wallet-connect/src/App.css delete mode 100644 apps/wallet-connect/src/App.js delete mode 100644 apps/wallet-connect/src/App.test.js delete mode 100644 apps/wallet-connect/src/index.css delete mode 100644 apps/wallet-connect/src/index.js rename apps/wallet-connect/src/{ => services}/RemixClient.js (100%) rename apps/wallet-connect/src/{ => services}/serviceWorker.js (100%) delete mode 100644 apps/wallet-connect/src/setupTests.js diff --git a/apps/wallet-connect/src/App.css b/apps/wallet-connect/src/App.css deleted file mode 100644 index a60f767e6f..0000000000 --- a/apps/wallet-connect/src/App.css +++ /dev/null @@ -1,42 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -#disconnectbtn, #accounts-container { - display: none; -} \ No newline at end of file diff --git a/apps/wallet-connect/src/App.js b/apps/wallet-connect/src/App.js deleted file mode 100644 index 256f968279..0000000000 --- a/apps/wallet-connect/src/App.js +++ /dev/null @@ -1,56 +0,0 @@ -import React from 'react'; -import './App.css'; -import '@fortawesome/fontawesome-free/css/all.css' -import { RemixClient, INFURA_ID_KEY } from './RemixClient' -const p = new RemixClient() -function App() { - - const openModal = () => { - p.onConnect() - } - - const disconnect = () => { - p.onDisconnect() - } - - const showButtons = (connected = true) =>{ - document.getElementById("disconnectbtn").style.display = document.getElementById("accounts-container").style.display = connected? 'block':'none'; - document.getElementById("connectbtn").style.display = connected? 'none':'block'; - } - - p.internalEvents.on('accountsChanged', (accounts) => { - document.getElementById('accounts').innerHTML = "" - for(const account of accounts){ - document.getElementById('accounts').innerHTML += `
  • ${account}
  • ` - } - }) - - p.internalEvents.on('chainChanged', (chain) => { - document.getElementById('chain').innerHTML = chain - showButtons(true) - }) - - p.internalEvents.on('disconnect', (chain) => { - document.getElementById('accounts').innerHTML = '' - document.getElementById('chain').innerHTML = '' - showButtons(false) - }) - return ( -
    -
    -
    - infura settings - { localStorage.setItem(INFURA_ID_KEY, e.target.value)}} id="input-infura-id" placeholder="Infura Id" className="mt-2 mb-2 ml-2"> -
    - - -
    -
    -


      -
      -
      -
      - ); -} - -export default App; diff --git a/apps/wallet-connect/src/App.test.js b/apps/wallet-connect/src/App.test.js deleted file mode 100644 index 4db7ebc25c..0000000000 --- a/apps/wallet-connect/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - const { getByText } = render(); - const linkElement = getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/apps/wallet-connect/src/index.css b/apps/wallet-connect/src/index.css deleted file mode 100644 index ec2585e8c0..0000000000 --- a/apps/wallet-connect/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/apps/wallet-connect/src/index.js b/apps/wallet-connect/src/index.js deleted file mode 100644 index f5185c1ec7..0000000000 --- a/apps/wallet-connect/src/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import * as serviceWorker from './serviceWorker'; - -ReactDOM.render( - - - , - document.getElementById('root') -); - -// If you want your app to work offline and load faster, you can change -// unregister() to register() below. Note this comes with some pitfalls. -// Learn more about service workers: https://bit.ly/CRA-PWA -serviceWorker.unregister(); diff --git a/apps/wallet-connect/src/RemixClient.js b/apps/wallet-connect/src/services/RemixClient.js similarity index 100% rename from apps/wallet-connect/src/RemixClient.js rename to apps/wallet-connect/src/services/RemixClient.js diff --git a/apps/wallet-connect/src/serviceWorker.js b/apps/wallet-connect/src/services/serviceWorker.js similarity index 100% rename from apps/wallet-connect/src/serviceWorker.js rename to apps/wallet-connect/src/services/serviceWorker.js diff --git a/apps/wallet-connect/src/setupTests.js b/apps/wallet-connect/src/setupTests.js deleted file mode 100644 index 74b1a275a0..0000000000 --- a/apps/wallet-connect/src/setupTests.js +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom/extend-expect';