Skip to content

Commit 28a909a

Browse files
authored
Merge pull request #33 from TaloDev/develop
Release 0.8.0
2 parents 383f310 + 0d39418 commit 28a909a

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@
6666
"lint-staged": {
6767
"*.{js,jsx}": "eslint --fix"
6868
},
69-
"version": "0.7.3"
69+
"version": "0.8.0"
7070
}

src/App.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ const App = () => {
107107

108108
<Switch>
109109
<Route exact path={routes.dashboard} component={Dashboard} />
110+
<Route exact path={routes.account} component={Account} />
111+
<Route exact path={routes.confirmPassword} component={ConfirmPassword} />
112+
110113
{activeGame &&
111114
<>
112115
<Route exact path={routes.players} component={Players} />
@@ -117,8 +120,6 @@ const App = () => {
117120
{canViewPage(user, routes.dataExports) && <Route exact path={routes.dataExports} component={DataExports} />}
118121
<Route exact path={routes.leaderboards} component={Leaderboards} />
119122
<Route exact path={routes.leaderboardEntries} component={LeaderboardEntries} />
120-
<Route exact path={routes.account} component={Account} />
121-
<Route exact path={routes.confirmPassword} component={ConfirmPassword} />
122123
{canViewPage(user, routes.activity) && <Route exact path={routes.activity} component={Activity} />}
123124
<Route exact path={routes.stats} component={Stats} />
124125
<Route exact path={routes.playerStats} component={PlayerStats} />

src/api/register.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import api from './api'
22

3-
export default async (data) => api.post('/public/users/register', data)
3+
export default (data) => api.post('/public/users/register', data)

src/pages/Register.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import buildError from '../utils/buildError'
1111
import AuthService from '../services/AuthService'
1212

1313
const Register = () => {
14-
const [name, setName] = useState('')
14+
const [organisationName, setOrganisationName] = useState('')
15+
const [username, setUsername] = useState('')
1516
const [email, setEmail] = useState('')
1617
const [password, setPassword] = useState('')
1718
const [, setUser] = useRecoilState(userState)
@@ -31,7 +32,7 @@ const Register = () => {
3132
setLoading(true)
3233

3334
try {
34-
const res = await register({ email, password, organisationName: name })
35+
const res = await register({ email, password, organisationName, username })
3536
const accessToken = res.data.accessToken
3637
AuthService.setToken(accessToken)
3738
setUser(res.data.user)
@@ -48,11 +49,20 @@ const Register = () => {
4849

4950
<TextInput
5051
id='name'
51-
label='Name'
52-
placeholder={'Your name or your team/organisation\'s name'}
52+
label='Team name'
53+
placeholder={'Your team\'s name'}
5354
type='text'
54-
onChange={setName}
55-
value={name}
55+
onChange={setOrganisationName}
56+
value={organisationName}
57+
/>
58+
59+
<TextInput
60+
id='username'
61+
label='Username'
62+
type='text'
63+
placeholder='Your name or a screen name'
64+
onChange={setUsername}
65+
value={username}
5666
/>
5767

5868
<TextInput
@@ -76,7 +86,7 @@ const Register = () => {
7686
{error && <ErrorMessage error={error} />}
7787

7888
<Button
79-
disabled={!name || !email || !password}
89+
disabled={!organisationName || !username || !email || !password}
8090
onClick={onRegisterClick}
8191
isLoading={isLoading}
8292
>

0 commit comments

Comments
 (0)