Skip to content

Commit 82dec3c

Browse files
authored
Cleanup (#820)
* some lint clean up and folder renaming * missed removed gif * adding netlify.toml file
1 parent f0233db commit 82dec3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+37
-19
lines changed

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ yarn-error.log
44
.vscode
55
.DS_Store
66

7-
example/manual-testing/data/*
8-
!example/manual-testing/data/index.html
9-
!example/manual-testing/data/animations/
10-
!example/manual-testing/data/images/
11-
!example/manual-testing/data/videos/
7+
examples/manual-testing/data/*
8+
!examples/manual-testing/data/index.html
9+
!examples/manual-testing/data/animations/
10+
!examples/manual-testing/data/images/
11+
!examples/manual-testing/data/videos/

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dist/**/*.js.map
1212
.npmignore
1313
tslint.json
1414
yarn.lock
15-
example/
15+
examples/
1616
_art/
1717
yarn-error.log
1818
bundle.js

README.md

Lines changed: 6 additions & 6 deletions

_art/gif_scrub.gif

-594 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

example/nsfw_demo/src/App.js renamed to examples/nsfw_demo/src/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ class App extends Component {
8989
case 'Porn':
9090
case 'Sexy':
9191
droppedImageStyle = blurred
92+
break
93+
default:
94+
break
9295
}
9396
}
9497
return droppedImageStyle

example/nsfw_demo/src/components/Footer.js renamed to examples/nsfw_demo/src/components/Footer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const options = [
2929
},
3030
]
3131

32-
export default (props) => (
32+
const Footer = (props) => (
3333
<div>
3434
<div className="modelPicker">
3535
<p>Currently Using:</p>
@@ -45,7 +45,7 @@ export default (props) => (
4545
<a href="https://github.com/infinitered/nsfwjs">NSFW.js Github</a>
4646
</div>
4747
<div>
48-
<a href="https://github.com/infinitered/nsfwjs/tree/master/example/nsfw_demo">Website Github</a>
48+
<a href="https://github.com/infinitered/nsfwjs/tree/master/examples/nsfw_demo">Website Github</a>
4949
</div>
5050
<div>
5151
<a href="https://github.com/gantman/nsfw_model">NSFW Model Github</a>
@@ -66,3 +66,5 @@ export default (props) => (
6666
</footer>
6767
</div>
6868
)
69+
70+
export default Footer

example/nsfw_demo/src/components/Header.js renamed to examples/nsfw_demo/src/components/Header.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import tflogo from '../tflogo.jpg'
33
import logo from '../logo.svg'
44

5-
export default () => (
5+
const Header = () => (
66
<header>
77
<img src={logo} className="App-logo" alt="logo" />
88
<h1>Client-side indecent content checking</h1>
@@ -14,3 +14,5 @@ export default () => (
1414
</div>
1515
</header>
1616
)
17+
18+
export default Header

example/nsfw_demo/src/components/Loading.js renamed to examples/nsfw_demo/src/components/Loading.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import * as Spinner from 'react-spinkit'
33

4-
export default ({ showLoading }) => {
4+
const Loading = ({ showLoading }) => {
55
if (showLoading) {
66
return (
77
<div id="spinContainer">
@@ -12,3 +12,5 @@ export default ({ showLoading }) => {
1212

1313
return null
1414
}
15+
16+
export default Loading

example/nsfw_demo/src/components/Results.js renamed to examples/nsfw_demo/src/components/Results.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ const renderPredictions = props => {
1919
}
2020
}
2121

22-
export default props => (
22+
const Results = props => (
2323
<div id="results">
2424
<p>{props.message}</p>
2525
{renderPredictions(props)}
2626
</div>
2727
)
28+
29+
export default Results

example/nsfw_demo/src/components/Underdrop.js renamed to examples/nsfw_demo/src/components/Underdrop.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export default class Underdrop extends Component {
4747
<a
4848
href="https://github.com/alexkimxyz/nsfw_data_scrapper"
4949
target="_blank"
50+
rel="noreferrer"
5051
>
5152
Contribute to the Data Scraper
5253
</a>{' '}
@@ -59,6 +60,7 @@ export default class Underdrop extends Component {
5960
<a
6061
href="https://github.com/gantman/nsfw_model"
6162
target="_blank"
63+
rel="noreferrer"
6264
>
6365
Contribute to the Trainer
6466
</a>{' '}
@@ -69,7 +71,8 @@ export default class Underdrop extends Component {
6971
<a
7072
href="https://medium.freecodecamp.org/machine-learning-how-to-go-from-zero-to-hero-40e26f8aa6da"
7173
target="_blank"
72-
>
74+
rel="noreferrer"
75+
>
7376
<strong>Learn more about how Machine Learning works!</strong>
7477
</a>
7578
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
base = "/"
3+
command = "npm run build && cd examples/nsfw_demo && npm i && npm run build"
4+
publish = "examples/nsfw_demo/build"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"toc": "doctoc .",
1313
"contributors:add": "all-contributors add",
1414
"contributors:generate": "all-contributors generate",
15-
"prep": "yarn && yarn build && cd example/nsfw_demo/ && yarn add ../../ && cd -",
15+
"prep": "yarn && yarn build && cd examples/nsfw_demo/ && yarn add ../../ && cd -",
1616
"scriptbundle": "browserify ./dist/nsfwjs.js --standalone nsfwjs --outfile ./dist/bundle.js",
1717
"minbundle": "terser dist/bundle.js --compress --mangle --output dist/nsfwjs.min.js"
1818
},

0 commit comments

Comments
 (0)