diff --git a/apps/trading/components/vega-wallet-connect-button/PartyProfiles.graphql b/apps/trading/components/vega-wallet-connect-button/PartyProfiles.graphql new file mode 100644 index 000000000..6bfa72001 --- /dev/null +++ b/apps/trading/components/vega-wallet-connect-button/PartyProfiles.graphql @@ -0,0 +1,14 @@ +query PartyProfiles($partyIds: [ID!]) { + partiesProfilesConnection(ids: $partyIds) { + edges { + node { + partyId + alias + metadata { + key + value + } + } + } + } +} diff --git a/apps/trading/components/vega-wallet-connect-button/__generated__/PartyProfiles.ts b/apps/trading/components/vega-wallet-connect-button/__generated__/PartyProfiles.ts new file mode 100644 index 000000000..ef039cb93 --- /dev/null +++ b/apps/trading/components/vega-wallet-connect-button/__generated__/PartyProfiles.ts @@ -0,0 +1,57 @@ +import * as Types from '@vegaprotocol/types'; + +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; +const defaultOptions = {} as const; +export type PartyProfilesQueryVariables = Types.Exact<{ + partyIds?: Types.InputMaybe | Types.Scalars['ID']>; +}>; + + +export type PartyProfilesQuery = { __typename?: 'Query', partiesProfilesConnection?: { __typename?: 'PartiesProfilesConnection', edges: Array<{ __typename?: 'PartyProfileEdge', node: { __typename?: 'PartyProfile', partyId: string, alias: string, metadata: Array<{ __typename?: 'Metadata', key: string, value: string }> } }> } | null }; + + +export const PartyProfilesDocument = gql` + query PartyProfiles($partyIds: [ID!]) { + partiesProfilesConnection(ids: $partyIds) { + edges { + node { + partyId + alias + metadata { + key + value + } + } + } + } +} + `; + +/** + * __usePartyProfilesQuery__ + * + * To run a query within a React component, call `usePartyProfilesQuery` and pass it any options that fit your needs. + * When your component renders, `usePartyProfilesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = usePartyProfilesQuery({ + * variables: { + * partyIds: // value for 'partyIds' + * }, + * }); + */ +export function usePartyProfilesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(PartyProfilesDocument, options); + } +export function usePartyProfilesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(PartyProfilesDocument, options); + } +export type PartyProfilesQueryHookResult = ReturnType; +export type PartyProfilesLazyQueryHookResult = ReturnType; +export type PartyProfilesQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx index 05304a477..1f610a784 100644 --- a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx +++ b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx @@ -13,11 +13,12 @@ import { TradingDropdownSeparator, TradingDropdownItem, TradingDropdownRadioItem, - Tooltip, + TradingDropdownItemIndicator, } from '@vegaprotocol/ui-toolkit'; import { isBrowserWalletInstalled, type Key } from '@vegaprotocol/wallet'; import { useDialogStore, useVegaWallet } from '@vegaprotocol/wallet-react'; import { useCopyTimeout } from '@vegaprotocol/react-helpers'; +import classNames from 'classnames'; import { ViewType, useSidebar } from '../sidebar'; import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id'; import { useT } from '../../lib/use-t'; @@ -147,44 +148,31 @@ const KeypairItem = ({ pk, active }: { pk: Key; active: boolean }) => { return (
- - - {truncateByChars(pk.publicKey)} - setCopied(true)}> - - - - - - - - - On chain alias:{' '} - foobarsdfsldjf;laksdjf;alskdjfaksldjfsdfjadskfjdskjfksdjfksdjf - - - - - - Key alias: - {pk.name} - - + + {copied && {t('Copied')}}
- {/* */} +
); };