Repository navigation
Expand file tree
/
Copy patherror.tsx
More file actions
50 lines (45 loc) · 1.37 KB
/
Copy patherror.tsx
File metadata and controls
50 lines (45 loc) · 1.37 KB
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
50
import * as C from '@/constants'
import * as Kb from '@/common-adapters'
type KeybaseLinkErrorBodyProps = {
message: string
isError: boolean
onCancel?: () => void
}
export const KeybaseLinkErrorBody = (props: KeybaseLinkErrorBodyProps) => {
const bannerColor = props.isError ? 'red' : 'green'
return (
<Kb.PopupWrapper onCancel={props.onCancel} customCancelText="Close">
<Kb.Box2 direction="vertical" fullWidth={true} style={styles.container}>
<Kb.Banner color={bannerColor}>
<Kb.BannerParagraph bannerColor={bannerColor} content={props.message} selectable={true} />
</Kb.Banner>
</Kb.Box2>
</Kb.PopupWrapper>
)
}
const KeybaseLinkError = () => {
const deepError = C.useDeepLinksState(s => s.keybaseLinkError)
const message = deepError
const isError = true
const navigateUp = C.useRouterState(s => s.dispatch.navigateUp)
const onClose = () => navigateUp()
return <KeybaseLinkErrorBody onCancel={onClose} isError={isError} message={message} />
}
const styles = Kb.Styles.styleSheetCreate(() => ({
container: Kb.Styles.platformStyles({
common: {
backgroundColor: Kb.Styles.globalColors.white,
},
isElectron: {
height: 560,
width: 400,
},
isMobile: {
flexGrow: 1,
flexShrink: 1,
maxHeight: '100%',
width: '100%',
},
}),
}))
export default KeybaseLinkError