Skip to content

Commit 266e9da

Browse files
committed
feat: fix input file accept
1 parent b7f5f09 commit 266e9da

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/core/components/pages/AccountPages/AccountPageUI/OtherEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ export default function OtherAccountEdit({ registrationInfo, isRegister }: Regis
434434
className="form-file-input form-control"
435435
id="user_photo"
436436
required
437-
accept="application/pdf,image/*"
437+
accept="image/*"
438438
readOnly={user?.verification_status === "Rejected" && !user?.rejected_info?.includes("user_photo")}
439439
onChange={(e) => {
440440
if (e.target.files && e.target.files[0]?.size > 2097152) {

src/core/components/pages/AccountPages/Payment/Payment.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function Payment() {
9292
type="file"
9393
className="form-control"
9494
id="paymentEvidence"
95-
accept="application/pdf, image/png, image/jpeg"
95+
accept="application/pdf,image/*"
9696
onChange={(e) => {
9797
if (e.target.files && e.target.files[0]?.size > 2097152) {
9898
e.target.value = ""
@@ -114,7 +114,7 @@ function Payment() {
114114
type="file"
115115
className="form-control"
116116
id="paymentEvidence"
117-
accept="application/pdf, image/png, image/jpeg"
117+
accept="application/pdf,image/*"
118118
onChange={(e) => {
119119
if (e.target.files && e.target.files[0]?.size > 2097152) {
120120
e.target.value = ""

src/core/components/pages/staff-pages/list-of-all-users-pages/CuSatitInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ const UserInfo: FunctionComponent = () => {
504504
<p>รูปภาพบัตรนักเรียน</p>
505505
<Form.File
506506
label={studentCardPhotoFile ? (studentCardPhotoFile as File).name : "Choose File"}
507-
accept="application/pdf, image/jpeg, image/png"
507+
accept="application/pdf,image/*"
508508
custom
509509
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
510510
if (e.target.files && e.target.files[0]?.size <= 2097152) {

src/core/components/pages/staff-pages/list-of-all-users-pages/OtherEditInfoComponent.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export default function OtherEditInfoComponent({
408408
<Form.File
409409
label={userPhotoFile ? (userPhotoFile as File).name : "Choose File"}
410410
id="user_photo"
411-
accept="image/png, image/jpeg"
411+
accept="image/*"
412412
custom
413413
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
414414
if (e.target.files && e.target.files[0]?.size <= 2097152) {
@@ -418,12 +418,12 @@ export default function OtherEditInfoComponent({
418418
/>
419419
</div>
420420
<hr />
421-
<label className="form-label my-2">เลขประจำตัวประชาชน / ทะเบียนบ้านที่มีหน้าของคุณ (.pdf เท่านั้น)</label>
421+
<label className="form-label my-2">เลขประจำตัวประชาชน / ทะเบียนบ้านที่มีหน้าของคุณ</label>
422422
<div className="form-file">
423423
<Form.File
424424
label={nationalIdPhotoFile ? (nationalIdPhotoFile as File).name : "Choose File"}
425425
id="national_id_house_registration"
426-
accept="application/pdf"
426+
accept="application/pdf,image/*"
427427
custom
428428
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
429429
if (e.target.files && e.target.files[0]?.size <= 2097152) {
@@ -438,7 +438,7 @@ export default function OtherEditInfoComponent({
438438
<Form.File
439439
label={medicalCertificateFile ? (medicalCertificateFile as File).name : "Choose File"}
440440
id="medical_certificate"
441-
accept="application/pdf"
441+
accept="application/pdf,image/*"
442442
custom
443443
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
444444
if (e.target.files && e.target.files[0]?.size <= 2097152) {
@@ -455,7 +455,7 @@ export default function OtherEditInfoComponent({
455455
<Form.File
456456
label={relationshipVerificationDocumentFile ? (relationshipVerificationDocumentFile as File).name : "Choose File"}
457457
id="relationship_verification_document"
458-
accept="application/pdf"
458+
accept="application/pdf,image/*"
459459
custom
460460
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
461461
if (e.target.files && e.target.files[0]?.size <= 2097152) {
@@ -472,7 +472,7 @@ export default function OtherEditInfoComponent({
472472
<Form.File
473473
label={paymentSlip ? (paymentSlip as File).name : "Choose File"}
474474
id="payment_slip"
475-
accept="application/pdf, image/png, image/jpeg"
475+
accept="application/pdf,image/*"
476476
custom
477477
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
478478
if (e.target.files && e.target.files[0]?.size <= 2097152) {

src/core/components/ui/login/registerSatit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const RegisterSatit = ({ user }: satitRejectedProps) => {
229229
className="form-file-input form-control"
230230
id="student_card_photo"
231231
required
232-
accept="application/pdf, image/png, image/jpeg"
232+
accept="application/pdf,image/*"
233233
onChange={(e) => {
234234
if (e.target.files && e.target.files[0]?.size > 2097152) {
235235
alert(t("fileTooBig"))

0 commit comments

Comments
 (0)