Skip to content

Commit

Permalink
chore: move the settings component to be exported directly in the ind…
Browse files Browse the repository at this point in the history
…ex file
  • Loading branch information
clovisdasilvaneto committed Sep 16, 2024
1 parent 03c3ee2 commit 1615043
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/components/tx/confirmation-views/SettingsChange/index.ts

This file was deleted.

12 changes: 10 additions & 2 deletions src/components/tx/confirmation-views/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { type TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk'
import { TransactionInfoType, type TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk'
import DecodedTx from '../DecodedTx'
import ConfirmationOrder from '../ConfirmationOrder'
import useDecodeTx from '@/hooks/useDecodeTx'
import type { SafeTransaction } from '@safe-global/safe-core-sdk-types'
import { isCustomTxInfo, isGenericConfirmation } from '@/utils/transaction-guards'
import { getConfirmationViewComponent } from './utils'
import { useMemo } from 'react'
import TxData from '@/components/transactions/TxDetails/TxData'
import { NarrowConfirmationViewProps } from './types'

Check failure on line 9 in src/components/tx/confirmation-views/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Results

@typescript-eslint/consistent-type-imports

All imports in the declaration are only used as types. Use `import type`.
import SettingsChange from './SettingsChange'

type ConfirmationViewProps = {
txDetails: TransactionDetails
Expand All @@ -16,6 +17,13 @@ type ConfirmationViewProps = {
isApproval?: boolean
}

const getConfirmationViewComponent = (txType: TransactionInfoType, props: NarrowConfirmationViewProps) => {
if (txType === TransactionInfoType.SETTINGS_CHANGE)
return <SettingsChange txDetails={props.txDetails} txInfo={props.txInfo as SettingsChange} />

return null
}

const ConfirmationView = (props: ConfirmationViewProps) => {
const { txInfo, txId } = props.txDetails
const [decodedData] = useDecodeTx(props.safeTx)
Expand Down
11 changes: 0 additions & 11 deletions src/components/tx/confirmation-views/utils.tsx

This file was deleted.

0 comments on commit 1615043

Please sign in to comment.