Skip to content

Commit

Permalink
added example env
Browse files Browse the repository at this point in the history
  • Loading branch information
anaxita committed Sep 27, 2022
1 parent 8d6cb27 commit 0d30a25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.env
/.vscode
/.idea

# dependencies
/node_modules
Expand Down
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_API_URL=1.1.1.1
7 changes: 5 additions & 2 deletions src/components/Auth/Auth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export const Auth = () => {

setState(newState)
}
const signIn = () => {
const signIn = (e) => {
e.preventDefault()
e.stopPropagation()

setState({...state, isLoading: true})
handleFetch('POST', '/signin', state.data).then(({data, err}) => {

Expand Down Expand Up @@ -65,7 +68,7 @@ export const Auth = () => {
</div>
<div className="modal-footer">
{state.isLoading ? <button type="button" className="btn" disabled><SpinnerBtn/> Войти</button> :
<button type="button" className="btn" onClick={signIn}>Войти</button>}
<button type="submit" className="btn" onClick={signIn}>Войти</button>}
{error ? <Error err={error}/> : null}
</div>
</div>
Expand Down

0 comments on commit 0d30a25

Please sign in to comment.