ducky/web
22:21f80f56cda9
Go to Latest
ducky/web/src/components/validation-error.jsx
Switch to being a website instead of a Chrome app.
Update our CNAME to be the more appropriate "prototype.useducky.com" when we
deploy.
Create a homepage and a non-onboarding page template. This mostly consisted of
setting up a header component and the associated styles, and then a logged-in
vs. guest flavor of said header, changing the links appropriately.
We also created a simple homepage that describes what Ducky is and does, and
gave a jumping-off point for it.
Stubbed out a basic links page, just to get an idea for what the homepage would
be like when a logged-in user navigated to the homepage (e.g., not the marketing
copy).
Updated our login page to _actually work_, and redirected it to the new URL for
the payment setup page.
Updated the payment page to actually create a subscription, and moved it from
/register/payment to just /payment.
Fixed a bug in our registration page that was looking for an invalid_form error
when it really meant an invalid_format error. Ooops. Also, updated it to point
to the new /payment endpoint instead of /register/payment.
Updated our router to use the new homepage, the new links page, and updated the
URL for the payment page.
Updated our button styles so they should all have the right font color, padding,
and border-radius, but could've potentially screwed something up. Oops.
Updated our backgrounds all over to have a transparent-y white background behind
the content, and a simple pattern for the rest of the body. Not sure how I feel
about it just yet, but I'm not going to keep futzing with it.
1 import React from 'react'
3 export default React.createClass({
4 displayName: 'ValidationError',
7 let fields = this.props.fields
8 if (this.props.field && !this.props.fields) {
9 fields = [this.props.field]
11 let notFields = this.props.notFields
12 if (this.props.notField && !this.props.notFields) {
13 notFields = [this.props.notField]
15 let params = this.props.params
16 if (this.props.param && !this.props.params) {
17 params = [this.props.param]
19 let notParams = this.props.notParams
20 if (this.props.notParam && !this.props.notParams) {
21 notParams = [this.props.notParam]
23 let headers = this.props.headers
24 if (this.props.header && !this.props.headers) {
25 headers = [this.props.header]
27 let notHeaders = this.props.notHeaders
28 if (this.props.notHeader && !this.props.notHeaders) {
29 notHeaders = [this.props.notHeader]
31 const outputs = this.props.outputs
32 const errors = this.props.errors
35 <div className={errors.length ? '' : 'hidden' }>
36 {errors.map(error => {
38 if (!error.field && !notFields && !error.param && !notParams && !error.header && !notHeaders) {
41 if (fields && error.field && fields.indexOf(error.field) < 0) {
44 if (notFields && error.field && notFields.indexOf(error.field) >= 0) {
47 if (params && error.param && params.indexOf(error.param) < 0) {
50 if (notParams && error.param && notParams.indexOf(error.param) >= 0) {
53 if (headers && error.header && headers.indexOf(error.header) < 0) {
56 if (notHeaders && error.header && notHeaders.indexOf(error.header) >= 0) {
59 if (outputs[error.error] == undefined) {
60 errorString = 'An unknown error occurred. Please contact support. Sorry.'
62 errorString = outputs[error.error]
64 const id = [error.field, error.param, error.header, error.error].join("|")
65 return <div key={id} className="flash-error validation"><span>{errorString}</span></div>