Skip to content

Commit 42afb00

Browse files
committed
cleaning up a bit
1 parent 2b22e57 commit 42afb00

File tree

7 files changed

+11088
-183
lines changed

7 files changed

+11088
-183
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Feathers React Chat (TypeScript)
22

3+
**This project was adapted from the original [feathers-chat-react](https://github.com/feathersjs-ecosystem/feathers-chat-react).**
4+
35
A frontend for the [feathers-chat API](https://github.com/feathersjs/feathers-chat) using React with TypeScript.
46

57
To run the example:

src/Login.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Login extends Component<{}, State> {
1717
txtEmail = React.createRef<HTMLInputElement>()
1818
txtPassword = React.createRef<HTMLInputElement>()
1919

20-
login() {
20+
login = () => {
2121
const email = this.txtEmail.current?.value
2222
const password = this.txtPassword.current?.value
2323

@@ -27,7 +27,7 @@ class Login extends Component<{}, State> {
2727
}).catch(error => this.setState({ error: error.message }))
2828
}
2929

30-
signup() {
30+
signup = () => {
3131
const email = this.txtEmail.current?.value
3232
const password = this.txtPassword.current?.value
3333

@@ -36,17 +36,14 @@ class Login extends Component<{}, State> {
3636
.then(() => this.login())
3737
}
3838

39-
renderError = () => {
40-
return <p>{ this.state.error }</p>
41-
}
4239

4340

4441
render() {
4542
return <main className="login container">
4643
<div className="row">
4744
<div className="col-12 col-6-tablet push-3-tablet text-center heading">
4845
<h1 className="font-100">Log in or signup</h1>
49-
{this.renderError()}
46+
<p>{ this.state.error }</p>
5047
</div>
5148
</div>
5249
<div className="row">
@@ -60,11 +57,11 @@ class Login extends Component<{}, State> {
6057
<input ref={this.txtPassword} className="block" type="password" name="password" placeholder="password" />
6158
</fieldset>
6259

63-
<button type="button" className="button button-primary block signup" onClick={() => this.login()}>
60+
<button type="button" className="button button-primary block signup" onClick={this.login}>
6461
Log in
6562
</button>
6663

67-
<button type="button" className="button button-primary block signup" onClick={() => this.signup()}>
64+
<button type="button" className="button button-primary block signup" onClick={this.signup}>
6865
Signup
6966
</button>
7067
</form>

src/index.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +0,0 @@
1-
body {
2-
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
6-
-webkit-font-smoothing: antialiased;
7-
-moz-osx-font-smoothing: grayscale;
8-
}
9-
10-
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
13-
}

src/index.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import './index.css';
4-
import App from './App';
5-
import * as serviceWorker from './serviceWorker';
6-
7-
ReactDOM.render(<App />, document.getElementById('root'));
8-
9-
// If you want your app to work offline and load faster, you can change
10-
// unregister() to register() below. Note this comes with some pitfalls.
11-
// Learn more about service workers: https://bit.ly/CRA-PWA
12-
serviceWorker.unregister();
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
4+
import App from './App'
5+
6+
ReactDOM.render(<App />, document.getElementById('root'))
7+
8+

src/serviceWorker.ts

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

src/setupTests.ts

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

0 commit comments

Comments
 (0)