Skip to content

Commit c5ab075

Browse files
author
Ruslan Gainutdinov
committed
Added profanity filter. Added github ribbon
1 parent 245cf6a commit c5ab075

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
<link rel="stylesheet" href="css/base.css">
88
<link rel="stylesheet" href="css/index.css">
99
<link rel="stylesheet" href="css/spinner.css">
10+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.2/gh-fork-ribbon.min.css" />
1011
</head>
1112
<body>
1213
<script id="props" data-props='{{props}}'></script>
1314
<section class="todoapp">{{thing}}</section>
1415
<footer class="info">
1516
<p>Double-click to edit a todo</p>
1617
<p>Created by <a href="http://github.com/gdborton/">gdborton</a></p>
18+
<p>Upgraded and cloudified by <a href="http://github.com/huksley/">huksley</a></p>
1719
</footer>
1820

21+
<a class="github-fork-ribbon" href="https://github.com/huksley/todo-react-ssr-serverless" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
1922
<script src="dist/index.bundle.js"></script>
2023
</body>
2124
</html>

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"react-router": "^4.2.0",
4545
"react-router-config": "^1.0.0-beta.4",
4646
"react-router-dom": "^4.2.2",
47-
"serverless-http": "^1.6.0"
47+
"serverless-http": "^1.6.0",
48+
"swearjar": "^0.2.0"
4849
},
4950
"devDependencies": {
5051
"@babel/core": "^7.0.0",

src/app.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { renderRoutes } from 'react-router-config';
33
import TodoFooter from './footer';
44
import utils from './utils';
55
import fetch from 'cross-fetch';
6+
import swearjar from 'swearjar';
67

78
const ENTER_KEY = 13;
89
const API_URL = process.env.API_URL || "http://localhost:3000/api";
@@ -98,7 +99,7 @@ class TodoApp extends React.Component {
9899
if (val) {
99100
this.addTodo({
100101
id: utils.uuid(),
101-
title: val,
102+
title: swearjar.censor(val),
102103
completed: false
103104
}).then(() => {
104105
this.loadTodo().then(() => {
@@ -133,7 +134,7 @@ class TodoApp extends React.Component {
133134
}
134135

135136
save(todo, text) {
136-
this.updateTodo(Object.assign({}, todo, { title: text })).then(() => {
137+
this.updateTodo(Object.assign({}, todo, { title: swearjar.censor(text) })).then(() => {
137138
this.loadTodo().then(() => {
138139
this.setState({ editing: null })
139140
})

0 commit comments

Comments
 (0)