This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React, { type ComponentType } from 'react'; | |
import Form from './Form'; | |
import { CreateButton } from './buttons'; | |
import TextInputBig from './TextInputBig'; | |
import { FormattedMessage } from 'react-intl'; | |
import Text from './Text'; | |
import Set from './Set'; | |
import CreateWebMutation from '../mutations/CreateWebMutation'; | |
import withMutation, { getClientMutationId } from './withMutation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React from 'react'; | |
import * as validation from '../lib/validation'; | |
import Text, { type TextProps } from './Text'; | |
import { FormattedMessage } from 'react-intl'; | |
type Props = TextProps & { | |
error: ?validation.ValidationError, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import isEmail from 'validator/lib/isEmail'; | |
type AlreadyExists = { type: 'alreadyExists' }; | |
type Email = { type: 'email' }; | |
type MaxLength = { type: 'maxLength', maxLength: number }; | |
type MinLength = { type: 'minLength', minLength: number }; | |
type Required = { type: 'required' }; | |
type RequiredAgree = { type: 'requiredAgree' }; | |
type WrongPassword = { type: 'wrongPassword' }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React, { type ComponentType } from 'react'; | |
import type { Commit, Environment } from '../types'; | |
import PropTypes from 'prop-types'; | |
const withMutation = <Props: {}, Variables, Response>( | |
Component: ComponentType< | |
{ | |
mutate: ( | |
commit: Commit<Variables, Response>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import React from 'react'; | |
import Form from './Form'; | |
import { CreateButton } from './buttons'; | |
import TextInputBig from './TextInputBig'; | |
import { FormattedMessage } from 'react-intl'; | |
import Text from './Text'; | |
import Set from './Set'; | |
import nameToDomain from '../lib/nameToDomain'; | |
import { createFragmentContainer, graphql } from 'react-relay'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
// temp is a wrapper for temporary values which need to be stored in local | |
// storage but revived with a different value. | |
// For example, form disabled state, which needs to be stored because cross tab | |
// sync, but revived with a false value, otherwise form would be frozen forever. | |
// It can be used for any value of course. | |
// Session only value. If tempId is not current then false is returned. | |
// const value = createTemp(true, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="alternate" hreflang="cs" href="http://cs.example.com/" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import type { State } from '../types'; | |
import Form from '../components/form'; | |
import TextInput from '../components/text-input'; | |
import { connect } from 'react-redux'; | |
import { setUserForm } from '../lib/forms/actions'; | |
const UserForm = ({ id, user, setUserForm }) => { | |
// If you know how to type it better, please let me know. | |
const onChange = (prop: $Keys<typeof user>) => state => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import type { Action, FormsState } from '../../types'; | |
import { reject, isNil } from 'ramda'; | |
const initialState = { | |
user: { | |
initialState: { | |
name: '', | |
description: '', | |
likesCats: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import type { Action, Id, UserForm } from '../../types'; | |
export const setUserForm = (id: Id, state: ?UserForm): Action => ({ | |
type: 'SET_USER_FORM', | |
id, | |
state, | |
}); |