-
Notifications
You must be signed in to change notification settings - Fork 2
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 #323 from bento-platform/fix/file-modal-style-and-…
…view-btn fix(explorer): experiment result view button conditions + bad file view style
- Loading branch information
Showing
7 changed files
with
123 additions
and
75 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
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,39 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { Modal } from "antd"; | ||
|
||
import FileDisplay from "./FileDisplay"; | ||
|
||
const FileModal = ({ title, visible, onCancel, hasTriggered, url, fileName, loading }) => ( | ||
<Modal | ||
title={title} | ||
visible={visible} | ||
onCancel={onCancel} | ||
width={1080} | ||
style={{ | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
top: 50, // down from default of 100; gives a bit more screen real estate | ||
}} | ||
bodyStyle={{ minWidth: "692px" }} | ||
footer={null} | ||
// destroyOnClose in order to stop audio/video from playing & avoid memory leaks at the cost of re-fetching: | ||
destroyOnClose={true} | ||
> | ||
{(hasTriggered ?? true) && ( | ||
<FileDisplay uri={url} fileName={fileName} loading={loading ?? false} /> | ||
)} | ||
</Modal> | ||
); | ||
FileModal.propTypes = { | ||
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired, | ||
visible: PropTypes.bool.isRequired, | ||
onCancel: PropTypes.func.isRequired, | ||
hasTriggered: PropTypes.bool, | ||
url: PropTypes.string, | ||
fileName: PropTypes.string, | ||
loading: PropTypes.bool, | ||
}; | ||
|
||
export default FileModal; |
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