-
Notifications
You must be signed in to change notification settings - Fork 410
/
Copy pathApp.tsx
50 lines (46 loc) · 1.45 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import * as React from 'react';
import { AuthProvider, useFirebaseApp, useInitPerformance } from 'reactfire';
import { Card } from '../display/Card';
import { Analytics } from './Analytics'
import { Auth } from './Auth';
import { Firestore } from './Firestore';
import { Functions } from './Functions';
import { RealtimeDatabase } from './RealtimeDatabase';
import { RemoteConfig } from './RemoteConfig';
import { Storage } from './Storage';
// Import auth directly because most components need it
// Other Firebase libraries can be lazy-loaded as-needed
import { getAuth } from 'firebase/auth';
export const App = () => {
const firebaseApp = useFirebaseApp();
const auth = getAuth(firebaseApp);
useInitPerformance(async (firebaseApp) => {
const { getPerformance } = await import('firebase/performance');
return getPerformance(firebaseApp);
});
return (
<div className="flex flex-wrap justify-around p-4">
<AuthProvider sdk={auth}>
<Card title="Authentication">
<Auth />
</Card>
<Card title="Firestore">
<Firestore />
</Card>
<Card title="Functions">
<Functions />
</Card>
<Card title="Realtime Database">
<RealtimeDatabase />
</Card>
<Card title="Remote Config">
<RemoteConfig />
</Card>
<Card title="Storage">
<Storage />
</Card>
</AuthProvider>
<Analytics />
</div>
);
};