Skip to content

Commit

Permalink
Merge pull request #87 from onflow/cf/rebrand-previewnet
Browse files Browse the repository at this point in the history
Rebrand Previewnet
  • Loading branch information
chasefleming authored Feb 26, 2024
2 parents 5b72914 + 86b4f97 commit 73c28a3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
NEXT_PUBLIC_SIGNER_ADDRESS: "0xf8d6e0586b0a20c7"
SIGNER_PRIVATE_KEY: "91a22fbd87392b019fbe332c32695c14cf2ba5b6521476a8540228bdf1987068"
NEXT_PUBLIC_TEST_NET_URL: "http://localhost:3000"
NEXT_PUBLIC_CRESCENDO_URL: "http://localhost:3000"
NEXT_PUBLIC_PREVIEWNET_URL: "http://localhost:3000"
NEXT_PUBLIC_TOKEN_AMOUNT_FLOW: "1000.0"
NEXT_PUBLIC_TOKEN_AMOUNT_FUSD: "10.0"
NEXT_PUBLIC_CONTRACT_FUNGIBLE_TOKEN: "0xee82856bf20e2aa6"
Expand Down
14 changes: 7 additions & 7 deletions components/NetworkLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsxImportSource theme-ui */

import TabNav, {TabNavLink} from "components/TabNav"
import {TEST_NET, CRESCENDO_NET} from "lib/constants"
import {TEST_NET, PREVIEW_NET} from "lib/constants"
import {NETWORK_DISPLAY_NAME} from "lib/network"
import publicConfig from "lib/publicConfig"

Expand Down Expand Up @@ -41,19 +41,19 @@ export default function NetworkLinks() {
Testnet
</TabNavLink>
<TabNavLink
href={publicConfig.crescendoNetUrl}
active={publicConfig.network === CRESCENDO_NET}
href={publicConfig.previewnetUrl}
active={publicConfig.network === PREVIEW_NET}
>
<img
src={
publicConfig.network === CRESCENDO_NET
? "crescendo-faucet-icon.svg"
publicConfig.network === PREVIEW_NET
? "previewnet-faucet-icon.svg"
: "gray-faucet-icon.svg"
}
alt="Crescendo Faucet"
alt={`${NETWORK_DISPLAY_NAME} Faucet`}
sx={{mr: 2}}
/>
Crescendo
Previewnet
</TabNavLink>
</TabNav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import publicConfig from "lib/publicConfig"
import Head from "next/head"

export const BASE_HTML_TITLE = `Flow ${
publicConfig.network === TEST_NET ? "Testnet" : "Crescendo"
publicConfig.network === TEST_NET ? "Testnet" : "Previewnet"
} Faucet`

export default function PageTitle({children}: {children?: string}) {
Expand Down
2 changes: 1 addition & 1 deletion env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NEXT_PUBLIC_NETWORK=testnet
NEXT_PUBLIC_TEST_NET_URL=http://localhost:3000
NEXT_PUBLIC_CRESCENDO_URL=http://localhost:3000
NEXT_PUBLIC_PREVIEWNET_URL=http://localhost:3000
NEXT_PUBLIC_MIXPANEL_TOKEN="dev"
NEXT_PUBLIC_TOKEN_AMOUNT_FLOW=1000.0
NEXT_PUBLIC_TOKEN_AMOUNT_FUSD=10.0
Expand Down
6 changes: 3 additions & 3 deletions lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type Networks = "testnet" | "crescendo"
export type Networks = "testnet" | "previewnet"
export type TokenTypes = typeof FLOW_TYPE | typeof FUSD_TYPE

export const TEST_NET = "testnet"
export const CRESCENDO_NET = "crescendo"
export const PREVIEW_NET = "previewnet"
export const FLOW_TYPE = "FLOW"
export const FUSD_TYPE = "FUSD"
export const NETWORK_STATUS_URL = "https://status.onflow.org/"
Expand Down Expand Up @@ -37,5 +37,5 @@ export const ADDRESS_REGEXP = /^(0x)?([0-9a-fA-F]{16}|[0-9a-fA-F]{40})$/

export const NETWORK_CODEWORDS = {
testnet: "0x6834ba37b3980209",
crescendo: "0x5211829E88528817",
previewnet: "0x5211829E88528817",
}
8 changes: 4 additions & 4 deletions lib/publicConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if (!network) throw "Missing NEXT_PUBLIC_NETWORK"
const testNetUrl = process.env.NEXT_PUBLIC_TEST_NET_URL
if (!testNetUrl) throw "Missing NEXT_PUBLIC_TEST_NET_URL"

const crescendoNetUrl = process.env.NEXT_PUBLIC_CRESCENDO_URL
if (!crescendoNetUrl) throw "Missing NEXT_PUBLIC_CRESCENDO_URL"
const previewnetUrl = process.env.NEXT_PUBLIC_PREVIEWNET_URL
if (!previewnetUrl) throw "Missing NEXT_PUBLIC_PREVIEWNET_URL"

const tokenAmountFlow = process.env.NEXT_PUBLIC_TOKEN_AMOUNT_FLOW
if (!tokenAmountFlow) throw "Missing NEXT_PUBLIC_TOKEN_AMOUNT_FLOW"
Expand Down Expand Up @@ -37,7 +37,7 @@ const walletDiscovery = process.env.NEXT_PUBLIC_WALLET_DISCOVERY
export type PublicConfig = {
network: Networks
testNetUrl: string
crescendoNetUrl: string
previewnetUrl: string
tokenAmountFlow: string
tokenAmountFusd: string
hcaptchaSiteKey: string
Expand All @@ -54,7 +54,7 @@ export type PublicConfig = {
const publicConfig: PublicConfig = {
network,
testNetUrl,
crescendoNetUrl,
previewnetUrl: previewnetUrl,
tokenAmountFlow,
tokenAmountFusd,
hcaptchaSiteKey:
Expand Down
File renamed without changes
File renamed without changes

0 comments on commit 73c28a3

Please sign in to comment.