Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WALL] Fix button not disabled upload and added error screen for duplicate upload #14703

Merged
merged 10 commits into from
May 23, 2024
4 changes: 3 additions & 1 deletion packages/wallets/src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import FlowTextField, { TFlowFieldProps } from '../FlowField/FlowTextField';
import customFormatShortWeekday from './utils';
import 'react-calendar/dist/Calendar.css';
import './DatePicker.scss';
import { useFlow } from '../FlowProvider';

interface TDatePickerProps extends TFlowFieldProps {
maxDate?: Date;
Expand All @@ -30,6 +31,7 @@ const DatePicker = ({
const [selectedDate, setSelectedDate] = useState<Date | null>(defaultValue ? new Date(defaultValue) : null);
const [isCalendarOpen, setIsCalendarOpen] = useState<boolean>(false);
const datePickerRef = useRef<HTMLDivElement>(null);
const { formValues } = useFlow();

const toggleCalendar = () => {
setIsCalendarOpen(prevState => !prevState);
Expand Down Expand Up @@ -73,7 +75,7 @@ const DatePicker = ({
showMessage
type='date'
validationSchema={validationSchema}
value={selectedDate !== null ? unixToDateString(selectedDate) : ''}
value={selectedDate !== null ? unixToDateString(selectedDate) : formValues[name]}
nijil-deriv marked this conversation as resolved.
Show resolved Hide resolved
/>
{isCalendarOpen && (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,22 @@ const Verification: FC<TVerificationProps> = ({ selectedJurisdiction }) => {
return (
!formValues.drivingLicenceNumber ||
!formValues.drivingLicenseExpiryDate ||
!!errors.drivingLicenseExpiryDate ||
!formValues.drivingLicenseCardFront ||
!formValues.drivingLicenseCardBack
);
} else if (formValues.selectedManualDocument === 'passport') {
return !formValues.passportNumber || !formValues.passportExpiryDate || !formValues.passportCard;
return (
!formValues.passportNumber ||
!formValues.passportExpiryDate ||
nijil-deriv marked this conversation as resolved.
Show resolved Hide resolved
!!errors.passportExpiryDate ||
!formValues.passportCard
);
} else if (formValues.selectedManualDocument === 'identity-card') {
return (
!formValues.identityCardNumber ||
!formValues.identityCardExpiryDate ||
!!errors.identityCardExpiryDate ||
!formValues.identityCardFront ||
!formValues.identityCardBack
);
Expand Down
Loading