Skip to content

Commit

Permalink
feat: add a flag to set maintenance status on deployment
Browse files Browse the repository at this point in the history
This commit allows the maintenance info to be displayed by
setting an environment variable "REACT_APP_IS_MAINTAINING=true"
So Devops can toggle the maintenance status by restarting
the service with different runtime env
  • Loading branch information
Keith-CY committed Aug 9, 2023
1 parent a868212 commit 555d4e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { dayjs, parseSimpleDateNoSecond } from '../../utils/date'
import SimpleButton from '../SimpleButton'
import { ComponentActions } from '../../contexts/actions'
import { AppCachedKeys } from '../../constants/cache'
import { IS_MAINTAINING } from '../../constants/common'
import styles from './styles.module.scss'
import { isMainnet } from '../../utils/chain'

const FIFTEEN_MINUTES = 15 * 60 * 1000

Expand Down Expand Up @@ -52,7 +52,7 @@ const Alert = () => {
)
}

if (!isMainnet()) {
if (IS_MAINTAINING) {
return <div className={styles.container}>{i18n.t('error.maintain')}</div>
}

Expand Down
1 change: 1 addition & 0 deletions src/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const EPOCH_HOURS = 4
export const ONE_DAY_SECOND = 24 * 60 * 60
export const ONE_HOUR_SECOND = 60 * 60
export const ONE_MINUTE_SECOND = 60
export const IS_MAINTAINING = process.env.REACT_APP_IS_MAINTAINING === 'true'

export function getPrimaryColor() {
return isMainnet() ? '#00CC9B' : '#9A2CEC'
Expand Down

0 comments on commit 555d4e7

Please sign in to comment.