-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from avored/211-improvement-with-asset-manager
211 improvement with asset manager
- Loading branch information
Showing
39 changed files
with
1,214 additions
and
283 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import InputField from "../../components/InputField"; | ||
import AvoredModal from "../../components/AvoredModal"; | ||
import React from "react"; | ||
import {useTranslation} from "react-i18next"; | ||
|
||
type AssetUploadModalProps = { | ||
isOpen: any, | ||
onCloseModal: any, | ||
handleSubmit: any, | ||
submitHandler: any, | ||
register: any | ||
} | ||
|
||
export const AssetUploadModal = (({ | ||
isOpen, | ||
onCloseModal, | ||
handleSubmit, | ||
submitHandler, | ||
register | ||
}: AssetUploadModalProps) => { | ||
const [t] = useTranslation("global"); | ||
return ( | ||
<> | ||
<div className="max-w-7xl"> | ||
<AvoredModal | ||
isOpen={isOpen} | ||
closeModal={onCloseModal} | ||
modal_header={t("upload_asset")} | ||
modal_body={ | ||
<div className="text-sm text-gray-500"> | ||
<div className="text-sm text-gray-500 rounded"> | ||
<form onSubmit={handleSubmit(submitHandler)}> | ||
<div className=""> | ||
<div className="flex"> | ||
<div className="mt-3"> | ||
<div className="mt-1"> | ||
<InputField | ||
label={t("asset.asset_file")} | ||
type="file" | ||
name="file_list" | ||
register={register('file_list')} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div className="flex pt-5 mt-6 space-x-2"> | ||
<button | ||
type="submit" | ||
className="px-4 py-2 text-sm font-medium text-center text-white transition | ||
duration-150 ease-linear bg-primary-600 border border-primary-600 rounded-lg | ||
hover:bg-red-500" | ||
> | ||
{t("upload")} | ||
</button> | ||
<button | ||
type="button" | ||
onClick={onCloseModal} | ||
className="py-2 px-4 text-sm text-center text-gray-600 transition duration-150 | ||
ease-linear bg-white border border-gray-400 rounded-lg hover:bg-gray-200" | ||
> | ||
{t("cancel")} | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
} | ||
/> | ||
</div> | ||
|
||
</> | ||
) | ||
}) |
Oops, something went wrong.