Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(btc-link): link to the different btc env #412

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style(btc-link): change the code style
  • Loading branch information
Daryl-L committed Aug 8, 2024
commit 69b787667cfda1f1662f63e9d00a5c8a66650bc9
5 changes: 3 additions & 2 deletions src/components/Link/index.tsx
Original file line number Diff line number Diff line change
@@ -57,18 +57,19 @@ export const BTCExplorerLink = forwardRef<HTMLAnchorElement, BTCExplorerLinkProp
ref,
) => {
const { locale } = useParams<{ locale?: string }>()
const { data: identity } = useQuery({
let { data: identity } = useQuery({
queryKey: ['btc-testnet-identity', id, address],
queryFn: () => getBtcChainIdentify(id!),
enabled: !IS_MAINNET && !!id,
})
identity = identity ?? 'testnet'

return (
<Link
lng={lng ?? (locale as 'en' | 'zh')}
ref={ref}
{...props}
to={`${config.BITCOIN_EXPLORER}${IS_MAINNET ? '' : `/${identity ?? 'testnet'}`}${path}/${address ?? id}${
to={`${config.BITCOIN_EXPLORER}${IS_MAINNET ? '' : `/${identity}`}${path}/${address ?? id}${
anchor ? `#${anchor}` : ''
}`}
/>