Skip to content

Commit

Permalink
Activate service worker and add a refresh menu item.
Browse files Browse the repository at this point in the history
  • Loading branch information
uncaught committed Apr 11, 2020
1 parent 31ed8f6 commit d731a49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ ReactDOM.render(
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://create-react-app.dev/docs/making-a-progressive-web-app/
serviceWorker.unregister();
serviceWorker.register();
11 changes: 9 additions & 2 deletions client/src/pages/groups/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import React, {ReactElement} from 'react';
import AddGroup from './AddGroup';
import {Divider} from 'semantic-ui-react';
import {Divider, Icon, Menu} from 'semantic-ui-react';
import MyGroups from './MyGroups';
import {Switch} from 'react-router-dom';
import Page from '../../Page';
import Group from '../group';
import CashInvitation from './CashInvitation';

function ForceReloadMenuItem(): ReactElement {
return <Menu.Item onClick={async () => window.location.reload()}>
<Icon name='refresh'/>
Seite neu laden
</Menu.Item>;
}

export default function GroupsIndex(): ReactElement {
return <Switch>
<Page path={`/group/:groupId`} displayName={'Gruppe'}>
<Group/>
</Page>
<Page path={'/'}>
<Page path={'/'} menuItems={[ForceReloadMenuItem]}>
<MyGroups/>
<Divider section/>
<AddGroup/>
Expand Down

0 comments on commit d731a49

Please sign in to comment.