diff options
author | Sam Wilkins <35748010+samwilkins333@users.noreply.github.com> | 2019-09-29 19:04:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-29 19:04:29 -0400 |
commit | 89fd714207dbd965dc4b566202ec85bbd7998adf (patch) | |
tree | 4b6279f1fe0157eb79fabd000a55754c33253506 /src/client/views/MainViewModal.tsx | |
parent | c40480ec1a2da84b4223b0605bea2fe19df1104c (diff) | |
parent | 5bd6158a1f839d19f8965bff97a908c89271437d (diff) |
Merge pull request #289 from browngraphicslab/googlephotos_sharing_master
Googlephotos sharing master
Diffstat (limited to 'src/client/views/MainViewModal.tsx')
-rw-r--r-- | src/client/views/MainViewModal.tsx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/client/views/MainViewModal.tsx b/src/client/views/MainViewModal.tsx new file mode 100644 index 000000000..b7fdd6168 --- /dev/null +++ b/src/client/views/MainViewModal.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import "./MainViewModal.scss"; + +export interface MainViewOverlayProps { + isDisplayed: boolean; + interactive: boolean; + contents: string | JSX.Element; + dialogueBoxStyle?: React.CSSProperties; + overlayStyle?: React.CSSProperties; + dialogueBoxDisplayedOpacity?: number; + overlayDisplayedOpacity?: number; +} + +export default class MainViewModal extends React.Component<MainViewOverlayProps> { + + render() { + let p = this.props; + let dialogueOpacity = p.dialogueBoxDisplayedOpacity || 1; + let overlayOpacity = p.overlayDisplayedOpacity || 0.4; + return ( + <div style={{ pointerEvents: p.isDisplayed ? p.interactive ? "all" : "none" : "none" }}> + <div + className={"dialogue-box"} + style={{ + backgroundColor: "gainsboro", + borderColor: "black", + ...(p.dialogueBoxStyle || {}), + opacity: p.isDisplayed ? dialogueOpacity : 0 + }} + >{p.contents}</div> + <div + className={"overlay"} + style={{ + backgroundColor: "gainsboro", + ...(p.overlayStyle || {}), + opacity: p.isDisplayed ? overlayOpacity : 0 + }} + /> + </div> + ); + } + + +}
\ No newline at end of file |