Skip to content

Commit

Permalink
Fix firebase config #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Gionata committed Sep 20, 2023
1 parent dc99122 commit 760ae07
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions home/sea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Image from "next/image"
import { useEffect, useState } from "react";
/** Utilities */
import { prefix, setFixedHeight } from "@/lib/utilities";
import { isProd, prefix, setFixedHeight } from "@/lib/utilities";
/** Components */
import LinkTree from "@/components/linktree";
import PoskyModal from "@/components/modal";
Expand All @@ -20,7 +20,7 @@ export default function Sea() {
const handleShare = async () => { };

useEffect(() => {
if (typeof window != undefined) {
if (typeof window != undefined && !isProd) {
//() Initialize Firebase
console.log('FIREBASE', firebase);
isSupported().then(supported => {
Expand Down
1 change: 1 addition & 0 deletions lib/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ export class Theme {
}

export const prefix = process.env.NEXT_PUBLIC_BASE_PATH || '';
export const isProd = process.env.NODE_ENV === "production";
21 changes: 10 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/** @type {import('next').NextConfig} */

const isProd = process.env.NODE_ENV === "production";
import { isProd } from "@/lib/utilities";
module.exports = {
// Your Next.js configuration options here
output: isProd ? "export" : undefined,
basePath: "",
assetPrefix: isProd ? `${process.env.NEXT_PUBLIC_DOMAIN_PATH}` : undefined,
// env: {
// FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,
// FIREBASE_AUTH_DOMAIN: process.env.FIREBASE_AUTH_DOMAIN,
// FIREBASE_PROJECT_ID: process.env.FIREBASE_PROJECT_ID,
// FIREBASE_STORAGE_BUCKET: process.env.FIREBASE_STORAGE_BUCKET,
// FIREBASE_MESSAGING_SENDER_ID: process.env.FIREBASE_MESSAGING_SENDER_ID,
// FIREBASE_APP_ID: process.env.FIREBASE_APP_ID,
// FIREBASE_MEASUREMENT_ID: process.env.FIREBASE_MEASUREMENT_ID
// },
env: {
FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,
FIREBASE_AUTH_DOMAIN: process.env.FIREBASE_AUTH_DOMAIN,
FIREBASE_PROJECT_ID: process.env.FIREBASE_PROJECT_ID,
FIREBASE_STORAGE_BUCKET: process.env.FIREBASE_STORAGE_BUCKET,
FIREBASE_MESSAGING_SENDER_ID: process.env.FIREBASE_MESSAGING_SENDER_ID,
FIREBASE_APP_ID: process.env.FIREBASE_APP_ID,
FIREBASE_MEASUREMENT_ID: process.env.FIREBASE_MEASUREMENT_ID
},
};

0 comments on commit 760ae07

Please sign in to comment.