Skip to content

Commit

Permalink
chore: run prettier on changed files
Browse files Browse the repository at this point in the history
Co-Authored-By: Leon Talbert <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and LeonmanRolls committed Feb 3, 2025
1 parent 1bd4b41 commit d06035b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
23 changes: 11 additions & 12 deletions src/components/pages/import/[name]/steps/SelectImportType.test.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import { describe, expect, it, beforeEach } from 'vitest'
import { mockFunction } from '@app/test-utils'

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { render, screen } from '@testing-library/react'
import { I18nextProvider } from 'react-i18next'
import { ThemeProvider } from 'styled-components'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { useAccount } from 'wagmi'

import { lightTheme } from '@ensdomains/thorin'

import { useDnsOffchainStatus } from '@app/hooks/dns/useDnsOffchainStatus'
import { useCustomizedTLD } from '@app/hooks/useCustomizedTLD'
import { mockFunction } from '@app/test-utils'
import i18n from '@app/i18n'

import { calculateDnsSteps, SelectImportType } from './SelectImportType'

import { vi } from 'vitest'

import { I18nextProvider } from 'react-i18next'
import i18n from '@app/i18n'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ThemeProvider } from 'styled-components'
import { lightTheme } from '@ensdomains/thorin'

const queryClient = new QueryClient({
defaultOptions: {
queries: {
Expand Down Expand Up @@ -199,7 +198,7 @@ describe('SelectImportType component', () => {
/>
</I18nextProvider>
</ThemeProvider>
</QueryClientProvider>
</QueryClientProvider>,
)
expect(screen.getByText(/The team behind club/)).toBeInTheDocument()
})
Expand All @@ -217,7 +216,7 @@ describe('SelectImportType component', () => {
/>
</I18nextProvider>
</ThemeProvider>
</QueryClientProvider>
</QueryClientProvider>,
)
expect(screen.getByText(/How would you like to import your domain/)).toBeInTheDocument()
})
Expand Down
7 changes: 2 additions & 5 deletions src/components/pages/import/[name]/steps/SelectImportType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import { useAccount, useChainId } from 'wagmi'
import { GetDnsOwnerReturnType } from '@ensdomains/ensjs/dns'
import { RadioButton, RadioButtonGroup, Tag, Typography } from '@ensdomains/thorin'

import { useCustomizedTLD } from '@app/hooks/useCustomizedTLD'

import { SupportOutlink } from '@app/components/@atoms/SupportOutlink'
import { OFFCHAIN_DNS_RESOLVER_MAP } from '@app/constants/resolverAddressData'
import { useDnsOffchainStatus } from '@app/hooks/dns/useDnsOffchainStatus'
import { useDnsSecEnabled } from '@app/hooks/dns/useDnsSecEnabled'
import { useDnsOwner } from '@app/hooks/ensjs/dns/useDnsOwner'
import { useResolver } from '@app/hooks/ensjs/public/useResolver'
import { useCustomizedTLD } from '@app/hooks/useCustomizedTLD'
import { CenteredTypography } from '@app/transaction-flow/input/ProfileEditor/components/CenteredTypography'
import { getSupportLink } from '@app/utils/supportLinks'

Expand Down Expand Up @@ -201,9 +200,7 @@ export const SelectImportType = ({
return (
<DnsImportCard>
<DnsImportHeading>{t('title', { name: selected.name })}</DnsImportHeading>
<CenteredTypography>
{t('customizedTld', { tld })}
</CenteredTypography>
<CenteredTypography>{t('customizedTld', { tld })}</CenteredTypography>
</DnsImportCard>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/constants/tldData.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const CUSTOMIZED_TLDS = ['club'] as const
export type CustomizedTLD = typeof CUSTOMIZED_TLDS[number]
export type CustomizedTLD = (typeof CUSTOMIZED_TLDS)[number]
2 changes: 1 addition & 1 deletion src/hooks/useCustomizedTLD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { CUSTOMIZED_TLDS } from '@app/constants/tldData'
export const useCustomizedTLD = (name = '') => {
const labels = name?.split('.') || []
const tld = labels[labels.length - 1]
return tld ? CUSTOMIZED_TLDS.includes(tld as typeof CUSTOMIZED_TLDS[number]) : false
return tld ? CUSTOMIZED_TLDS.includes(tld as (typeof CUSTOMIZED_TLDS)[number]) : false
}

0 comments on commit d06035b

Please sign in to comment.