mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
Markmap make mouse input toggle (#655)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
0670cddb0b
commit
c1d4ac1014
3 changed files with 59 additions and 2 deletions
20
src/components/common/lock-button/lock-button.tsx
Normal file
20
src/components/common/lock-button/lock-button.tsx
Normal file
|
@ -0,0 +1,20 @@
|
|||
import React from 'react'
|
||||
import { Button } from 'react-bootstrap'
|
||||
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
|
||||
|
||||
export interface LockButtonProps {
|
||||
locked: boolean,
|
||||
onLockedChanged: (newState: boolean) => void
|
||||
title: string
|
||||
}
|
||||
|
||||
export const LockButton: React.FC<LockButtonProps> = ({ locked, onLockedChanged, title }) => {
|
||||
return (
|
||||
<Button variant='dark' size='sm' onClick={() => onLockedChanged(!locked)} title={title}>
|
||||
{ locked
|
||||
? <ForkAwesomeIcon icon='lock'/>
|
||||
: <ForkAwesomeIcon icon='unlock'/>
|
||||
}
|
||||
</Button>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue