Skip to content

Commit fd85b5f

Browse files
authored
Merge branch 'main' into topup
2 parents cf36d08 + b123fe1 commit fd85b5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3210
-2849
lines changed

.env.example

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ REACT_APP_FEATURE_FLAG_TBTC_V2=true
88
REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true
99
REACT_APP_FEATURE_FLAG_MULTI_APP_STAKING=true
1010
REACT_APP_FEATURE_FLAG_FEEDBACK_MODULE=false
11-
REACT_APP_FEATURE_FLAG_POSTHOG=false
12-
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
1311
REACT_APP_FEATURE_FLAG_LEDGER_LIVE=true
12+
13+
REACT_APP_FEATURE_FLAG_GOOGLE_TAG_MANAGER=false
14+
REACT_APP_GOOGLE_TAG_MANAGER_ID=$GOOGLE_TAG_MANAGER_ID
15+
16+
REACT_APP_FEATURE_FLAG_POSTHOG=false
17+
18+
REACT_APP_FEATURE_FLAG_SENTRY=false
1419
REACT_APP_SENTRY_DSN=$SENTRY_DSN
1520

1621
REACT_APP_ELECTRUM_PROTOCOL=$ELECTRUM_PROTOCOL

.env.production

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ REACT_APP_FEATURE_FLAG_TBTC_V2=true
77
REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true
88
REACT_APP_FEATURE_FLAG_MULTI_APP_STAKING=true
99
REACT_APP_FEATURE_FLAG_FEEDBACK_MODULE=false
10+
REACT_APP_FEATURE_FLAG_LEDGER_LIVE=true
11+
12+
REACT_APP_FEATURE_FLAG_GOOGLE_TAG_MANAGER=$GOOGLE_TAG_MANAGER_SUPPORT
13+
REACT_APP_GOOGLE_TAG_MANAGER_ID=$GOOGLE_TAG_MANAGER_ID
14+
1015
REACT_APP_FEATURE_FLAG_POSTHOG=$POSTHOG_SUPPORT
1116
REACT_APP_POSTHOG_API_KEY=$POSTHOG_API_KEY
1217
REACT_APP_POSTHOG_HOSTNAME_HTTP=$POSTHOG_HOSTNAME_HTTP
18+
1319
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
14-
REACT_APP_FEATURE_FLAG_LEDGER_LIVE=true
1520
REACT_APP_SENTRY_DSN=$SENTRY_DSN
1621

1722
REACT_APP_ELECTRUM_PROTOCOL=$ELECTRUM_PROTOCOL

.github/workflows/dashboard-mainnet.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
SENTRY_SUPPORT: true
5959
SENTRY_DSN: ${{ secrets.MAINNET_SENTRY_DSN }}
6060
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
61+
GOOGLE_TAG_MANAGER_SUPPORT: false
62+
GOOGLE_TAG_MANAGER_ID: ${{ secrets.GOOGLE_TAG_MANAGER_ID }}
6163

6264
- name: Build
6365
if: github.event_name == 'release'
@@ -77,6 +79,8 @@ jobs:
7779
SENTRY_SUPPORT: true
7880
SENTRY_DSN: ${{ secrets.MAINNET_SENTRY_DSN }}
7981
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
82+
GOOGLE_TAG_MANAGER_SUPPORT: true
83+
GOOGLE_TAG_MANAGER_ID: ${{ secrets.GOOGLE_TAG_MANAGER_ID }}
8084

8185
- uses: actions/upload-artifact@v3
8286
with:

.github/workflows/reusable-build-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
- name: Resolve contracts
139139
shell: bash
140140
run: |
141-
yarn upgrade \
141+
yarn upgrade --ignore-scripts \
142142
@threshold-network/solidity-contracts@${{ steps.set-packages-versions.outputs.threshold-contracts-version }} \
143143
@keep-network/keep-core@${{ inputs.environment }} \
144144
@keep-network/keep-ecdsa@${{ inputs.environment }} \

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ git config --global url."https://".insteadOf git://
5656

5757
Ref: https://github.com/keep-network/tbtc-v2/pull/403
5858

59-
Instead of the goerli contracts above you can also use `dapp-development-sepolia` contracts. They offer shorter durations for some specific elements in the contracts in comparison to goerli/mainnet and also allow to manually control mint and unmint process of tbtc-v2 (for more information see please see https://github.com/keep-network/tbtc-v2/pull/403) To install sepolia-dev contracts run:
59+
Instead of the `sepolia` contracts above you can also use `dapp-development-sepolia` contracts. They offer shorter durations for some specific elements in the contracts in comparison to `sepolia`/`mainnet` and also allow to manually control mint and unmint process of `tbtc-v2` (for more information see please see https://github.com/keep-network/tbtc-v2/pull/403). To install sepolia-dev contracts run:
6060

6161
```
6262
yarn @keep-network/keep-core@sepolia \
@@ -118,8 +118,14 @@ REACT_APP_FEATURE_FLAG_TBTC_V2=true
118118
REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true
119119
REACT_APP_FEATURE_FLAG_MULTI_APP_STAKING=true
120120
REACT_APP_FEATURE_FLAG_FEEDBACK_MODULE=false
121+
REACT_APP_FEATURE_FLAG_LEDGER_LIVE=true
122+
123+
REACT_APP_FEATURE_FLAG_GOOGLE_TAG_MANAGER=false
124+
REACT_APP_GOOGLE_TAG_MANAGER_ID=$GOOGLE_TAG_MANAGER_ID
125+
121126
REACT_APP_FEATURE_FLAG_POSTHOG=false
122-
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
127+
128+
REACT_APP_FEATURE_FLAG_SENTRY=false
123129
REACT_APP_SENTRY_DSN=$SENTRY_DSN
124130
125131
REACT_APP_ELECTRUM_PROTOCOL=wss

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "token-dashboard",
3-
"version": "1.15.0-pre",
3+
"version": "1.16.0-pre",
44
"private": true,
55
"engines": {
66
"node": ">=16"

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { useSentry } from "./hooks/sentry"
6262
import { useIsEmbed } from "./hooks/useIsEmbed"
6363
import TBTC from "./pages/tBTC"
6464
import { useDetectIfEmbed } from "./hooks/useDetectIfEmbed"
65+
import { useGoogleTagManager } from "./hooks/google-tag-manager"
6566

6667
const Web3EventHandlerComponent = () => {
6768
useSubscribeToVendingMachineContractEvents()
@@ -175,6 +176,7 @@ const AppBody = () => {
175176
}, [dispatch])
176177

177178
useDetectIfEmbed()
179+
useGoogleTagManager()
178180
usePosthog()
179181
useCheckBonusEligibility()
180182
useFetchStakingRewards()

src/components/AnnouncementBanner/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from "@threshold-network/components"
1515
import ButtonLink from "../ButtonLink"
1616

17-
export type AnnouncementBannerContainerProps = {
17+
type AnnouncementBannerContainerProps = {
1818
variant?: "primary" | "secondary"
1919
size?: "sm" | "lg"
2020
hideCloseBtn?: boolean

src/components/Modal/DeauthorizeApplicationModal/InititateDeauthorization.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ const InitiateDeauthorization: FC<
4343
isOperatorInPool,
4444
operator,
4545
}) => {
46-
const shouldUpdateOperatorStatusAfterInitiation =
47-
isOperatorInPool !== undefined && !isOperatorInPool
46+
let shouldUpdateOperatorStatusAfterInitiation
47+
if (stakingAppName === "taco") {
48+
shouldUpdateOperatorStatusAfterInitiation = false
49+
} else {
50+
shouldUpdateOperatorStatusAfterInitiation =
51+
isOperatorInPool !== undefined && !isOperatorInPool
52+
}
4853
const { sendTransaction } = useInitiateDeauthorization(
4954
stakingAppName,
5055
shouldUpdateOperatorStatusAfterInitiation

src/components/Modal/SelectWalletModal/ConnectCoinbase.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { FC } from "react"
22
import { useWeb3React } from "@web3-react/core"
33
import { WalletConnectionModalBase } from "./components"
4-
import { ConnectionError, WalletType } from "../../../enums"
4+
import { ConnectionError } from "../../../enums"
55
import { coinbaseConnector } from "../../../web3/connectors"
66
import CoinbaseStatusAlert from "./components/CoinbaseStatusAlert"
77
import { CoinbaseWallet } from "../../../static/icons/CoinbaseWallet"
@@ -34,7 +34,6 @@ const ConnectCoinbase: FC<{ goBack: () => void; closeModal: () => void }> = ({
3434
tryAgain={
3535
connectionRejected ? () => activate(coinbaseConnector) : undefined
3636
}
37-
walletType={WalletType.Coinbase}
3837
>
3938
<CoinbaseStatusAlert
4039
connectionRejected={connectionRejected}

src/components/Modal/SelectWalletModal/ConnectLedgerLive.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FC } from "react"
22
import { useWeb3React } from "@web3-react/core"
33
import { ledgerLive } from "../../../web3/connectors"
44
import { WalletConnectionModalBase } from "./components"
5-
import { ConnectionError, WalletType } from "../../../enums"
5+
import { ConnectionError } from "../../../enums"
66
import doesErrorInclude from "../../../web3/utils/doesErrorInclude"
77
import { LedgerLight } from "../../../static/icons/LedgerLight"
88
import { LedgerDark } from "../../../static/icons/LedgerDark"
@@ -34,7 +34,6 @@ const ConnectLedgerLive: FC<{ goBack: () => void; closeModal: () => void }> = ({
3434
: ""
3535
}
3636
tryAgain={connectionRejected ? () => activate(ledgerLive) : undefined}
37-
walletType={WalletType.LedgerLive}
3837
shouldForceCloseModal
3938
/>
4039
)

src/components/Modal/SelectWalletModal/ConnectMetamask.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
metamask,
77
} from "../../../web3/connectors"
88
import { MetamaskStatusAlert, WalletConnectionModalBase } from "./components"
9-
import { ConnectionError, WalletType } from "../../../enums"
9+
import { ConnectionError } from "../../../enums"
1010
import doesErrorInclude from "../../../web3/utils/doesErrorInclude"
1111

1212
const ConnectMetamask: FC<{ goBack: () => void; closeModal: () => void }> = ({
@@ -38,7 +38,6 @@ const ConnectMetamask: FC<{ goBack: () => void; closeModal: () => void }> = ({
3838
!error ? "The MetaMask extension will open in an external window." : ""
3939
}
4040
tryAgain={connectionRejected ? () => activate(metamask) : undefined}
41-
walletType={WalletType.Metamask}
4241
>
4342
<MetamaskStatusAlert
4443
metamaskNotInstalled={metamaskNotInstalled}

src/components/Modal/SelectWalletModal/ConnectTaho.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
WalletInitializeAlert,
1919
WalletRejectedAlert,
2020
} from "./components"
21-
import { ExternalHref, WalletType } from "../../../enums"
21+
import { ExternalHref } from "../../../enums"
2222
import Link from "../../Link"
2323

2424
const ConnectTaho: FC<{ goBack: () => void; closeModal: () => void }> = ({
@@ -59,7 +59,6 @@ const ConnectTaho: FC<{ goBack: () => void; closeModal: () => void }> = ({
5959
}
6060
: undefined
6161
}
62-
walletType={WalletType.TAHO}
6362
>
6463
{isTahoNotInstalled && <InstallTaho />}
6564
{isTahoNotDefaultWallet && <TahoIsNotSetAsDefaultWallet />}

src/components/Modal/SelectWalletModal/ConnectWalletConnect.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
WalletConnectionModalBase,
66
WalletConnectStatusAlert,
77
} from "./components"
8-
import { ConnectionError, WalletType } from "../../../enums"
8+
import { ConnectionError } from "../../../enums"
99
import doesErrorInclude from "../../../web3/utils/doesErrorInclude"
1010
import { walletConnect } from "../../../web3/connectors/walletConnect"
1111

@@ -35,7 +35,6 @@ const ConnectWalletConnect: FC<{
3535
walletConnect.provider = undefined
3636
activate(walletConnect)
3737
}}
38-
walletType={WalletType.WalletConnect}
3938
shouldForceCloseModal
4039
>
4140
<WalletConnectStatusAlert

src/components/Modal/SelectWalletModal/components/WalletConnectionModalBase.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import { BaseModalProps } from "../../../../types"
1515
import { BodyMd, H4 } from "@threshold-network/components"
1616
import { AbstractConnector } from "../../../../web3/connectors"
1717
import { WalletType } from "../../../../enums"
18-
import { useCapture } from "../../../../hooks/posthog"
19-
import { PosthogEvent } from "../../../../types/posthog"
2018

2119
interface Props extends BaseModalProps {
2220
WalletIcon: any
@@ -26,7 +24,6 @@ interface Props extends BaseModalProps {
2624
onContinue?: () => void
2725
goBack: () => void
2826
connector?: AbstractConnector
29-
walletType: WalletType
3027
/**
3128
* This is required for some of the providers (for example WalletConnect v2),
3229
* because they have their own modal that is being opened. In that case we
@@ -47,25 +44,16 @@ const WalletConnectionModalBase: FC<Props> = ({
4744
tryAgain,
4845
onContinue,
4946
connector,
50-
walletType,
5147
shouldForceCloseModal,
5248
}) => {
5349
const { activate, active, account } = useWeb3React()
54-
const captureWalletConnected = useCapture(PosthogEvent.WalletConnected)
5550

5651
useEffect(() => {
5752
if (!connector) return
5853

59-
captureWalletConnected({ walletType })
6054
activate(connector)
6155
if (shouldForceCloseModal) closeModal()
62-
}, [
63-
activate,
64-
connector,
65-
captureWalletConnected,
66-
walletType,
67-
shouldForceCloseModal,
68-
])
56+
}, [activate, connector, shouldForceCloseModal])
6957

7058
return (
7159
<>

src/components/Modal/tBTC/InitiateUnminting.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
} from "../../TransactionDetails"
3232
import ModalCloseButton from "../ModalCloseButton"
3333
import withBaseModal from "../withBaseModal"
34+
import { PosthogButtonId } from "../../../types/posthog"
3435

3536
type InitiateUnmintingProps = {
3637
unmintAmount: string
@@ -126,7 +127,17 @@ const InitiateUnmintingBase: FC<InitiateUnmintingProps> = ({
126127
<Button onClick={closeModal} variant="outline" mr={2}>
127128
Cancel
128129
</Button>
129-
<Button onClick={initiateUnminting}>Unmint</Button>
130+
<Button
131+
onClick={initiateUnminting}
132+
data-ph-capture-attribute-button-name={"Unmint (Modal)"}
133+
data-ph-capture-attribute-button-id={
134+
PosthogButtonId.InitiateUnminting
135+
}
136+
data-ph-capture-attribute-button-text={"Unmint"}
137+
data-ph-capture-attribute-unminted-tbtc-amount={unmintAmount}
138+
>
139+
Unmint
140+
</Button>
130141
</ModalFooter>
131142
</>
132143
)

src/components/Navbar/AccountButton.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { Button, Menu, MenuButton, MenuItem, MenuList } from "@chakra-ui/react"
22
import { FC } from "react"
3+
import { useCapture } from "../../hooks/posthog"
34
import { useAppDispatch } from "../../hooks/store"
45
import { resetStoreAction } from "../../store"
6+
import { PosthogEvent } from "../../types/posthog"
57
import shortenAddress from "../../utils/shortenAddress"
68
import Identicon from "../Identicon"
79

@@ -11,8 +13,12 @@ const AccountButton: FC<{
1113
deactivate: () => void
1214
}> = ({ openWalletModal, account, deactivate }) => {
1315
const dispatch = useAppDispatch()
16+
const captureWalletDisconnectedEvent = useCapture(
17+
PosthogEvent.WalletDisconnected
18+
)
1419

1520
const onDisconnectClick = () => {
21+
captureWalletDisconnectedEvent()
1622
dispatch(resetStoreAction())
1723
deactivate()
1824
}

src/components/Navbar/NavbarComponent.tsx

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Stack,
88
useColorModeValue,
99
H5,
10-
HStack,
1110
} from "@threshold-network/components"
1211
import { Routes, Route, Link, useMatch } from "react-router-dom"
1312
import WalletConnectionAlert from "./WalletConnectionAlert"
@@ -20,7 +19,6 @@ import ThresholdWhite from "../../static/icons/ThresholdWhite"
2019
import useChakraBreakpoint from "../../hooks/useChakraBreakpoint"
2120
import { pages } from "../../pages"
2221
import { PageComponent } from "../../types"
23-
import { NoBridgeFeesPageTitleBadge } from "../tBTC"
2422

2523
interface NavbarComponentProps {
2624
account?: string | null
@@ -81,15 +79,7 @@ const renderPageTitle = (PageComponent: PageComponent) => {
8179
path={`${PageComponent.route.path}/*`}
8280
element={
8381
PageComponent.route.title ? (
84-
<HStack display={{ base: "none", md: "flex" }}>
85-
<PageTitle title={PageComponent.route.title} />
86-
{PageComponent.route.title === "tBTC" && (
87-
<NoBridgeFeesPageTitleBadge
88-
display={"flex"}
89-
alignItems={"center"}
90-
/>
91-
)}
92-
</HStack>
82+
<PageTitle title={PageComponent.route.title} />
9383
) : (
9484
<></>
9585
)
@@ -99,7 +89,11 @@ const renderPageTitle = (PageComponent: PageComponent) => {
9989
}
10090

10191
const PageTitle: FC<{ title: string }> = ({ title }) => {
102-
return <H5 ml={12}>{title}</H5>
92+
return (
93+
<H5 ml={12} display={{ base: "none", md: "block" }}>
94+
{title}
95+
</H5>
96+
)
10397
}
10498

10599
const renderMobileHeader = (PageComponent: PageComponent) => {
@@ -109,15 +103,7 @@ const renderMobileHeader = (PageComponent: PageComponent) => {
109103
path={`${PageComponent.route.path}/*`}
110104
element={
111105
PageComponent.route.title ? (
112-
<HStack display={{ base: "flex", md: "none" }}>
113-
<MobileHeader title={PageComponent.route.title} />
114-
{PageComponent.route.title === "tBTC" && (
115-
<NoBridgeFeesPageTitleBadge
116-
display={"flex"}
117-
alignItems={"center"}
118-
/>
119-
)}
120-
</HStack>
106+
<MobileHeader title={PageComponent.route.title} />
121107
) : (
122108
<></>
123109
)
@@ -128,7 +114,14 @@ const renderMobileHeader = (PageComponent: PageComponent) => {
128114

129115
const MobileHeader: FC<{ title: string }> = ({ title }) => {
130116
return (
131-
<Box as="header" pl={10} py={6} borderBottom="1px" borderColor="gray.100">
117+
<Box
118+
display={{ base: "flex", md: "none" }}
119+
as="header"
120+
pl={10}
121+
py={6}
122+
borderBottom="1px"
123+
borderColor="gray.100"
124+
>
132125
<H5>{title}</H5>
133126
</Box>
134127
)

0 commit comments

Comments
 (0)