Skip to content

Commit 08a84ba

Browse files
authored
Merge branch 'main' into feature/fet-1761-temporary-premium-graph-has-an-empty-box-which-appears-when
2 parents c5203ee + a9e3a8e commit 08a84ba

4 files changed

Lines changed: 52 additions & 0 deletions

File tree

e2e/specs/stateless/settings.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ test.describe('Select Primary Name', () => {
125125
login,
126126
makeName,
127127
makePageObject,
128+
accounts,
128129
}) => {
129130
test.slow()
130131

@@ -141,6 +142,7 @@ test.describe('Select Primary Name', () => {
141142
const settingsPage = makePageObject('SettingsPage')
142143
const selectPrimaryNameModal = makePageObject('SelectPrimaryNameModal')
143144
await settingsPage.goto()
145+
await expect(settingsPage.walletAddress).toHaveText(new RegExp(accounts.getAddress('user')))
144146
await settingsPage.choosePrimaryNameButton.click()
145147
await selectPrimaryNameModal.waitForPageLoad()
146148
const nameWithoutSuffix = name.slice(0, -4)

playwright/pageObjects/settingsPage.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ export class SettingsPage {
1010

1111
readonly choosePrimaryNameButton: Locator
1212

13+
readonly walletAddress: Locator
14+
1315
constructor(page: Page) {
1416
this.page = page
1517
this.changePrimaryNameButton = this.page.getByTestId('change-primary-name-button')
1618
this.removePrimaryNameButton = this.page.getByTestId('remove-primary-name-button')
1719
this.choosePrimaryNameButton = this.page.getByTestId('set-primary-name-button')
20+
this.walletAddress = this.page.getByTestId('name-details-address-address')
1821
}
1922

2023
async goto() {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { useAccount, useConnections } from 'wagmi'
2+
3+
import { Box, Button, Card, Typography, WalletSVG } from '@ensdomains/thorin'
4+
5+
import RecordItem from '@app/components/RecordItem'
6+
import { hasParaConnection } from '@app/utils/utils'
7+
8+
export const WalletSection = () => {
9+
const { address, connector } = useAccount()
10+
11+
const connections = useConnections()
12+
const isParaConnected = hasParaConnection(connections)
13+
14+
return (
15+
<Card>
16+
<Typography
17+
display="flex"
18+
fontVariant="headingFour"
19+
justifyContent="space-between"
20+
alignItems="center"
21+
>
22+
Wallet{' '}
23+
</Typography>
24+
<RecordItem type="address" itemKey="Address" value={address as string} />
25+
<Box
26+
display="flex"
27+
flexDirection={{ base: 'column', sm: 'row' }}
28+
justifyContent="space-between"
29+
gap="2"
30+
>
31+
<RecordItem type="text" itemKey="Connector" value={connector?.name as string} />
32+
{isParaConnected && (
33+
<Button
34+
width={{ base: 'full', sm: 'max' }}
35+
size="small"
36+
colorStyle="accentSecondary"
37+
prefix={() => <WalletSVG height={12} width={12} />}
38+
>
39+
Go to wallet
40+
</Button>
41+
)}
42+
</Box>
43+
</Card>
44+
)
45+
}

src/pages/my/settings.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { DevSection } from '@app/components/pages/profile/settings/DevSection'
77
import { PrimarySection } from '@app/components/pages/profile/settings/PrimarySection'
88
import { PrivacySection } from '@app/components/pages/profile/settings/PrivacySection'
99
import { TransactionSection } from '@app/components/pages/profile/settings/TransactionSection/TransactionSection'
10+
import { WalletSection } from '@app/components/pages/profile/settings/WalletSection'
1011
import { useSubgraphMeta } from '@app/hooks/ensjs/subgraph/useSubgraphMeta'
1112
import { useProtectedRoute } from '@app/hooks/useProtectedRoute'
1213
import { Content } from '@app/layouts/Content'
@@ -43,6 +44,7 @@ export default function Page() {
4344
trailing: (
4445
<OtherWrapper>
4546
<PrimarySection />
47+
<WalletSection />
4648
<TransactionSection />
4749
<PrivacySection />
4850
{IS_DEV_ENVIRONMENT && <DevSection />}

0 commit comments

Comments
 (0)