mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
Update dependency react-bootstrap to v1.2.1 (#320)
* Update dependency react-bootstrap to v1.2.1 * Fixed sort-button event name With the upgrade to Bootstrap-React 1.2.1 the ButtonProps extend now React.HTMLAttributes which in favor extends the DOMAttributes interface. This interface defines almost every possible attribute for DOM-/HTML-elements. Our SortButtonProps interface introduced an onChange event handler with a type matching our condition. With the BS-React upgrade the onChange event must not be redefined/overriden with this type and therefore I renamed it. * updated react-bootstrap to 1.2.2 * fixed wrong prop name in HistoryToolbar Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Erik Michelson <github@erik.michelson.eu> Co-authored-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
12bd76a8c1
commit
1a5d4f6db8
4 changed files with 48 additions and 18 deletions
|
@ -22,7 +22,7 @@ const getIcon = (direction: SortModeEnum): IconName => {
|
|||
}
|
||||
|
||||
export interface SortButtonProps extends ButtonProps {
|
||||
onChange: (direction: SortModeEnum) => void
|
||||
onDirectionChange: (direction: SortModeEnum) => void
|
||||
direction: SortModeEnum
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,9 @@ const toggleDirection = (direction: SortModeEnum) => {
|
|||
}
|
||||
}
|
||||
|
||||
export const SortButton: React.FC<SortButtonProps> = ({ children, variant, onChange, direction }) => {
|
||||
export const SortButton: React.FC<SortButtonProps> = ({ children, variant, onDirectionChange, direction }) => {
|
||||
const toggleSort = () => {
|
||||
onChange(toggleDirection(direction))
|
||||
onDirectionChange(toggleDirection(direction))
|
||||
}
|
||||
|
||||
return <IconButton onClick={toggleSort} variant={variant} icon={getIcon(direction)}>{children}</IconButton>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue