Skip to content

Instantly share code, notes, and snippets.

@wwwhatley
Last active July 14, 2018 20:09
Show Gist options
  • Save wwwhatley/3640de657fd12a34e2ddd0e54b3f3a12 to your computer and use it in GitHub Desktop.
Save wwwhatley/3640de657fd12a34e2ddd0e54b3f3a12 to your computer and use it in GitHub Desktop.
import React, { Component } from "react";
import styled from "styled-components";
import { Form, Input, Title, Text, Button } from "./theme.js";
const Label = styled.label`
display: flex;
flex-direction: column;
color: #777;
font-family: "Raleway", sans-serif;
font-size: 0.8em;
margin: 0.5em 0;
position: relative;
`;
class App extends Component {
render() {
return (
<div>
<Title>Form</Title>
<Form>
<Label>
Email *
{errors.email && <Text color="red">{errors.email}</Text>}
<Input
border={errors.email && "1px solid red"}
type="text"
name="email"
placeholder="Email"
/>
</Label>
<Label>
Password *
{errors.password && <Text color="red">{errors.password}</Text>}
<Input
border={errors.password && "1px solid red"}
type="password"
name="password"
placeholder="Password"
/>
</Label>
<Button type="submit">Submit</Button>
</Form>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment