Skip to content

Commit c5197be

Browse files
committed
strips all styles, updates all dependencies to latest version
1 parent 8dfe3c3 commit c5197be

37 files changed

+6064
-2419
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"stage-2",
55
"stage-3",
66
"react",
7-
"./babel-preset"
8-
]
7+
"next/babel"
8+
],
99
}

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ It is deployed [here](https://next-postgres.herokuapp.com/).
1111
- [NextJS + Custom Express](https://github.com/zeit/next.js/)
1212
- [Postgres](https://www.postgresql.org/)
1313
- [Sequelize: PostgresSQL ORM](http://docs.sequelizejs.com/)
14-
- [Styled-JSX](https://github.com/zeit/styled-jsx)
1514
- [Passport for local authentication](http://passportjs.org/)
1615
- [Heroku](https://www.heroku.com)
1716
- [Redux](http://redux.js.org/) + [Higher-Order Components](https://facebook.github.io/react/docs/higher-order-components.html)
@@ -43,14 +42,14 @@ I also built a [React Native](https://facebook.github.io/react-native/) applicat
4342

4443
## Setup: Quick newbies guide to Postgres
4544

46-
- On OSX, to run Postgres:
45+
- On OSX, to run Postgres:
4746

4847
```sh
4948
pg_ctl -D /usr/local/var/postgres start
5049
```
5150

5251
- Postgres config is stored in `./config.js`.
53-
- Local database: `testdb`.
52+
- Local database: `testdb`.
5453
- Username and password as `test`.
5554

5655
### First time Postgres instructions.
@@ -163,4 +162,4 @@ append `--force` if necessary.
163162

164163
## Questions?
165164

166-
Feel free to slang any feels to [@meanjim](https://twitter.com/meanjim).
165+
Feel free to slang any feels to [@meanjim](https://twitter.com/meanjim).

api/models/comment.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
module.exports = (Sequelize, DataTypes) => {
2-
const Comment = Sequelize.define(
3-
'Comment',
4-
{
5-
content: {
6-
type: DataTypes.TEXT,
7-
allowNull: false,
8-
},
2+
const Comment = Sequelize.define('Comment', {
3+
content: {
4+
type: DataTypes.TEXT,
5+
allowNull: false,
96
},
10-
);
7+
});
118

129
Comment.associate = models => {
1310
Comment.hasMany(models.Comment, {

api/models/post.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
module.exports = (Sequelize, DataTypes) => {
2-
const Post = Sequelize.define(
3-
'Post',
4-
{
5-
title: {
6-
type: DataTypes.TEXT,
7-
allowNull: false,
8-
},
9-
content: {
10-
type: DataTypes.TEXT,
11-
allowNull: true,
12-
},
13-
}
14-
);
2+
const Post = Sequelize.define('Post', {
3+
title: {
4+
type: DataTypes.TEXT,
5+
allowNull: false,
6+
},
7+
content: {
8+
type: DataTypes.TEXT,
9+
allowNull: true,
10+
},
11+
});
1512

1613
Post.associate = models => {
1714
Post.hasMany(models.Comment, {

api/models/user.js

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
module.exports = (Sequelize, DataTypes) => {
2-
const User = Sequelize.define(
3-
'User',
4-
{
5-
username: {
6-
type: DataTypes.STRING,
7-
allowNull: false,
8-
unique: true,
9-
validate: {
10-
is: /^[a-z0-9\_\-]+$/i,
11-
},
2+
const User = Sequelize.define('User', {
3+
username: {
4+
type: DataTypes.STRING,
5+
allowNull: false,
6+
unique: true,
7+
validate: {
8+
is: /^[a-z0-9\_\-]+$/i,
129
},
13-
email: {
14-
type: DataTypes.STRING,
15-
allowNull: true,
16-
validate: {
17-
isEmail: true,
18-
},
10+
},
11+
email: {
12+
type: DataTypes.STRING,
13+
allowNull: true,
14+
validate: {
15+
isEmail: true,
1916
},
20-
password: {
21-
type: DataTypes.STRING,
22-
allowNull: false,
23-
},
24-
salt: {
25-
type: DataTypes.STRING,
26-
allowNull: false,
27-
},
28-
}
29-
);
17+
},
18+
password: {
19+
type: DataTypes.STRING,
20+
allowNull: false,
21+
},
22+
salt: {
23+
type: DataTypes.STRING,
24+
allowNull: false,
25+
},
26+
});
3027

3128
User.associate = models => {
3229
User.hasMany(models.Post, {

babel-preset.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

components/AuthLoginForm.js

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,15 @@ class AuthLoginForm extends React.Component {
2121

2222
render() {
2323
return (
24-
<div className="form">
25-
<style jsx>{`
26-
.spacer {
27-
height: 16px;
28-
margin: 0;
29-
width: 100%;
30-
display: block;
31-
border: 0;
32-
}
33-
34-
.large-spacer {
35-
height: 24px;
36-
margin: 0;
37-
width: 100%;
38-
display: block;
39-
border: 0;
40-
}
41-
`}</style>
24+
<div>
4225
<Input
4326
label="Username"
4427
autoFocus
4528
value={this.state.username}
4629
name="username"
4730
onChange={this._handleChange}
4831
/>
49-
<hr className="spacer" />
32+
<hr />
5033
<Input
5134
label="Password"
5235
value={this.state.password}
@@ -55,10 +38,8 @@ class AuthLoginForm extends React.Component {
5538
onChange={this._handleChange}
5639
onSubmit={this._handleSubmit}
5740
/>
58-
<hr className="large-spacer" />
59-
<Button onClick={this._handleSubmit}>
60-
Log in
61-
</Button>
41+
<hr />
42+
<Button onClick={this._handleSubmit}>Log in</Button>
6243
</div>
6344
);
6445
}

components/AuthSignupForm.js

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,22 @@ class AuthSignupForm extends React.Component {
2121

2222
render() {
2323
return (
24-
<div className="form">
25-
<style jsx>{`
26-
.spacer {
27-
height: 16px;
28-
margin: 0;
29-
width: 100%;
30-
display: block;
31-
border: 0;
32-
}
33-
.large-spacer {
34-
height: 24px;
35-
margin: 0;
36-
width: 100%;
37-
display: block;
38-
border: 0;
39-
}
40-
`}</style>
24+
<div>
4125
<Input
4226
label="Username"
4327
value={this.state.username}
4428
name="username"
4529
onChange={this._handleChange}
4630
/>
47-
<hr className="spacer" />
31+
<hr />
4832
<Input
4933
label="Password"
5034
value={this.state.password}
5135
name="password"
5236
type="password"
5337
onChange={this._handleChange}
5438
/>
55-
<hr className="spacer" />
39+
<hr />
5640
<Input
5741
label="Verify your password"
5842
value={this.state.verify}
@@ -61,10 +45,8 @@ class AuthSignupForm extends React.Component {
6145
onChange={this._handleChange}
6246
onSubmit={this._handleSubmit}
6347
/>
64-
<hr className="large-spacer" />
65-
<Button onClick={this._handleSubmit}>
66-
Sign up
67-
</Button>
48+
<hr />
49+
<Button onClick={this._handleSubmit}>Sign up</Button>
6850
</div>
6951
);
7052
}

components/BoxHeaderLayout.js

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,9 @@ export default class BoxHeaderLayout extends React.Component {
55
const { style } = this.props;
66

77
return (
8-
<header className="header" style={style}>
9-
<style jsx>{`
10-
.header {
11-
min-height: 44px;
12-
background: #24292e;
13-
color: #FFFFFF;
14-
display: flex;
15-
align-items: center;
16-
justify-content: space-between;
17-
padding: 0 16px 0 16px;
18-
}
19-
20-
.header-left {
21-
min-width: 25%;
22-
width: 100%;
23-
padding: 8px 0 8px 0;
24-
}
25-
26-
.header-right {
27-
padding-left: 16px;
28-
flex-shrink: 0;
29-
}
30-
`}</style>
31-
<div className="header-left">
32-
{this.props.children}
33-
</div>
34-
<div className="header-right">
35-
{this.props.right}
36-
</div>
8+
<header style={style}>
9+
<div>{this.props.children}</div>
10+
<div>{this.props.right}</div>
3711
</header>
3812
);
3913
}

components/Button.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,7 @@ export default class Button extends React.Component {
1212

1313
render() {
1414
return (
15-
<button
16-
className="button"
17-
style={this.props.style}
18-
onClick={this.props.onClick}>
19-
<style jsx>{`
20-
.button {
21-
background: #0000FF;
22-
color: #FFFFFF;
23-
padding: 16px;
24-
cursor: pointer;
25-
line-height: 1;
26-
font-size: 16px;
27-
font-weight: 600;
28-
transition: 200ms all linear;
29-
transition-property: transform, color;
30-
}
31-
32-
.button:hover {
33-
background: #1111AF;
34-
}
35-
36-
.button:active {
37-
transform: scale(0.95);
38-
}
39-
`}</style>
15+
<button style={this.props.style} onClick={this.props.onClick}>
4016
{this.props.children}
4117
</button>
4218
);

0 commit comments

Comments
 (0)