add reset attachment
This commit is contained in:
parent
372f84d1b1
commit
1d22ac2173
|
|
@ -14,6 +14,7 @@ import { useRootStore } from "~/shared/stores/root";
|
|||
import { Checkbox } from "~/shared/ui/checkbox";
|
||||
import { AudioPlayer } from "~/shared/ui/audio-player";
|
||||
import { HashtagInput } from "~/shared/ui/hashtag-input";
|
||||
import { XMark } from "~/shared/ui/icons/x-mark";
|
||||
|
||||
type DataStepProps = {
|
||||
nextStep(): void;
|
||||
|
|
@ -57,6 +58,12 @@ export const DataStep = ({ nextStep }: DataStepProps) => {
|
|||
})();
|
||||
};
|
||||
|
||||
const handleFileReset = () => {
|
||||
rootStore.setFile(null);
|
||||
rootStore.setFileSrc('');
|
||||
rootStore.setFileType('');
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={"mt-4 px-4 pb-8"}>
|
||||
<div className={"mb-[30px] flex flex-col text-sm"}>
|
||||
|
|
@ -118,6 +125,14 @@ export const DataStep = ({ nextStep }: DataStepProps) => {
|
|||
url={rootStore.fileSrc}
|
||||
/>
|
||||
)}
|
||||
<button
|
||||
onClick={handleFileReset}
|
||||
className={
|
||||
"text-center w-full gap-1 border border-white px-[10px] py-[8px] mt-2 text-sm"
|
||||
}
|
||||
>
|
||||
Изменить выбор
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</FormLabel>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ type RootStore = {
|
|||
setAuthor: (author: string) => void;
|
||||
|
||||
file: File | null;
|
||||
setFile: (file: File) => void;
|
||||
setFile: (file: File | null) => void;
|
||||
|
||||
fileType: string;
|
||||
setFileType: (type: string) => void;
|
||||
|
|
|
|||
Loading…
Reference in New Issue