-
Notifications
You must be signed in to change notification settings - Fork 342
/
pioneer-plan-banner.tsx
122 lines (110 loc) · 3.8 KB
/
pioneer-plan-banner.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import * as React from 'react'
import styled from 'styled-components'
import { PrimaryAction } from '@worldbrain/memex-common/lib/common-ui/components/PrimaryAction'
import { SecondaryAction } from 'src/common-ui/components/design-library/actions/SecondaryAction'
import Icon from '@worldbrain/memex-common/lib/common-ui/components/icon'
import { colorDarkText } from 'src/common-ui/components/design-library/colors'
import DismissibleResultsMessage from 'src/dashboard-refactor/search-results/components/dismissible-results-message'
import { TooltipBox } from '@worldbrain/memex-common/lib/common-ui/components/tooltip-box'
const PioneerPlanContainer = styled.div`
display: flex;
padding: 15px 15px;
justify-content: space-between;
align-items: center;
border-radius: 3px;
margin-bottom: 30px;
width: 100%;
flex-direction: column;
font-family: 'Satoshi', sans-serif;
font-feature-settings: 'pnum' on, 'lnum' on, 'case' on, 'ss03' on, 'ss04' on,
'liga' off;
`
const PioneerPlanContentBox = styled.div`
display: flex;
flex-direction: column;
padding-bottom: 15px;
text-align: center;
`
const PioneerPlanTitle = styled.div`
font-weight: bold;
font-size: 16px;
text-align: center;
padding-bottom: 5px;
color: ${colorDarkText};
`
const PioneerPlanDescription = styled.div`
font-size: 14px;
text-align: center;
color: ${colorDarkText};
`
const PioneerPlanButtonBox = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
`
const PioneerPlanLearnMoreButton = styled(SecondaryAction)``
const PioneerPlanUpgradeButton = styled(PrimaryAction)``
export interface Props {
width?: string
upgradeUrl?: string
moreInfoUrl?: string
onHideClick?: React.MouseEventHandler
direction?: string
showCloseButton?: boolean
}
const PioneerPlanBanner = ({
moreInfoUrl = 'https://worldbrain.io/announcements/back-to-beta',
upgradeUrl = process.env.NODE_ENV === 'production'
? 'https://worldbrain.io/links/pioneer-upgrade-extension'
: 'https://buy.stripe.com/test_8wMdU4cm4frH4SY144',
...props
}: Props) => (
<DismissibleResultsMessage onDismiss={props.onHideClick}>
<PioneerPlanContentBox>
<PioneerPlanTitle>Get a 60% early bird discount</PioneerPlanTitle>
<PioneerPlanDescription>
Memex is currently in beta and free to use.
<br />
Support a 'Venture Capital'-free business & get an early bird
discount on our upcoming subscriptions.
</PioneerPlanDescription>
</PioneerPlanContentBox>
<PioneerPlanButtonBox>
<PioneerPlanLearnMoreButton
label="Learn More"
onClick={() => window.open(moreInfoUrl)}
/>
<PioneerPlanUpgradeButton
label="Upgrade"
onClick={() => window.open(upgradeUrl)}
/>
{props.showCloseButton && (
<TooltipBox
placement="bottom"
tooltipText="Find this message again in your account settings."
getPortalRoot={null}
>
<Icon
icon="removeX"
height="12px"
onClick={props.onHideClick}
/>
</TooltipBox>
)}
</PioneerPlanButtonBox>
</DismissibleResultsMessage>
)
const SectionTitle = styled.div`
color: ${(props) => props.theme.colors.darkerText};
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
`
const InfoText = styled.div`
color: ${(props) => props.theme.colors.white};
font-size: 14px;
font-weight: 500;
margin-bottom: 20px;
`
export default PioneerPlanBanner