Skip to content
Snippets Groups Projects
Unverified Commit bdf5c45c authored by Compositr's avatar Compositr Committed by GitHub
Browse files

Sync on ctrl+s (#1770)

parent 3dfe6334
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ import Link from './common/Link';
import Paragraph from './common/Paragraph';
import Text from './common/Text';
import View from './common/View';
import { KeyHandlers } from './KeyHandlers';
import LoggedInUser from './LoggedInUser';
import { useServerURL } from './ServerContext';
import { useSidebar } from './sidebar';
......@@ -173,30 +174,40 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) {
: {};
return (
<Button
type="bare"
style={{
...style,
WebkitAppRegion: 'none',
color: isMobile ? mobileColor : desktopColor,
}}
hoveredStyle={activeStyle}
activeStyle={activeStyle}
onClick={sync}
>
{syncState === 'error' ? (
<AlertTriangle width={13} />
) : (
<AnimatedRefresh animating={syncing} />
)}
<Text style={{ marginLeft: 3 }}>
{syncState === 'disabled'
? 'Disabled'
: syncState === 'offline'
? 'Offline'
: 'Sync'}
</Text>
</Button>
<>
<KeyHandlers
keys={{
'ctrl+s, cmd+s': () => {
sync();
},
}}
/>
<Button
type="bare"
style={{
...style,
WebkitAppRegion: 'none',
color: isMobile ? mobileColor : desktopColor,
}}
hoveredStyle={activeStyle}
activeStyle={activeStyle}
onClick={sync}
>
{syncState === 'error' ? (
<AlertTriangle width={13} />
) : (
<AnimatedRefresh animating={syncing} />
)}
<Text style={{ marginLeft: 3 }}>
{syncState === 'disabled'
? 'Disabled'
: syncState === 'offline'
? 'Offline'
: 'Sync'}
</Text>
</Button>
</>
);
}
......
---
category: Enhancements
authors: [Compositr, shaankhosla]
---
Sync on Ctrl+S
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment