-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from coldsurfers/release/surf-tree-v1.0.6
release(surf-tree): v1.0.6
- Loading branch information
Showing
14 changed files
with
83 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
SURF_TREE_DOMAIN_NAME= | ||
SURF_TREE_DOMAIN_CERT_ARN= | ||
SURF_TREE_DOMAIN_CERT_ARN= | ||
NEXT_PUBLIC_FIREBASE_API_KEY= | ||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN= | ||
NEXT_PUBLIC_FIREBASE_PROJECT_ID= | ||
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET= | ||
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID= | ||
NEXT_PUBLIC_FIREBASE_APP_ID= | ||
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const firebaseConfig = { | ||
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, | ||
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN, | ||
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID, | ||
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET, | ||
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID, | ||
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID, | ||
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Import the functions you need from the SDKs you need | ||
import { Analytics, getAnalytics } from 'firebase/analytics' | ||
import { FirebaseApp, initializeApp as fbInitializeApp } from 'firebase/app' | ||
import { firebaseConfig } from './firebase.constants' | ||
// TODO: Add SDKs for Firebase products that you want to use | ||
// https://firebase.google.com/docs/web/setup#available-libraries | ||
|
||
/** | ||
* only for client side | ||
*/ | ||
export class Firebase { | ||
private analytics: Analytics | ||
private app: FirebaseApp | ||
|
||
constructor() { | ||
// Initialize Firebase | ||
this.app = fbInitializeApp(firebaseConfig) | ||
this.analytics = getAnalytics(this.app) | ||
} | ||
|
||
static initializeApp() { | ||
if (process.env.NODE_ENV === 'development') { | ||
return | ||
} | ||
const app = fbInitializeApp(firebaseConfig) | ||
return getAnalytics(app) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './firebase' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './firebase' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/surf-tree/src/contexts/firebase-context/firebase-context.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use client' | ||
|
||
import { Firebase } from '@/app/(lib)' | ||
import { PropsWithChildren, useEffect } from 'react' | ||
|
||
export function FirebaseContext({ children }: PropsWithChildren) { | ||
useEffect(() => { | ||
function initFirebase() { | ||
Firebase.initializeApp() | ||
} | ||
initFirebase() | ||
}, []) | ||
|
||
return <>{children}</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './firebase-context' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './firebase-context' | ||
export * from './ocean-road-theme-context' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.