From 42eae6cba23e289d86b465fc896d3cbf3c430952 Mon Sep 17 00:00:00 2001 From: SD Date: Wed, 27 Mar 2024 18:23:36 +0400 Subject: [PATCH] fix: fix profile type --- src/components/Account/ProfileSettings.tsx | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/Account/ProfileSettings.tsx b/src/components/Account/ProfileSettings.tsx index 133f179..fb5acb1 100644 --- a/src/components/Account/ProfileSettings.tsx +++ b/src/components/Account/ProfileSettings.tsx @@ -2,7 +2,7 @@ import React, { FC, useEffect, useState } from 'react'; import { Form, Upload, Button } from 'antd'; -import type { UploadFile, UploadProps, GetProp } from 'antd'; +import type { UploadFile, UploadProps } from 'antd'; import ImgCrop from 'antd-img-crop'; import { CameraOutlined } from '@ant-design/icons'; import { Link } from '../../navigation'; @@ -21,7 +21,7 @@ type ProfileSettingsProps = { saveButton?: string; }; -type FileType = Parameters>[0]; +// type FileType = Parameters>[0]; export const ProfileSettings: FC = ({ locale, @@ -49,18 +49,18 @@ export const ProfileSettings: FC = ({ }; const onPreview = async (file: UploadFile) => { - let src = file.url as string; - if (!src) { - src = await new Promise((resolve) => { - const reader = new FileReader(); - reader.readAsDataURL(file.originFileObj as FileType); - reader.onload = () => resolve(reader.result as string); - }); - } - const image = new Image(); - image.src = src; - const imgWindow = window.open(src); - imgWindow?.document.write(image.outerHTML); + // let src = file.url as string; + // if (!src) { + // src = await new Promise((resolve) => { + // const reader = new FileReader(); + // reader.readAsDataURL(file.originFileObj as FileType); + // reader.onload = () => resolve(reader.result as string); + // }); + // } + // const image = new Image(); + // image.src = src; + // const imgWindow = window.open(src); + // imgWindow?.document.write(image.outerHTML); }; return (