-
Notifications
You must be signed in to change notification settings - Fork 342
/
overview-overlay.tsx
49 lines (46 loc) · 1.77 KB
/
overview-overlay.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React, { PureComponent } from 'react'
import { PrimaryAction } from '@worldbrain/memex-common/lib/common-ui/components/PrimaryAction'
import { CancelAction } from 'src/common-ui/components/design-library/actions/CancelAction'
import {
WhiteSpacer20,
WhiteSpacer10,
} from 'src/common-ui/components/design-library/typography'
const styles = require('./overview-overlay.css')
const settingsStyle = require('src/options/settings/components/settings.css')
interface Props {
disabled: boolean
header: string
description: React.ReactNode
continueButtonText: string
continueButtonOnClick: (...args: any[]) => any
cancelButtonText: string
cancelButtonOnClick: (...args: any[]) => any
children?: React.ReactNode
}
export default class Overlay extends PureComponent<Props, {}> {
render() {
return !this.props.disabled ? (
<div>
<div className={styles.box}>
<h3 className={styles.header}>{this.props.header}</h3>
<WhiteSpacer10 />
<p className={styles.description}>
{this.props.description}
</p>
{this.props.children}
<WhiteSpacer20 />
<div className={settingsStyle.buttonArea}>
<CancelAction
onClick={this.props.cancelButtonOnClick}
label={this.props.cancelButtonText}
/>
<PrimaryAction
onClick={this.props.continueButtonOnClick}
label={this.props.continueButtonText}
/>
</div>
</div>
</div>
) : null
}
}