generated from allen-cell-animated/github-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create modal fior file size error * handle conversion errors with single typed piece of local state * rename state to conversionError * bump up comment on file size limit * use single component for all conversion error modals * DRY out code (#519) * use constant for max file size * default to no error on conversion form * restore server error text * use double quotes for error message --------- Co-authored-by: Megan Riel-Mehan <[email protected]>
- Loading branch information
Showing
8 changed files
with
100 additions
and
136 deletions.
There are no files selected for viewing
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,56 @@ | ||
import { Button } from "antd"; | ||
import React from "react"; | ||
import classNames from "classnames"; | ||
|
||
import CustomModal from "../CustomModal"; | ||
import { Exclamation } from "../Icons"; | ||
|
||
import styles from "./style.css"; | ||
|
||
interface ConversionErrorModalProps { | ||
closeModal: () => void; | ||
showForumMessage: boolean; | ||
errorMessage?: string; | ||
} | ||
|
||
const ConversionErrorModal: React.FC<ConversionErrorModalProps> = ({ | ||
closeModal, | ||
errorMessage, | ||
showForumMessage = true, | ||
}) => { | ||
const footerButton = ( | ||
<Button className="primary-button" onClick={closeModal}> | ||
OK | ||
</Button> | ||
); | ||
|
||
return ( | ||
<CustomModal | ||
titleText="File import cannot be completed" | ||
footerButtons={footerButton} | ||
closeHandler={closeModal} | ||
> | ||
<p className={classNames(styles.warningText)}> | ||
{Exclamation} | ||
We're sorry, there was a problem importing your file. | ||
</p> | ||
<p> | ||
{errorMessage} | ||
{showForumMessage && ( | ||
<> | ||
<>For further assistance, please visit </> | ||
<a | ||
href="https://forum.allencell.org/" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
The Allen Cell Discussion Forum. | ||
</a> | ||
</> | ||
)} | ||
</p> | ||
</CustomModal> | ||
); | ||
}; | ||
|
||
export default ConversionErrorModal; |
2 changes: 1 addition & 1 deletion
2
...onents/ConversionFileErrorModal/style.css → ...components/ConversionErrorModal/style.css
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.error-modal .warning-text { | ||
.warning-text { | ||
color: var(--cancel-icon-color); | ||
padding-bottom: 0.5em; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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