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:
renovate[bot] 2020-07-15 23:34:34 +02:00 committed by GitHub
parent 12bd76a8c1
commit 1a5d4f6db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 18 deletions

View file

@ -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>

View file

@ -97,11 +97,11 @@ export const HistoryToolbar: React.FC<HistoryToolbarProps> = ({ onSettingsChange
/>
</InputGroup>
<InputGroup className={'mr-1 mb-1'}>
<SortButton onChange={titleSortChanged} direction={state.titleSortDirection} variant={'light'}><Trans
<SortButton onDirectionChange={titleSortChanged} direction={state.titleSortDirection} variant={'light'}><Trans
i18nKey={'landing.history.toolbar.sortByTitle'}/></SortButton>
</InputGroup>
<InputGroup className={'mr-1 mb-1'}>
<SortButton onChange={lastVisitedSortChanged} direction={state.lastVisitedSortDirection}
<SortButton onDirectionChange={lastVisitedSortChanged} direction={state.lastVisitedSortDirection}
variant={'light'}><Trans i18nKey={'landing.history.toolbar.sortByLastVisited'}/></SortButton>
</InputGroup>
<InputGroup className={'mr-1 mb-1'}>