-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: fix expander bug Signed-off-by: Carina Ursu <[email protected]> * chore: add await everywhere Signed-off-by: Carina Ursu <[email protected]> --------- Signed-off-by: Carina Ursu <[email protected]>
- Loading branch information
1 parent
d11850c
commit 6a48658
Showing
6 changed files
with
66 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 27 additions & 18 deletions
45
packages/console/src/components/Executions/Tables/RowExpander.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
import * as React from 'react'; | ||
import { IconButton } from '@material-ui/core'; | ||
import ChevronRight from '@material-ui/icons/ChevronRight'; | ||
import ExpandMore from '@material-ui/icons/ExpandMore'; | ||
import * as React from 'react'; | ||
import t from './strings'; | ||
|
||
/** A simple expand/collapse arrow to be rendered next to row items. */ | ||
export const RowExpander: React.FC<{ | ||
interface RowExpanderProps { | ||
expanded: boolean; | ||
key?: string; | ||
onClick: () => void; | ||
}> = ({ expanded, onClick }) => ( | ||
<IconButton | ||
disableRipple={true} | ||
disableTouchRipple={true} | ||
size="small" | ||
title={t('expanderTitle', expanded)} | ||
onClick={(e: React.MouseEvent<HTMLElement>) => { | ||
// prevent the parent row body onClick event trigger | ||
e.stopPropagation(); | ||
onClick(); | ||
}} | ||
> | ||
{expanded ? <ExpandMore /> : <ChevronRight />} | ||
</IconButton> | ||
); | ||
} | ||
/** A simple expand/collapse arrow to be rendered next to row items. */ | ||
export const RowExpander = React.forwardRef< | ||
HTMLButtonElement, | ||
RowExpanderProps | ||
>(({ expanded, key, onClick }, ref) => { | ||
return ( | ||
<IconButton | ||
key={key} | ||
ref={ref} | ||
disableRipple={true} | ||
disableTouchRipple={true} | ||
size="small" | ||
title={t('expanderTitle', expanded)} | ||
onClick={(e: React.MouseEvent<HTMLElement>) => { | ||
// prevent the parent row body onClick event trigger | ||
e.stopPropagation(); | ||
onClick(); | ||
}} | ||
> | ||
{expanded ? <ExpandMore /> : <ChevronRight />} | ||
</IconButton> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters