-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the Import & information modal/changed the action buttons to icons
Added the Import & information modal/changed the action buttons to icons
- Loading branch information
Showing
7 changed files
with
271 additions
and
45 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/esm-import-export-app/src/components/modals/import-modal.component.tsx
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,42 @@ | ||
import React, { Dispatch, SetStateAction } from "react"; | ||
import { Form, FormGroup, Modal, FileUploader } from "@carbon/react"; | ||
import styles from "../styles/modals.scss"; | ||
|
||
const ImportModalComponent: React.FC<{ | ||
isOpen: boolean; | ||
setOpen: Dispatch<SetStateAction<boolean>>; | ||
}> = ({ isOpen, setOpen }) => { | ||
const handleSubmit = () => { | ||
setOpen(false); | ||
}; | ||
return ( | ||
<Modal | ||
open={isOpen} | ||
onRequestSubmit={handleSubmit} | ||
onRequestClose={() => setOpen(false)} | ||
modalHeading="Import" | ||
modalLabel="Import" | ||
primaryButtonText="Import" | ||
secondaryButtonText="Cancel" | ||
> | ||
<div className={styles.importBody}> | ||
<Form> | ||
<FormGroup controlId="form"> | ||
<FileUploader | ||
buttonLabel="Choose the file" | ||
labelTitle="Choose Import File" | ||
buttonKind="primary" | ||
filenameStatus="edit" | ||
accept={[".jpg", ".png"]} | ||
multiple={true} | ||
disabled={false} | ||
name="" | ||
/> | ||
</FormGroup> | ||
</Form> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default ImportModalComponent; |
50 changes: 50 additions & 0 deletions
50
packages/esm-import-export-app/src/components/modals/info-modal.component.tsx
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,50 @@ | ||
import React, { Dispatch, SetStateAction } from "react"; | ||
import { Modal } from "@carbon/react"; | ||
import styles from "../styles/modals.scss"; | ||
import { dummyBackupTableData } from "../../data/dummy"; | ||
import { CheckmarkFilled, Misuse } from "@carbon/react/icons"; | ||
|
||
const InfoModalComponent: React.FC<{ | ||
isOpen: boolean; | ||
setOpen: Dispatch<SetStateAction<boolean>>; | ||
rowId: string; | ||
}> = ({ isOpen, setOpen, rowId }) => { | ||
const row = dummyBackupTableData.find((row) => row.id === rowId); | ||
|
||
if (!row) return null; | ||
return ( | ||
<Modal | ||
open={isOpen} | ||
onRequestClose={() => setOpen(false)} | ||
// modalHeading="Info Module" | ||
// modalLabel="Info" | ||
passiveModal={true} | ||
> | ||
<div key={row.id}> | ||
{row.status === "completed" ? ( | ||
<div className={styles.infoBody}> | ||
<CheckmarkFilled size={80} /> | ||
<h3>Success</h3> | ||
<p> | ||
The file can be found on <strong>{row.downloadPath} </strong> | ||
</p> | ||
</div> | ||
) : ( | ||
<div className={styles.infoBody}> | ||
<Misuse size={80} /> | ||
<h3 className={styles.infoBody}>Failed</h3> | ||
<p> | ||
Error: | ||
<p style={{ color: "red" }}> | ||
<strong>{row.errorMessage} </strong>{" "} | ||
</p> | ||
Try Again!!{" "} | ||
</p> | ||
</div> | ||
)} | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default InfoModalComponent; |
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
Oops, something went wrong.