Create useFormState hook for modals
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by comparing the repeated form state logic in BuyInModal.tsx, WithdrawalModal.tsx, DepositCore.tsx, TopUpModal.tsx, and QRDeposit.tsx. Create hooks/useFormState.ts from the specified generic interface, then refactor those modals while checking that their existing behavior remains unchanged. Done means all listed acceptance criteria are met without regressions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Priority: MEDIUM
Problem
Multiple modal components repeat identical form state logic:
BuyInModal.tsxWithdrawalModal.tsxDepositCore.tsxTopUpModal.tsxQRDeposit.tsx
Pattern repeated:
const [amount, setAmount] = useState("");
const [isProcessing, setIsProcessing] = useState(false);
const [error, setError] = useState<string | null>(null);
const [success, setSuccess] = useState(false);
Solution
Create a reusable form state hook:
// hooks/useFormState.ts
interface FormState<T> {
values: T;
setValues: (values: T) => void;
isProcessing: boolean;
setIsProcessing: (v: boolean) => void;
error: string | null;
setError: (e: string | null) => void;
success: boolean;
setSuccess: (s: boolean) => void;
reset: () => void;
}
const useFormState = <T>(initialValues: T): FormState<T> => { ... }
Acceptance Criteria
- Create
useFormStatehook with generic typing - Include processing, error, and success states
- Add reset functionality
- Refactor modals to use the hook
- Maintain existing behavior
Related
Parent issue: block52/ui#45
- Ngôn ngữ chính
- TypeScript
- Star
- 2
- Fork
- 5
- Merge trung bình
- 22 giờ 3 phút
- Pull request đã merge (30 ngày)
- 103
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của block52/ui
-
guards: accept readonly arrays (and other array-likes) in isEmpty / hasElements / safeLengthĐang mởenhancement tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: next-to-act flash stuck on the last folder when their fold closes a called all-in (fold + runout + hand_ended in one snapshot)Có thể đã có người làm @bitcoinbrisbane đã nhận 1 ngày trước. Đang mởanimation bug game-flow sit-and-go UI Week 2
block52/ui#968 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(ui): player language setting and translated player screensCó thể đã có người làm @Dzeezbtc đã nhận 3 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(ui): player notes and tags — click a seat to note a player; tag icons (fish, shark, tight, loose…) show by their pillCó thể đã có người làm @Dzeezbtc đã nhận 5 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
architecture refactor tech debt
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
pending close triaging
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
anomalyco/opencode#62582 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
callstack/react-native-paper#5189 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
live-codes/livecodes#1079 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: ESP 2 ROĐang mởapproved check:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày