Skip to content

Commit e531420

Browse files
fix: remove double IPFS and pull the logic to env variables (#1529)
* fix: remove double IPFS and pull the logic to env variables * Revert "fix: remove double IPFS and pull the logic to env variables" This reverts commit 81822e6. * fix: remove IPFS link if deploy mode is IPFS * refactor: clean up
1 parent 6cf07c6 commit e531420

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

dapp-oeth/src/components/IPFSDappLink.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import React, { useEffect, useState } from 'react'
22
import { fbt } from 'fbt-runtime'
3-
import { assetRootPath } from 'utils/image'
43

54
export default function IPFSDappLink({ css }) {
65
const [displayIpfsLink, setDisplayIpfsLink] = useState(false)
76

87
useEffect(() => {
98
setDisplayIpfsLink(
10-
['app.oeth.com', 'staging.app.oeth.com'].includes(window.location.host) ||
11-
window.location.host.startsWith('localhost:') ||
12-
window.location.host.startsWith('oeth-dapp-staging') ||
13-
window.location.host.endsWith('.on.fleek.co') ||
14-
window.location.host.startsWith('oeth-dapp')
9+
process.env.DEPLOY_MODE !== 'ipfs'
1510
)
1611
}, [])
1712

13+
if (!displayIpfsLink) {
14+
return null;
15+
}
16+
1817
return (
19-
<div className={`${!displayIpfsLink || css}`}>
18+
<div className={css}>
2019
<a
2120
className={`ipfs-link d-flex justify-content-center align-items-center`}
2221
href={process.env.NEXT_PUBLIC_IPFS_DAPP_URL}

0 commit comments

Comments
 (0)