diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-06-02 09:27:41 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-06-02 09:27:41 -0500 |
| commit | aeb48015536ee347b91798a637c8e993a4889fd2 (patch) | |
| tree | 7702bcbe214b8c2faa243223fcdf81f9d35e7182 /src | |
| parent | a1af7d575d8c20677626b3b2234985a0b2f48bae (diff) | |
| download | slskd-aeb48015536ee347b91798a637c8e993a4889fd2.tar.gz | |
add image placeholder, basic stats
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/components/Users/User.js | 42 | ||||
| -rw-r--r-- | src/web/src/components/Users/Users.css | 11 |
2 files changed, 43 insertions, 10 deletions
diff --git a/src/web/src/components/Users/User.js b/src/web/src/components/Users/User.js index 2e597201..be1d6443 100644 --- a/src/web/src/components/Users/User.js +++ b/src/web/src/components/Users/User.js @@ -1,8 +1,13 @@ import { Item, - Image + Icon, + Divider, + Button } from 'semantic-ui-react'; +const ImagePlaceholder = () => + (<div className='users-picture-placeholder ui small image'><Icon name='camera' size='big'/></div>); + const User = ({ username, description, @@ -14,16 +19,33 @@ const User = ({ updatedAt, fetching }) => ( - <Item> - <Item.Image size='small' src={`data:image;base64,${picture}`} /> + <> + <Item> + {hasPicture ? + <Item.Image size='small' src={`data:image;base64,${picture}`} /> + : <ImagePlaceholder/>} + + <Item.Content> + <Item.Header as='a'>{username}</Item.Header> + <Item.Meta> + Free Upload Slot: <Icon + name={hasFreeUploadSlot ? 'check' : 'close'} + color={hasFreeUploadSlot ? 'green' : 'red'} + />, Total Upload Slots: {uploadSlots}, Queue Length: {queueLength} + </Item.Meta> + <Item.Description> + {description || 'No user info.'} + </Item.Description> + <div className='users-statistics'> - <Item.Content> - <Item.Header as='a'>{username}</Item.Header> - <Item.Description> - {description} - </Item.Description> - </Item.Content> - </Item> + </div> + </Item.Content> + </Item> + <Divider/> + <div> + <Button>Force Refresh</Button> + </div> + </> ); export default User;
\ No newline at end of file diff --git a/src/web/src/components/Users/Users.css b/src/web/src/components/Users/Users.css index a5c7b048..29e31f48 100644 --- a/src/web/src/components/Users/Users.css +++ b/src/web/src/components/Users/Users.css @@ -22,4 +22,15 @@ .users-user { margin-top: 15px !important; min-height: 78px; +} + +.users-picture-placeholder { + text-align: center; + padding-top: 10px !important; + opacity: .125; +} + +.ui.items > .item > .content > .description { + white-space: pre-wrap; + margin-top: 15px; }
\ No newline at end of file |
