Rename access.ts to envs/constants.ts
This commit is contained in:
parent
dcafb50e06
commit
22799d1c3c
|
@ -1,6 +1,6 @@
|
||||||
import { DEV_CONFIG } from './envs/dev'
|
import { DEV_CONFIG } from './dev'
|
||||||
import { EnvConfig, PROD_CONFIG } from './envs/prod'
|
import { EnvConfig, PROD_CONFIG } from './prod'
|
||||||
import { THEOREMONE_CONFIG } from './envs/theoremone'
|
import { THEOREMONE_CONFIG } from './theoremone'
|
||||||
|
|
||||||
const ENV = process.env.NEXT_PUBLIC_FIREBASE_ENV ?? 'PROD'
|
const ENV = process.env.NEXT_PUBLIC_FIREBASE_ENV ?? 'PROD'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ENV_CONFIG } from '../access'
|
import { ENV_CONFIG } from '../envs/constants'
|
||||||
|
|
||||||
const formatter = new Intl.NumberFormat('en-US', {
|
const formatter = new Intl.NumberFormat('en-US', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
cleanUsername,
|
cleanUsername,
|
||||||
} from '../../common/util/clean-username'
|
} from '../../common/util/clean-username'
|
||||||
import { sendWelcomeEmail } from './emails'
|
import { sendWelcomeEmail } from './emails'
|
||||||
import { isWhitelisted } from '../../common/access'
|
import { isWhitelisted } from '../../common/envs/constants'
|
||||||
|
|
||||||
export const createUser = functions
|
export const createUser = functions
|
||||||
.runWith({ minInstances: 1 })
|
.runWith({ minInstances: 1 })
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import _ = require('lodash')
|
import _ = require('lodash')
|
||||||
import { DOMAIN, PROJECT_ID } from '../../common/access'
|
import { DOMAIN, PROJECT_ID } from '../../common/envs/constants'
|
||||||
import { Answer } from '../../common/answer'
|
import { Answer } from '../../common/answer'
|
||||||
import { Bet } from '../../common/bet'
|
import { Bet } from '../../common/bet'
|
||||||
import { getProbability } from '../../common/calculate'
|
import { getProbability } from '../../common/calculate'
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { Contract } from '../../common/contract'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { Row } from './layout/row'
|
import { Row } from './layout/row'
|
||||||
import { ENV_CONFIG } from '../../common/access'
|
import { ENV_CONFIG } from '../../common/envs/constants'
|
||||||
|
|
||||||
export function FeedPromo(props: { hotContracts: Contract[] }) {
|
export function FeedPromo(props: { hotContracts: Contract[] }) {
|
||||||
const { hotContracts } = props
|
const { hotContracts } = props
|
||||||
|
|
|
@ -2,7 +2,7 @@ import Link from 'next/link'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
|
|
||||||
import { useUser } from '../hooks/use-user'
|
import { useUser } from '../hooks/use-user'
|
||||||
import { ENV_CONFIG } from '../../common/access'
|
import { ENV_CONFIG } from '../../common/envs/constants'
|
||||||
|
|
||||||
export function ManifoldLogo(props: {
|
export function ManifoldLogo(props: {
|
||||||
className?: string
|
className?: string
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { formatMoney } from '../../common/util/format'
|
||||||
import { Avatar } from './avatar'
|
import { Avatar } from './avatar'
|
||||||
import { Col } from './layout/col'
|
import { Col } from './layout/col'
|
||||||
import { MenuButton } from './menu'
|
import { MenuButton } from './menu'
|
||||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
import { IS_PRIVATE_MANIFOLD } from '../../common/envs/constants'
|
||||||
|
|
||||||
export function ProfileMenu(props: { user: User | undefined }) {
|
export function ProfileMenu(props: { user: User | undefined }) {
|
||||||
const { user } = props
|
const { user } = props
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { isAdmin } from '../../common/access'
|
import { isAdmin } from '../../common/envs/constants'
|
||||||
import { usePrivateUser, useUser } from './use-user'
|
import { usePrivateUser, useUser } from './use-user'
|
||||||
|
|
||||||
export const useAdmin = () => {
|
export const useAdmin = () => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
import { IS_PRIVATE_MANIFOLD } from '../../common/envs/constants'
|
||||||
|
|
||||||
type PropzProps = {
|
type PropzProps = {
|
||||||
params: any
|
params: any
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { getFirestore } from '@firebase/firestore'
|
import { getFirestore } from '@firebase/firestore'
|
||||||
import { initializeApp, getApps, getApp } from 'firebase/app'
|
import { initializeApp, getApps, getApp } from 'firebase/app'
|
||||||
import { FIREBASE_CONFIG } from '../../../common/access'
|
import { FIREBASE_CONFIG } from '../../../common/envs/constants'
|
||||||
|
|
||||||
// Initialize Firebase
|
// Initialize Firebase
|
||||||
export const app = getApps().length ? getApp() : initializeApp(FIREBASE_CONFIG)
|
export const app = getApps().length ? getApp() : initializeApp(FIREBASE_CONFIG)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { PROJECT_ID } from '../../../common/access'
|
import { PROJECT_ID } from '../../../common/envs/constants'
|
||||||
|
|
||||||
export const checkoutURL = (
|
export const checkoutURL = (
|
||||||
userId: string,
|
userId: string,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
import { IS_PRIVATE_MANIFOLD } from '../../common/envs/constants'
|
||||||
import { Page } from '../components/page'
|
import { Page } from '../components/page'
|
||||||
import { Title } from '../components/title'
|
import { Title } from '../components/title'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Html, Head, Main, NextScript } from 'next/document'
|
import { Html, Head, Main, NextScript } from 'next/document'
|
||||||
import { ENV_CONFIG } from '../../common/access'
|
import { ENV_CONFIG } from '../../common/envs/constants'
|
||||||
|
|
||||||
export default function Document() {
|
export default function Document() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
import { IS_PRIVATE_MANIFOLD } from '../../common/envs/constants'
|
||||||
import { DailyCountChart } from '../components/analytics/charts'
|
import { DailyCountChart } from '../components/analytics/charts'
|
||||||
import { Col } from '../components/layout/col'
|
import { Col } from '../components/layout/col'
|
||||||
import { Spacer } from '../components/layout/spacer'
|
import { Spacer } from '../components/layout/spacer'
|
||||||
|
|
|
@ -26,7 +26,7 @@ import { fromPropz, usePropz } from '../hooks/use-propz'
|
||||||
import { useGetRecentBets, useRecentBets } from '../hooks/use-bets'
|
import { useGetRecentBets, useRecentBets } from '../hooks/use-bets'
|
||||||
import { useActiveContracts } from '../hooks/use-contracts'
|
import { useActiveContracts } from '../hooks/use-contracts'
|
||||||
import { useRecentComments } from '../hooks/use-comments'
|
import { useRecentComments } from '../hooks/use-comments'
|
||||||
import { IS_PRIVATE_MANIFOLD } from '../../common/access'
|
import { IS_PRIVATE_MANIFOLD } from '../../common/envs/constants'
|
||||||
|
|
||||||
export const getStaticProps = fromPropz(getStaticPropz)
|
export const getStaticProps = fromPropz(getStaticPropz)
|
||||||
export async function getStaticPropz() {
|
export async function getStaticPropz() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user