From 938465b8188b2499a4fcb9097cacb065c761de62 Mon Sep 17 00:00:00 2001 From: evlist Date: Wed, 7 Sep 2022 12:02:13 +0200 Subject: [PATCH] Empty ionic react project --- empty-ionic-react/src/App.test.tsx | 8 ------ empty-ionic-react/src/App.tsx | 18 +++---------- .../src/components/ExploreContainer.css | 24 ------------------ .../src/components/ExploreContainer.tsx | 14 ----------- empty-ionic-react/src/index.tsx | 10 -------- empty-ionic-react/src/pages/Home.css | 0 empty-ionic-react/src/pages/Home.tsx | 25 ------------------- empty-ionic-react/src/reportWebVitals.ts | 15 ----------- empty-ionic-react/src/setupTests.ts | 14 ----------- 9 files changed, 3 insertions(+), 125 deletions(-) delete mode 100644 empty-ionic-react/src/App.test.tsx delete mode 100644 empty-ionic-react/src/components/ExploreContainer.css delete mode 100644 empty-ionic-react/src/components/ExploreContainer.tsx delete mode 100644 empty-ionic-react/src/pages/Home.css delete mode 100644 empty-ionic-react/src/pages/Home.tsx delete mode 100644 empty-ionic-react/src/reportWebVitals.ts delete mode 100644 empty-ionic-react/src/setupTests.ts diff --git a/empty-ionic-react/src/App.test.tsx b/empty-ionic-react/src/App.test.tsx deleted file mode 100644 index 8c927a8..0000000 --- a/empty-ionic-react/src/App.test.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import App from './App'; - -test('renders without crashing', () => { - const { baseElement } = render(); - expect(baseElement).toBeDefined(); -}); diff --git a/empty-ionic-react/src/App.tsx b/empty-ionic-react/src/App.tsx index 6033a6a..64f7bc0 100644 --- a/empty-ionic-react/src/App.tsx +++ b/empty-ionic-react/src/App.tsx @@ -1,7 +1,4 @@ -import { Redirect, Route } from 'react-router-dom'; -import { IonApp, IonRouterOutlet, setupIonicReact } from '@ionic/react'; -import { IonReactRouter } from '@ionic/react-router'; -import Home from './pages/Home'; +import { IonApp, setupIonicReact } from '@ionic/react'; /* Core CSS required for Ionic components to work properly */ import '@ionic/react/css/core.css'; @@ -26,17 +23,8 @@ setupIonicReact(); const App: React.FC = () => ( - - - - - - - - - - - +

This works!

+ ); export default App; diff --git a/empty-ionic-react/src/components/ExploreContainer.css b/empty-ionic-react/src/components/ExploreContainer.css deleted file mode 100644 index e99f514..0000000 --- a/empty-ionic-react/src/components/ExploreContainer.css +++ /dev/null @@ -1,24 +0,0 @@ -.container { - text-align: center; - position: absolute; - left: 0; - right: 0; - top: 50%; - transform: translateY(-50%); -} - -.container strong { - font-size: 20px; - line-height: 26px; -} - -.container p { - font-size: 16px; - line-height: 22px; - color: #8c8c8c; - margin: 0; -} - -.container a { - text-decoration: none; -} \ No newline at end of file diff --git a/empty-ionic-react/src/components/ExploreContainer.tsx b/empty-ionic-react/src/components/ExploreContainer.tsx deleted file mode 100644 index 1b4b3c0..0000000 --- a/empty-ionic-react/src/components/ExploreContainer.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import './ExploreContainer.css'; - -interface ContainerProps { } - -const ExploreContainer: React.FC = () => { - return ( -
- Ready to create an app? -

Start with Ionic UI Components

-
- ); -}; - -export default ExploreContainer; diff --git a/empty-ionic-react/src/index.tsx b/empty-ionic-react/src/index.tsx index 2421bbc..dcd0a01 100644 --- a/empty-ionic-react/src/index.tsx +++ b/empty-ionic-react/src/index.tsx @@ -1,8 +1,6 @@ import React from 'react'; import { createRoot } from 'react-dom/client'; import App from './App'; -import * as serviceWorkerRegistration from './serviceWorkerRegistration'; -import reportWebVitals from './reportWebVitals'; const container = document.getElementById('root'); const root = createRoot(container!); @@ -12,12 +10,4 @@ root.render( ); -// 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://cra.link/PWA -serviceWorkerRegistration.unregister(); -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/empty-ionic-react/src/pages/Home.css b/empty-ionic-react/src/pages/Home.css deleted file mode 100644 index e69de29..0000000 diff --git a/empty-ionic-react/src/pages/Home.tsx b/empty-ionic-react/src/pages/Home.tsx deleted file mode 100644 index 922267d..0000000 --- a/empty-ionic-react/src/pages/Home.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react'; -import ExploreContainer from '../components/ExploreContainer'; -import './Home.css'; - -const Home: React.FC = () => { - return ( - - - - Blank - - - - - - Blank - - - - - - ); -}; - -export default Home; diff --git a/empty-ionic-react/src/reportWebVitals.ts b/empty-ionic-react/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16..0000000 --- a/empty-ionic-react/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/empty-ionic-react/src/setupTests.ts b/empty-ionic-react/src/setupTests.ts deleted file mode 100644 index 87988d6..0000000 --- a/empty-ionic-react/src/setupTests.ts +++ /dev/null @@ -1,14 +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'; - -// Mock matchmedia -window.matchMedia = window.matchMedia || function() { - return { - matches: false, - addListener: function() {}, - removeListener: function() {} - }; -};