-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpage-passes.js
205 lines (196 loc) · 10.9 KB
/
page-passes.js
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import React, { useRef, useState } from "react"
import BodyClassName from "react-body-classname"
import {Helmet} from "react-helmet"
import HeaderPortal from "components/header-portal"
import "components/styles/page-passes.scss"
import iconProPlan from "images/icons/icon-proplan.svg"
import iconCreditCard from "images/icons/icon-credit-card.svg"
import iconPayPal from "images/icons/paypal-inactive-dark.svg"
import iconCreditCardTypes from "images/icons/credit-card-icons.png"
import { useMainHeading } from "./main-heading-context"
const PassesPage = () => {
useMainHeading('Classes')
const closeBtnRef = useRef(null)
const customAmtRadio = useRef(null)
const [dialogActive, setDialogState] = useState(false)
let [currentDialog, setCurrentDialog] = useState('')
const btnCloseClick = () => {
setDialogState(false)
}
const focusInCustomInput = () => {
customAmtRadio.current.checked = true
}
const openDialog = (dialogName) => {
setCurrentDialog(dialogName)
setDialogState(true)
}
return (
<BodyClassName className="page-plans">
<>
<section className="layout-centered">
<header className="page-header">
<div className="page-header-content layout">
<h2 className="primary-heading h1-style">Pick a Plan and Start Your Adventure Today!</h2>
</div>
</header>
<article className="layout">
<ul className="plan-list">
<li className="plan-basic">
<div>
<h3>CampSpots <span>Basic</span></h3>
<h4>$99<span>/year</span></h4>
<p className="subhead">Renewed annually</p>
<ul>
<li>
<span className="icon-checkmark-gray"></span>
<span className="text">Unlimited overnight stays with No Camping Fees</span>
</li>
<li>
<span className="icon-checkmark-gray"></span>
<span className="text">100% money back guarantee</span>
</li>
<li>
<span className="icon-x"></span>
<span className="text"><del>Access to spa facilities & restaurants</del></span>
</li>
</ul>
<button
id="btn-join-basic"
onClick={()=> { openDialog('basic') }}
>
Join Now
</button>
<p>Vitae maximus turpis tempor <strong>nec</strong>.</p>
</div>
</li>
<li className="plan-pro">
<div>
<span className="icon-proplan"></span>
<h3>CampSpots <span>Pro</span></h3>
<h4>$139<span>/year</span></h4>
<p className="subhead">Renewed annually</p>
<ul>
<li>
<span className="icon-checkmark-orange"></span>
<span className="text">Unlimited overnight stays with No Camping Fees</span></li>
<li>
<span className="icon-checkmark-orange"></span>
<span className="text">100% money back guarantee</span>
</li>
<li>
<span className="icon-checkmark-orange"></span>
<span className="text">Access to spa facilities & restaurants</span>
</li>
</ul>
<button
id="btn-join-pro"
onClick={()=> { openDialog('pro') }}
>
Join Now
</button>
<p>Lorem ipsum dolor <strong>sit</strong> amet, consectetur adipiscing elit.</p>
</div>
</li>
</ul>
</article>
</section>
<div
className={`payment-modal ${currentDialog}`}
role="dialog"
hidden={dialogActive ? null : 'hidden'}
>
<header>
<button
className="btn-close-dialog"
onClick={btnCloseClick}
ref={closeBtnRef}
>
X
</button>
<img src={iconProPlan} alt="" />
<div id="header-basic">
<h2>CampSpots<span>Basic</span></h2>
<h3>$99/year</h3>
</div>
<div id="header-pro">
<h2>CampSpots<span>Pro</span></h2>
<h3>$139/year</h3>
</div>
</header>
<section className="payment-form">
<h3>Donate to support local sites</h3>
<form>
<div className="control-group radios">
<label>
<input id="amt_3" name="amounts" type="radio" value="3" />
$3
</label>
<label>
<input id="amt_5" name="amounts" type="radio" value="5" />
$5
</label>
<label>
<input id="amt_10" name="amounts" type="radio" value="10" />
$10
</label>
<label className="custom-radio-group">
<input id="amt_custom" name="amounts" type="radio" value="Custom" ref={customAmtRadio} />
<input onFocus={focusInCustomInput} type="text" id="amt_custom_text" placeholder="$ Other amount" />
</label>
</div>
<div className="payment-buttons">
<h3>Payment Method</h3>
<div>
<button type="button" className="payment-button active">
<img alt="Credit card" width="25px" src={iconCreditCard} />
<span>Credit card</span>
</button>
<button type="button" className="payment-button">
<img alt="PayPal" width="50px" src={iconPayPal} />
</button>
</div>
</div>
<div className="payment-fields">
<div className="control-group">
<label htmlFor="name" className="visually-hidden">Cardholder name</label>
<input type="text" name="name" id="name" placeholder="Name" />
</div>
<div className="control-group">
<div className="media-img-after">
<img src={iconCreditCardTypes} style={{width: '127px', height: '20px'}} aria-hidden="true" />
<label htmlFor="cc-number" className="visually-hidden">Credit Card Number</label>
<input type="number" name="cc-number" id="cc-number" placeholder="Credit card number" />
</div>
</div>
<div className="control-group row">
<div>
<label htmlFor="expiry" className="visually-hidden">Expiration</label>
<input type="text" name="expiry" id="expiry" placeholder="Month/Year" />
</div>
<div>
<label htmlFor="cvc" className="visually-hidden">CVC Code</label>
<input type="text" name="cvc" id="cvc" placeholder="CVC" max-length="4" />
</div>
</div>
<div className="control-group">
<label htmlFor="phone-number" className="visually-hidden">Phone Number</label>
<input type="number" name="number" id="number" placeholder="Phone number" />
</div>
<div className="control-group">
<button className="btn-pay">
<span className="text text-pay-pro">Pay $139</span>
<span className="text text-pay-basic">Pay $99</span>
<span className="icon-lock"></span>
</button>
</div>
<p className="subhead">Secure payment processing by <a href="https://stripe.com">Stripe</a>.</p>
</div>
</form>
</section>
</div>
<div className="modal-curtain" hidden={dialogActive ? null : 'hidden'}></div>
</>
</BodyClassName>
)
}
export default PassesPage