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
-
+
diff --git a/example/src/UserForm.tsx b/example/src/UserForm.tsx
index 455118a..7ec8df7 100644
--- a/example/src/UserForm.tsx
+++ b/example/src/UserForm.tsx
@@ -1,38 +1,50 @@
-import React, { ButtonHTMLAttributes, DetailedHTMLProps, InputHTMLAttributes, useState } from 'react';
+import React, {
+ ButtonHTMLAttributes,
+ DetailedHTMLProps,
+ InputHTMLAttributes,
+ useState,
+} from 'react';
-const Field: React.FC = ({ children }) =>
+const Field: React.FC = ({ children }) => (
<>
{children}
- >;
+ >
+);
-type HTMLInputProps = DetailedHTMLProps, HTMLInputElement>;
+type HTMLInputProps = DetailedHTMLProps<
+ InputHTMLAttributes,
+ HTMLInputElement
+>;
type InputProps = Omit & {
onChange: (value: string) => void;
-}
+};
-const Input = ({ value, onChange, ...props }: InputProps) =>
+const Input = ({ value, onChange, ...props }: InputProps) => (
onChange(event.target.value)}
- />;
+ onChange={(event) => onChange(event.target.value)}
+ />
+);
-type ButtonProps = DetailedHTMLProps, HTMLButtonElement>
+type ButtonProps = DetailedHTMLProps<
+ ButtonHTMLAttributes,
+ HTMLButtonElement
+>;
-const SubmitButton = (props: ButtonProps) =>
- ;
+const SubmitButton = (props: ButtonProps) => (
+
+);
type UserFormProps = {
onSubmit: (email: string, password: string) => void;
-}
+};
-const UserForm = ({
- onSubmit,
-}: UserFormProps) => {
- const [email, setEmail] = useState("");
- const [password, setPassword] = useState("");
+const UserForm = ({ onSubmit }: UserFormProps) => {
+ const [email, setEmail] = useState('');
+ const [password, setPassword] = useState('');
return (
@@ -40,11 +52,16 @@ const UserForm = ({
email:
- password:
+ password:{' '}
+
onSubmit(email, password)} />
);
-}
+};
export default UserForm;
diff --git a/example/src/firebaseConfig.ts b/example/src/firebaseConfig.ts
index d9a027d..87397e2 100644
--- a/example/src/firebaseConfig.ts
+++ b/example/src/firebaseConfig.ts
@@ -1,10 +1,10 @@
const firebaseConfig = {
- apiKey: "AIzaSyC0hOjv4hqAvG-g7UxItugLuaj-6E2FOjI",
- authDomain: "react-firebase-auth-9d938.firebaseapp.com",
- databaseURL: "https://react-firebase-auth-9d938.firebaseio.com",
- projectId: "react-firebase-auth-9d938",
- storageBucket: "react-firebase-auth-9d938.appspot.com",
- messagingSenderId: "975967064412"
+ apiKey: 'AIzaSyC0hOjv4hqAvG-g7UxItugLuaj-6E2FOjI',
+ authDomain: 'react-firebase-auth-9d938.firebaseapp.com',
+ databaseURL: 'https://react-firebase-auth-9d938.firebaseio.com',
+ projectId: 'react-firebase-auth-9d938',
+ storageBucket: 'react-firebase-auth-9d938.appspot.com',
+ messagingSenderId: '975967064412',
};
export default firebaseConfig;
diff --git a/example/src/index.css b/example/src/index.css
deleted file mode 100644
index ec2585e..0000000
--- a/example/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/example/src/index.tsx b/example/src/index.tsx
index ef2edf8..7998135 100644
--- a/example/src/index.tsx
+++ b/example/src/index.tsx
@@ -1,6 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
-import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
diff --git a/example/src/reportWebVitals.ts b/example/src/reportWebVitals.ts
index 49a2a16..f063a2d 100644
--- a/example/src/reportWebVitals.ts
+++ b/example/src/reportWebVitals.ts
@@ -2,13 +2,15 @@ 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);
- });
+ import('web-vitals').then(
+ ({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+ getCLS(onPerfEntry);
+ getFID(onPerfEntry);
+ getFCP(onPerfEntry);
+ getLCP(onPerfEntry);
+ getTTFB(onPerfEntry);
+ }
+ );
}
};
diff --git a/example/yarn.lock b/example/yarn.lock
index ebc5beb..2b42d63 100644
--- a/example/yarn.lock
+++ b/example/yarn.lock
@@ -9113,6 +9113,11 @@ prepend-http@^1.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
+prettier@^2.3.2:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
+ integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==
+
pretty-bytes@^5.3.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"