Skip to content

Commit

Permalink
Fetch voting round name from .env
Browse files Browse the repository at this point in the history
  • Loading branch information
refi93 committed Oct 12, 2021
1 parent 3d02e03 commit a4f0f4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Expand Up @@ -67,6 +67,7 @@ ADALITE_ENABLE_SEARCH_BY_TICKER=true
# catalyst next round start and end dates in ISO format (example: 2021-2030)
ADALITE_NEXT_VOTING_START=2021-01-01T00:00:00.000Z
ADALITE_NEXT_VOTING_END=2030-01-01T00:00:00.000Z
ADALITE_NEXT_VOTING_ROUND_NAME=Fund6

# token registry
ADALITE_TOKEN_REGISTRY_URL="https://tokens.cardano.org"
Expand Down
1 change: 1 addition & 0 deletions app/cypress/.env.cypress
Expand Up @@ -65,6 +65,7 @@ ADALITE_ENABLE_SEARCH_BY_TICKER=true
# catalyst next round start and end dates in ISO format (example: 2021-2030)
ADALITE_NEXT_VOTING_START=2021-01-01T00:00:00.000Z
ADALITE_NEXT_VOTING_END=2030-01-01T00:00:00.000Z
ADALITE_NEXT_VOTING_ROUND_NAME=Fund6

# token registry
ADALITE_TOKEN_REGISTRY_URL="https://tokens.cardano.org"
3 changes: 2 additions & 1 deletion app/frontend/components/pages/voting/votingCard.tsx
Expand Up @@ -9,6 +9,7 @@ import {Lovelace} from '../../../types'
import {toAda} from '../../../helpers/adaConverters'
import styles from './voting.module.scss'
import * as QRious from '../../../libs/qrious'
import {ADALITE_CONFIG} from '../../../config'

const AppDownloadInfo = ({url, imageSrc}: {url: string; imageSrc: string}) => (
<div className={styles.catalystAppPair}>
Expand Down Expand Up @@ -37,7 +38,7 @@ const VotingCard = (): h.JSX.Element => {

const getUnmetPreconditionMessage = (): string | null => {
if (!isVotingRegistrationOpen()) {
return 'Registration for Fund6 Voting is closed.'
return `Registration for ${ADALITE_CONFIG.ADALITE_NEXT_VOTING_ROUND_NAME} Voting is closed.`
}
if (!hasEnoughFundsForCatalyst) {
return `Only users with more than ${toAda(
Expand Down
3 changes: 3 additions & 0 deletions server/helpers/loadConfig.js
Expand Up @@ -76,6 +76,7 @@ const checkMap = check.map(process.env, {
ADALITE_ENFORCE_STAKEPOOL: isBoolString,
ADALITE_NEXT_VOTING_START: isIsoString,
ADALITE_NEXT_VOTING_END: isIsoString,
ADALITE_NEXT_VOTING_ROUND_NAME: check.nonEmptyString,
ADALITE_TOKEN_REGISTRY_URL: check.nonEmptyString,
})

Expand Down Expand Up @@ -113,6 +114,7 @@ const {
ADALITE_ENABLE_LEDGER,
ADALITE_NEXT_VOTING_START,
ADALITE_NEXT_VOTING_END,
ADALITE_NEXT_VOTING_ROUND_NAME,
ADALITE_TOKEN_REGISTRY_URL,
} = process.env

Expand Down Expand Up @@ -178,6 +180,7 @@ const frontendConfig = {
ADALITE_ENABLE_SEARCH_BY_TICKER: ADALITE_ENABLE_SEARCH_BY_TICKER === 'true',
ADALITE_NEXT_VOTING_START: Date.parse(ADALITE_NEXT_VOTING_START),
ADALITE_NEXT_VOTING_END: Date.parse(ADALITE_NEXT_VOTING_END),
ADALITE_NEXT_VOTING_ROUND_NAME,
}

const backendConfig = {
Expand Down

0 comments on commit a4f0f4e

Please sign in to comment.