How to use the globals.URLS.APP_URLS_PROD function in globals

To help you get started, we’ve selected a few globals examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gnosis / dx-react / src / index.tsx View on Github external
URLS.APP_URLS_LOCAL.includes(hostname) ||
      hostname.startsWith('10')
  ) return preAppRender().catch(console.error)

  /* PRODUCTION builds should be geoBlocked */
  if (FE_CONDITIONAL_ENV === 'production') {
    /* Scenario 1a: User is a developer on any of the STAGING URLS OR ipfs */
    if (URLS.APP_URLS_STAGING.includes(hostname) || hostname.includes('ipfs')) {
      blocked = await isGeoBlocked()
      blocked && (disabledReason = 'geoblock')

      !URLS.APP_URLS_STAGING.includes(hostname) && ReactGA.initialize(GA_CODES.IPFS)
    }
    // Main release Scenarios:
    /* Scenario 2: User is using the dx on dutchx-rinkeby (RINKEBY): BLOCK: networks */
    else if (hostname === URLS.APP_URLS_PROD[1]) {
      ALLOWED_NETWORK = 'Rinkeby Test Network'
      blocked = await isNetBlocked(['4'])
      if (blocked) disabledReason = 'networkblock'
      // init GA
      ReactGA.initialize(GA_CODES.RINKEBY)
    }
    /* Scenario 3: User is using the dx on dutchx.app (MAIN): BLOCK: all networks + geoblock */
    else if (hostname === URLS.APP_URLS_PROD[0]) {
      ALLOWED_NETWORK = 'Ethereum Mainnet'
      const netBlockedPromise = isNetBlocked(['1'])
      // geoblock gets precedence, checked last
      blocked = await isGeoBlocked()
      if (blocked) {
        disabledReason = 'geoblock'
      } else {
        blocked = await netBlockedPromise
github gnosis / dx-react / src / index.tsx View on Github external
!URLS.APP_URLS_STAGING.includes(hostname) && ReactGA.initialize(GA_CODES.IPFS)
    /* Scenario 1b: User is a developer on a PR-review URL */
    } else if (URLS.APP_URLS_PR_REVIEW_TEST(hostname)) {
      blocked = false
    }
    // Main release Scenarios:
    /* Scenario 2: User is using the dx on dutchx-rinkeby (RINKEBY): BLOCK: networks */
    else if (URLS.APP_URLS_PROD.RINKEBY.includes(hostname)) {
      ALLOWED_NETWORK = 'Rinkeby Test Network'
      blocked = await isNetBlocked(['4'])
      if (blocked) disabledReason = 'networkblock'
      // init GA
      ReactGA.initialize(GA_CODES.RINKEBY)
    }
    /* Scenario 3: User is using the dx on dutchx.app (MAIN): BLOCK: all networks + geoblock */
    else if (URLS.APP_URLS_PROD.MAIN.includes(hostname)) {
      ALLOWED_NETWORK = 'Ethereum Mainnet'
      const netBlockedPromise = isNetBlocked(['1'])
      // geoblock gets precedence, checked last
      blocked = await isGeoBlocked()
      if (blocked) {
        disabledReason = 'geoblock'
      } else {
        blocked = await netBlockedPromise
        if (blocked) disabledReason = 'networkblock'
      }
      // init GA
      ReactGA.initialize(GA_CODES.MAIN)
    }
    else {
      // fallback
      console.warn('No hostname match - fallingback to geographical block')
github gnosis / dx-react / src / index.tsx View on Github external
blocked = await isGeoBlocked()
      blocked && (disabledReason = 'geoblock')

      !URLS.APP_URLS_STAGING.includes(hostname) && ReactGA.initialize(GA_CODES.IPFS)
    }
    // Main release Scenarios:
    /* Scenario 2: User is using the dx on dutchx-rinkeby (RINKEBY): BLOCK: networks */
    else if (hostname === URLS.APP_URLS_PROD[1]) {
      ALLOWED_NETWORK = 'Rinkeby Test Network'
      blocked = await isNetBlocked(['4'])
      if (blocked) disabledReason = 'networkblock'
      // init GA
      ReactGA.initialize(GA_CODES.RINKEBY)
    }
    /* Scenario 3: User is using the dx on dutchx.app (MAIN): BLOCK: all networks + geoblock */
    else if (hostname === URLS.APP_URLS_PROD[0]) {
      ALLOWED_NETWORK = 'Ethereum Mainnet'
      const netBlockedPromise = isNetBlocked(['1'])
      // geoblock gets precedence, checked last
      blocked = await isGeoBlocked()
      if (blocked) {
        disabledReason = 'geoblock'
      } else {
        blocked = await netBlockedPromise
        if (blocked) disabledReason = 'networkblock'
      }
      // init GA
      ReactGA.initialize(GA_CODES.MAIN)
    }
    else {
      // fallback
      console.warn('No hostname match - fallingback to geographical block')
github gnosis / dx-react / src / utils / location.ts View on Github external
const locationListener = (history: any) => {
  if (typeof window === 'undefined') return

    // history listen on change
  if (window.location.hostname !== URLS.APP_URLS_PROD.MAIN[0]) {
    history.listen((loc: any) => {
      const searchParams = new URLSearchParams(loc.search)
      searchParams.has('retro-x') && document.body.classList.add('THEME')
    })
  }
    // fix slow.trade/rinkeby && rinkeby#/ issue
  if (window.location.href.startsWith(MAIN_RINKEBY_URL)) {
    window.location.replace(`https://${URLS.APP_URLS_PROD.RINKEBY[0]}`)
  }
}
github gnosis / dx-react / src / containers / AppValidator / index.tsx View on Github external
renderError = () => {
    const { error, loading, online, set_up_complete } = this.state,
      { disclaimer_accepted } = this.props

    if (!disclaimer_accepted || loading) return

    return (
      <>
        {process.env.FE_CONDITIONAL_ENV === 'development' &amp;&amp; <div><span>ATTENTION: You are in DEVELOPMENT</span></div>}
        {process.env.CLAIM_ONLY &amp;&amp; <div><span>ATTENTION: This is a deprecated version of slow.trade. CLAIM ONLY mode is active - for trading on the latest version, please click <a href="{`https://${URLS.APP_URLS_PROD.MAIN[0]}`}">here</a>. </span></div>}
        { !online &amp;&amp; <div><span>App is currently offline - please your check internet connection and refresh the page </span></div> }
        { (!set_up_complete || !this.props.unlocked) &amp;&amp; online &amp;&amp; <div><span>{ error ? `App problems detected: ${error}` : 'App problems detected. Please check your provider and refresh the page.' } </span></div> }
        {/* TEMPORARY - TODO: REMOVE */}
        <div><span>Withdraw and claim funds from previous versions <a href="{`https://${URLS.APP_URLS_PROD.MAIN[1]}`}">here</a></span></div>
      
    )
  }
github gnosis / dx-react / src / index.tsx View on Github external
/* PRODUCTION builds should be geoBlocked */
  if (FE_CONDITIONAL_ENV === 'production') {
    /* Scenario 1a: User is a developer on any of the STAGING URLS OR ipfs */
    if (URLS.APP_URLS_STAGING.includes(hostname) || hostname.includes('ipfs')) {
      blocked = await isGeoBlocked()
      blocked && (disabledReason = 'geoblock')

      !URLS.APP_URLS_STAGING.includes(hostname) && ReactGA.initialize(GA_CODES.IPFS)
    /* Scenario 1b: User is a developer on a PR-review URL */
    } else if (URLS.APP_URLS_PR_REVIEW_TEST(hostname)) {
      blocked = false
    }
    // Main release Scenarios:
    /* Scenario 2: User is using the dx on dutchx-rinkeby (RINKEBY): BLOCK: networks */
    else if (URLS.APP_URLS_PROD.RINKEBY.includes(hostname)) {
      ALLOWED_NETWORK = 'Rinkeby Test Network'
      blocked = await isNetBlocked(['4'])
      if (blocked) disabledReason = 'networkblock'
      // init GA
      ReactGA.initialize(GA_CODES.RINKEBY)
    }
    /* Scenario 3: User is using the dx on dutchx.app (MAIN): BLOCK: all networks + geoblock */
    else if (URLS.APP_URLS_PROD.MAIN.includes(hostname)) {
      ALLOWED_NETWORK = 'Ethereum Mainnet'
      const netBlockedPromise = isNetBlocked(['1'])
      // geoblock gets precedence, checked last
      blocked = await isGeoBlocked()
      if (blocked) {
        disabledReason = 'geoblock'
      } else {
        blocked = await netBlockedPromise
github gnosis / dx-react / src / utils / location.ts View on Github external
const locationListener = (history: any) => {
  if (typeof window === 'undefined') return

    // history listen on change
  if (window.location.hostname !== URLS.APP_URLS_PROD.MAIN[0]) {
    history.listen((loc: any) => {
      const searchParams = new URLSearchParams(loc.search)
      searchParams.has('retro-x') && document.body.classList.add('THEME')
    })
  }
    // fix slow.trade/rinkeby && rinkeby#/ issue
  if (window.location.href.startsWith(MAIN_RINKEBY_URL)) {
    window.location.replace(`https://${URLS.APP_URLS_PROD.RINKEBY[0]}`)
  }
}
github gnosis / dx-react / src / containers / AppValidator / index.tsx View on Github external
renderError = () =&gt; {
    const { error, loading, online, set_up_complete } = this.state,
      { disclaimer_accepted } = this.props

    if (!disclaimer_accepted || loading) return

    return (
      &lt;&gt;
        {process.env.FE_CONDITIONAL_ENV === 'development' &amp;&amp; <div><span>ATTENTION: You are in DEVELOPMENT</span></div>}
        {process.env.CLAIM_ONLY &amp;&amp; <div><span>ATTENTION: This is a deprecated version of slow.trade. CLAIM ONLY mode is active - for trading on the latest version, please click <a href="{`https://${URLS.APP_URLS_PROD.MAIN[0]}`}">here</a>. </span></div>}
        { !online &amp;&amp; <div><span>App is currently offline - please your check internet connection and refresh the page </span></div> }
        { (!set_up_complete || !this.props.unlocked) &amp;&amp; online &amp;&amp; <div><span>{ error ? `App problems detected: ${error}` : 'App problems detected. Please check your provider and refresh the page.' } </span></div> }
        {/* TEMPORARY - TODO: REMOVE */}
        <div><span>Withdraw and claim funds from previous versions <a href="{`https://${URLS.APP_URLS_PROD.MAIN[1]}`}">here</a></span></div>
      
    )
  }
github gnosis / dx-react / src / components / NoWallet / index.tsx View on Github external
export const ClaimOnly: React.SFC = () =&gt;
    <div>

        <h2><strong><span>ATTENTION</span>: CLAIM ONLY MODE</strong></h2>
        
        <p>
          <strong>This is a deprecated version of {COMPANY_NAME}.</strong>
          <br><br>
          Trading is no longer available on this contract version. You may only <span>withdraw</span> your funds.
          <br><br>
          For trading, please head to the latest, up-to-date version available below:
        </p>

        <a rel="noopener noreferrer" href="{`https://${URLS.APP_URLS_PROD.MAIN[0]}`}">
          Trade on {COMPANY_NAME} <i></i>
        </a>
    </div>
github gnosis / dx-react / src / components / ContentPage / index.tsx View on Github external
There are market economics at work to ensure this. But to put your mind at ease:
          all token trades on <strong>slow.trade</strong> will get a comparable price to other trading
          platforms, if not a better one.
        <p></p>
        <p>
          For more details, check out "I don't know beforehand how much of a token I will
          receive —will I get the fair amount?"
        </p>
      
    

    <section id="can-i-test-it-first">
      <h3>Can I test it first?</h3>
      <span>
        <p>
          Yes, absolutely! We actually recommend that you first familiarize yourself with the auction mechanism on <strong>slow.trade</strong> using the <a rel="noopener noreferrer" href="{`https://${URLS.APP_URLS_PROD.RINKEBY[0]}`}">Rinkeby Testnet</a>. This allows you to interact with the DutchX Rinkeby Protocol. To do so, make sure your Wallet is set to Rinkeby.
        </p>
      </span>
    </section>

    <section id="how-long-auction-takes">
      <h3>How long does an auction take?</h3>
      <span>
        <p>
          A typical auction is expected to run for about<strong> 6 hours</strong>. After 6 hours, the auction reaches the prior closing price, which serves as an indication for length and price (the last available market price). Due to potential price fluctuations, which can often be quite significant in the cryptocurrency space, <strong>the auction may close earlier or run longer.</strong>
        </p>
      </span>
    </section>

    <section id="when-do-i-claim-tokens">
      <h3>When do I claim my tokens?</h3>
      <span></span></section>