Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit 5d61ca1

Browse files
committed
refactor: reuse isTextField typeguard function
1 parent 3c766d0 commit 5d61ca1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/ui/page/share/dataset/steps/completeTransaction/completeTransaction.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { FC } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import * as O from 'fp-ts/Option'
44
import { flow, pipe } from 'fp-ts/lib/function'
5-
import type { FormItem, TextField } from '@/ui/store/slice/shareData/shareData.slice'
5+
import { isTextField, type TextField } from '@/ui/store/slice/shareData/shareData.slice'
66
import { Button } from '@/ui/component/button/button'
77
import { Icon } from '@/ui/component/icon/icon'
88
import { useAppStore } from '@/ui/store'
@@ -25,8 +25,6 @@ export const CompleteTransaction: FC = () => {
2525
const getFieldValueForText = (item: TextField): string | undefined =>
2626
pipe(item.value, O.toUndefined)
2727

28-
const isTextField = (item: FormItem): item is TextField => item.type === 'text'
29-
3028
const dataSetTitle = pipe(
3129
dataSetTitleField,
3230
O.map(flow(O.fromPredicate(isTextField), O.map(getFieldValueForText), O.toUndefined)),

0 commit comments

Comments
 (0)