-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mikołaj Burdzy <[email protected]>
- Loading branch information
Showing
10 changed files
with
115 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import '../App.scss' | ||
import './UserButtons.scss'; | ||
import logoutIcon from '../resources/logout.svg'; | ||
import userIcon from '../resources/user.svg'; | ||
import settingsIcon from '../resources/settings.svg'; | ||
import { connect } from 'react-redux'; | ||
import { login, logout } from './actions'; | ||
import {Link} from "react-router-dom"; | ||
|
||
function UserButtons({ isAuthenticated, user, login, logout }) { | ||
//takie chwilowe bo nie ma jak z bakcu pobrać loginu i elo bo oba są querowane po player_id którego nie mamy, issue do omówienia na spotkaniu | ||
const huj = '{' | ||
const huj1 = '}' | ||
return ( | ||
<> | ||
{isAuthenticated ? ( | ||
<div className="user-bar"> | ||
<div>{huj}Login{huj1} {huj}Elo{huj1}</div> | ||
<div className="user-buttons-container"> | ||
<Link to="/settings"> | ||
<img className="user-button setting-button" src={settingsIcon} alt="S"></img> | ||
</Link> | ||
<Link to="/player/1"> | ||
<img className="user-button" src={userIcon} alt="U"></img> | ||
</Link> | ||
<Link to="/"> | ||
<img className="user-button" src={logoutIcon} alt="U" onClick={logout}></img> | ||
</Link> | ||
</div> | ||
</div> | ||
) : ( | ||
<> | ||
|
||
</> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
const mapStateToProps = (state) => ({ | ||
isAuthenticated: state.isAuthenticated, | ||
user: state.user, | ||
}); | ||
|
||
const mapDispatchToProps = {login,logout,}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(UserButtons); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.user-bar{ | ||
display: flex; | ||
justify-content: space-between; | ||
border-bottom: 3px solid #24da00; | ||
width: 100vw; | ||
margin-left: -15px; | ||
padding: 10px 25px 15px 20px; | ||
align-items: center; | ||
|
||
.user-buttons-container{ | ||
display: flex; | ||
justify-content: flex-end; | ||
a{ display: flex; | ||
align-items: center;} | ||
|
||
.user-button{ | ||
width: 65px; | ||
height: 65px; | ||
padding: 6px; | ||
margin-right: 10px; | ||
border-radius: 50%; | ||
border: 2px solid #24da00; | ||
text-align: center; | ||
} | ||
.setting-button{ | ||
padding:0; | ||
} | ||
} | ||
} | ||
@media (max-width:578px) { | ||
.user-bar{flex-direction: column; | ||
gap: 20px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.