|
@@ -3,14 +3,17 @@ import * as action from '../../actions'
|
|
import { useState, useEffect, useCallback } from 'react';
|
|
import { useState, useEffect, useCallback } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { connect } from 'react-redux';
|
|
import { Link } from 'react-router-dom';
|
|
import { Link } from 'react-router-dom';
|
|
-import { history, backendURL } from '../../App';
|
|
|
|
|
|
+import { backendURL } from '../../App';
|
|
import { useDropzone } from 'react-dropzone'
|
|
import { useDropzone } from 'react-dropzone'
|
|
|
|
+import { faPlus, faBan, faSignOutAlt, faUpload} from "@fortawesome/free-solid-svg-icons";
|
|
|
|
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
|
|
const LogoutBtn = ({ onLogout }) =>
|
|
const LogoutBtn = ({ onLogout }) =>
|
|
- <div
|
|
|
|
- style={{ border: '1px solid black', backgroundColor: 'red', color: 'white' }}
|
|
|
|
- onClick={() => { onLogout(); history.push('/login') }}
|
|
|
|
- >log-out[X]</div>
|
|
|
|
|
|
+ <Link
|
|
|
|
+ to='/login'
|
|
|
|
+ className='sidebar__link highlightRed'
|
|
|
|
+ onClick={() => onLogout()}
|
|
|
|
+ >LOG-OUT <FontAwesomeIcon icon={faSignOutAlt}/></Link>
|
|
|
|
|
|
export const LogoutBtnConnect = connect(null, { onLogout: action.actionAuthLogout })(LogoutBtn)
|
|
export const LogoutBtnConnect = connect(null, { onLogout: action.actionAuthLogout })(LogoutBtn)
|
|
|
|
|
|
@@ -22,12 +25,9 @@ const ProfileWindow = ({ user }) => {
|
|
}, [user, userInfo])
|
|
}, [user, userInfo])
|
|
|
|
|
|
return (
|
|
return (
|
|
- <section>
|
|
|
|
|
|
+ <section >
|
|
<h3>{userInfo?.login || 'user'}</h3>
|
|
<h3>{userInfo?.login || 'user'}</h3>
|
|
<img
|
|
<img
|
|
- width={150}
|
|
|
|
- height={'auto'}
|
|
|
|
- style={{ border: '1px solid black', display: 'block', margin: '5% auto', marginBottom: '2px' }}
|
|
|
|
src={userInfo?.avatar?.url ? backendURL + '/' + userInfo?.avatar?.url : ''}
|
|
src={userInfo?.avatar?.url ? backendURL + '/' + userInfo?.avatar?.url : ''}
|
|
alt='avatar'
|
|
alt='avatar'
|
|
/>
|
|
/>
|
|
@@ -43,10 +43,13 @@ const ProfileWindowDropzone = ({ onLoad }) => {
|
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop })
|
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop })
|
|
|
|
|
|
return (
|
|
return (
|
|
- <div {...getRootProps()} style={isDragActive ? { border: '1px solid mediumseagreen' } : { border: '1px solid black' }}>
|
|
|
|
|
|
+ <div {...getRootProps()}
|
|
|
|
+ className='sidebar__profile'
|
|
|
|
+ style={isDragActive ? { backgroundColor: '#0e6147' } : { backgroundColor: 'transparent' }}
|
|
|
|
+ >
|
|
<input {...getInputProps()} />
|
|
<input {...getInputProps()} />
|
|
<ProfileWindowConnect />
|
|
<ProfileWindowConnect />
|
|
- {isDragActive ? <small>drag here...</small> : <small>change avatar</small>}
|
|
|
|
|
|
+ {isDragActive ? <small>drop here...</small> : <small>change avatar</small>}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -59,7 +62,7 @@ const UserTracksBtn = ({ userId }) => {
|
|
setId(userId)
|
|
setId(userId)
|
|
}, [userId])
|
|
}, [userId])
|
|
|
|
|
|
- return (<Link to={`/player/tracks/:${_id}`} className='sidebar__link highlight'>MY UPLOADS</Link>)
|
|
|
|
|
|
+ return (<Link to={`/player/tracks/:${_id}`} className='sidebar__link highlightYellow'>MY UPLOADS <FontAwesomeIcon icon={faUpload}/></Link>)
|
|
}
|
|
}
|
|
export const UserTracksBtnConnect = connect(state => ({ userId: state.promise.userData?.payload?._id || '' }))(UserTracksBtn)
|
|
export const UserTracksBtnConnect = connect(state => ({ userId: state.promise.userData?.payload?._id || '' }))(UserTracksBtn)
|
|
|
|
|
|
@@ -75,24 +78,24 @@ const PlaylistAdd = ({ addPlaylist }) => {
|
|
onClick={() => setClicked(true)}
|
|
onClick={() => setClicked(true)}
|
|
>NEW PLAYLIST</button>
|
|
>NEW PLAYLIST</button>
|
|
:
|
|
:
|
|
- <div style={{ width: '95%', margin: '0 auto' }}>
|
|
|
|
|
|
+ <div className='sidebar__addpanel'>
|
|
<input
|
|
<input
|
|
- style={{ width: '72%', padding: '5px' }}
|
|
|
|
- placeholder='Playlist name'
|
|
|
|
|
|
+ placeholder='NEW PLATLIST NAME'
|
|
value={name}
|
|
value={name}
|
|
onChange={(e) => setName(e.target.value)}
|
|
onChange={(e) => setName(e.target.value)}
|
|
/>
|
|
/>
|
|
|
|
+ <div className='sidebar__addpanel btnWrapper'>
|
|
|
|
+ <button
|
|
|
|
+ disabled={!name}
|
|
|
|
+ className='highlightGreen'
|
|
|
|
+ onClick={() => { addPlaylist(name); setClicked(false); setName(''); }}
|
|
|
|
+ ><FontAwesomeIcon icon={faPlus} /></button>
|
|
|
|
|
|
- <button
|
|
|
|
- disabled={!name}
|
|
|
|
- style={{ padding: '5px', backgroundColor: 'mediumseagreen' }}
|
|
|
|
- onClick={() => { addPlaylist(name); setClicked(false); setName(''); }}
|
|
|
|
- >+</button>
|
|
|
|
-
|
|
|
|
- <button
|
|
|
|
- style={{ padding: '5px', backgroundColor: 'red' }}
|
|
|
|
- onClick={() => { setClicked(false); setName('') }}
|
|
|
|
- >X</button>
|
|
|
|
|
|
+ <button
|
|
|
|
+ className='highlightRed'
|
|
|
|
+ onClick={() => { setClicked(false); setName('') }}
|
|
|
|
+ ><FontAwesomeIcon icon={faBan} /></button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|