diff --git a/example/.prettierrc b/example/.prettierrc new file mode 100644 index 0000000..625d5aa --- /dev/null +++ b/example/.prettierrc @@ -0,0 +1,6 @@ +{ + "jsxBracketSameLine": true, + "printWidth": 70, + "singleQuote": true, + "trailingComma": "es5" +} diff --git a/example/package.json b/example/package.json index 26d84b4..5e1b32e 100644 --- a/example/package.json +++ b/example/package.json @@ -1,5 +1,5 @@ { - "name": "example-ts", + "name": "react-with-firebase-auth-example-ts", "version": "0.1.0", "private": true, "dependencies": { @@ -22,7 +22,9 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "lint": "prettier --check './src/**/*.{tsx,ts}'", + "lint:fix": "prettier --write './src/**/*.{tsx,ts}'" }, "eslintConfig": { "extends": [ @@ -43,6 +45,7 @@ ] }, "devDependencies": { - "@types/firebase": "^3.2.1" + "@types/firebase": "^3.2.1", + "prettier": "^2.3.2" } } diff --git a/example/public/index.html b/example/public/index.html index aa069f2..ac36ee8 100644 --- a/example/public/index.html +++ b/example/public/index.html @@ -7,7 +7,7 @@ - React App + react-with-firebase-auth diff --git a/example/public/manifest.json b/example/public/manifest.json index 080d6c7..a62d01b 100644 --- a/example/public/manifest.json +++ b/example/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "react-with-firebase-auth", + "name": "react-with-firebase-auth", "icons": [ { "src": "favicon.ico", diff --git a/example/src/App.css b/example/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/example/src/App.css +++ /dev/null @@ -1,38 +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); - } -} diff --git a/example/src/App.tsx b/example/src/App.tsx index 9558e3d..b2703e4 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,31 +1,33 @@ -import React from 'react' +import React from 'react'; import firebase from 'firebase'; -import withFirebaseAuth, {WrappedComponentProps} from 'react-with-firebase-auth' +import withFirebaseAuth, { + WrappedComponentProps, +} from 'react-with-firebase-auth'; import firebaseConfig from './firebaseConfig'; import UserForm from './UserForm'; -const firebaseApp = firebase.initializeApp(firebaseConfig); +const firebaseApp = firebase.initializeApp(firebaseConfig); -const FormWrapper: React.FC = ({ children }) => +const FormWrapper: React.FC = ({ children }) => ( <> -
- {children} -
+
{children}

- ; + +); const Loading = () => ( -
+
Loading..
); @@ -90,7 +92,10 @@ const App: React.FC = ({

user data

-