Skip to content

Commit

Permalink
fix: update name page when search changed
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Sep 6, 2023
1 parent a670845 commit bbc3540
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"repository": "https://github.com/mechanismHQ/bns-x/tree/main/packages/png-ztxt",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"import": "./dist/index.mjs",
"sideEffects": false,
Expand Down
20 changes: 1 addition & 19 deletions web/components/p/bridge/unwrap.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
import React, { useMemo } from 'react';
import { useRouter } from 'next/router';
import { Text } from '@components/ui/text';
import {
bridgeBurnScriptState,
bridgeInscriptionIdAtom,
bridgeUnwrapTxidAtom,
bridgeWrapTxidAtom,
fetchSignatureForInscriptionId,
inscribedNamesAtom,
inscriptionForNameAtom,
inscriptionIdForNameAtom,
verifiedBurnAddressState,
} from '@store/bridge';
import { bridgeBurnScriptState, bridgeUnwrapTxidAtom, inscriptionForNameAtom } from '@store/bridge';
import { useAtom, useAtomValue } from 'jotai';
import { loadable } from 'jotai/utils';
import { useInput } from '@common/hooks/use-input';
import { CodeBlock } from '@components/code';
import { Button } from '@components/ui/button';
import { useCopyToClipboard } from 'usehooks-ts';
import { Input } from '@components/form';
import { nameDetailsAtom } from '@store/names';
import useDeepCompareEffect from 'use-deep-compare-effect';
import { WrapTx } from '@components/p/bridge/wrap-tx';
import { useBridgeWrap } from '@common/hooks/use-bridge-wrap';
import { Link } from '@components/link';
import { getInscriptionUrl, truncateMiddle } from '@common/utils';
import { DuplicateIcon } from '@components/icons/duplicate';
Expand Down
2 changes: 1 addition & 1 deletion web/components/p/name/name-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const NamePage: React.FC<{ children?: React.ReactNode; name?: string }> =
<FieldHeader>Zonefile</FieldHeader>
{nameDetails.zonefile && <DuplicateIcon clipboardText={nameDetails.zonefile} />}
</div>
<div>
<div className="mb-4">
<a
href="https://docs.bns.xyz/docs/zonefiles/"
target="_blank"
Expand Down
2 changes: 1 addition & 1 deletion web/components/p/name/name-zonefile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ZonefileTable: React.FC<{ children?: React.ReactNode; zonefile?: st
}) => {
const zonefile = new ZoneFile(_zf).zoneFile;
return (
<Table>
<Table className="w-full">
<TableHeader>
<TableRow>
<TableHead>Type</TableHead>
Expand Down
6 changes: 6 additions & 0 deletions web/pages/names/[name].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { NamePage } from '@components/p/name/name-page';
import { withSSRProps } from '@common/page-utils';
import { useHydrateAtoms } from 'jotai/utils';
import { currentNameAtom } from '@store/names';
import { useEffect } from 'react';
import { useSetAtom } from 'jotai';

export const getServerSideProps = withSSRProps(ctx => {
return {
Expand All @@ -13,6 +15,10 @@ export const getServerSideProps = withSSRProps(ctx => {

const Name: NextPage<{ name: string }> = ({ name }) => {
useHydrateAtoms([[currentNameAtom, name]]);
const setName = useSetAtom(currentNameAtom);
useEffect(() => {
setName(name);
}, [name, setName]);
return (
<Layout centerBox={false}>
<NamePage />
Expand Down

0 comments on commit bbc3540

Please sign in to comment.