diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-09-09 09:01:37 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-09-09 09:01:37 -0500 |
| commit | 3549cb7677f49de0b28d8b4a0b192b2e45a0fcee (patch) | |
| tree | adac507f116fa40d77d5b7884dafd858dd666411 /src/web | |
| parent | 25ad4f7c4b03636e7126af7f15d37ccf2bc08ced (diff) | |
| download | slskd-3549cb7677f49de0b28d8b4a0b192b2e45a0fcee.tar.gz | |
refine version update modal
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/App.js | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index a461cd60..2f2cab7d 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -19,7 +19,8 @@ import { Menu, Icon, Modal, - Header + Header, + Button } from 'semantic-ui-react'; import Rooms from './Rooms/Rooms'; import ErrorSegment from './Shared/ErrorSegment'; @@ -128,7 +129,8 @@ class App extends Component { render = () => { const { token, login, applicationState = {}, error } = this.state; - const { server, updateAvailable } = applicationState + const { version = {}, server } = applicationState; + const { isUpdateAvailable, current, latest } = version; return ( <> @@ -198,18 +200,28 @@ class App extends Component { <Icon name='close' color='red' corner='bottom right' className='menu-icon-no-shadow'/> </Icon.Group>Disconnected </Menu.Item>} - {<Modal + {isUpdateAvailable && <Modal trigger={<Menu.Item position='right'> <Icon.Group className='menu-icon-group'> - <Icon name='exclamation circle' color={updateAvailable && 'yellow'}/> - </Icon.Group>Notifications + <Icon name='bullhorn' color='yellow'/> + </Icon.Group>New Version! </Menu.Item>} centered + closeIcon size='mini' - header={<Header icon='exclamation circle' content='Notifications'/>} - content='A new version is available!' - actions={['Ok']} - />} + > + <Modal.Header>New Version!</Modal.Header> + <Modal.Content> + <p>You are currently running version <strong>{current}</strong> while version <strong>{latest}</strong> is available.</p> + </Modal.Content> + <Modal.Actions> + <Button + style={{marginLeft: 0}} + primary + fluid + href="https://github.com/slskd/slskd/releases">See Release Notes</Button> + </Modal.Actions> + </Modal>} {token !== tokenPassthroughValue && <Modal trigger={ <Menu.Item> |
