Move IS_PRIVATE_MANIFOLD to access.ts
This commit is contained in:
parent
cb071fc9b3
commit
dcafb50e06
|
@ -27,3 +27,4 @@ export function isAdmin(email: string) {
|
|||
export const DOMAIN = ENV_CONFIG.domain
|
||||
export const FIREBASE_CONFIG = ENV_CONFIG.firebaseConfig
|
||||
export const PROJECT_ID = ENV_CONFIG.firebaseConfig.projectId
|
||||
export const IS_PRIVATE_MANIFOLD = ENV_CONFIG.visibility === 'PRIVATE'
|
||||
|
|
|
@ -3,7 +3,7 @@ import { formatMoney } from '../../common/util/format'
|
|||
import { Avatar } from './avatar'
|
||||
import { Col } from './layout/col'
|
||||
import { MenuButton } from './menu'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
||||
|
||||
export function ProfileMenu(props: { user: User | undefined }) {
|
||||
const { user } = props
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import _ from 'lodash'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useState, useEffect } from 'react'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
||||
|
||||
type PropzProps = {
|
||||
params: any
|
||||
|
|
|
@ -2,9 +2,6 @@ import { getFirestore } from '@firebase/firestore'
|
|||
import { initializeApp, getApps, getApp } from 'firebase/app'
|
||||
import { FIREBASE_CONFIG } from '../../../common/access'
|
||||
|
||||
const ENV = process.env.NEXT_PUBLIC_FIREBASE_ENV ?? 'PROD'
|
||||
// TODO: Move this to access.ts
|
||||
export const IS_PRIVATE_MANIFOLD = !['PROD', 'DEV'].includes(ENV)
|
||||
// Initialize Firebase
|
||||
export const app = getApps().length ? getApp() : initializeApp(FIREBASE_CONFIG)
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { useEffect } from 'gridjs'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
||||
import { Page } from '../components/page'
|
||||
import { Title } from '../components/title'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init'
|
||||
|
||||
export default function Custom404() {
|
||||
if (IS_PRIVATE_MANIFOLD) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import dayjs from 'dayjs'
|
||||
import _ from 'lodash'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
||||
import { DailyCountChart } from '../components/analytics/charts'
|
||||
import { Col } from '../components/layout/col'
|
||||
import { Spacer } from '../components/layout/spacer'
|
||||
|
@ -9,7 +10,6 @@ import { fromPropz, usePropz } from '../hooks/use-propz'
|
|||
import { getDailyBets } from '../lib/firebase/bets'
|
||||
import { getDailyComments } from '../lib/firebase/comments'
|
||||
import { getDailyContracts } from '../lib/firebase/contracts'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init'
|
||||
|
||||
export const getStaticProps = fromPropz(getStaticPropz)
|
||||
export async function getStaticPropz() {
|
||||
|
|
|
@ -23,10 +23,10 @@ import {
|
|||
useFindActiveContracts,
|
||||
} from '../hooks/use-find-active-contracts'
|
||||
import { fromPropz, usePropz } from '../hooks/use-propz'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../lib/firebase/init'
|
||||
import { useGetRecentBets, useRecentBets } from '../hooks/use-bets'
|
||||
import { useActiveContracts } from '../hooks/use-contracts'
|
||||
import { useRecentComments } from '../hooks/use-comments'
|
||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
||||
|
||||
export const getStaticProps = fromPropz(getStaticPropz)
|
||||
export async function getStaticPropz() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user