Skip to content

Commit 579b31c

Browse files
KIvanowpd-redis
andauthored
RI-7244 -Edit-and-remove-buttons-are-not-aligned (#4786)
* RI-7244 -Edit-and-remove-buttons-are-not-aligned * Update redisinsight/ui/src/components/base/forms/buttons/EmptyButton.tsx Co-authored-by: pd-redis <[email protected]> * Update redisinsight/ui/src/components/base/forms/buttons/EmptyButton.tsx Co-authored-by: pd-redis <[email protected]> --------- Co-authored-by: pd-redis <[email protected]>
1 parent 22d55f1 commit 579b31c

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

redisinsight/ui/src/components/base/forms/buttons/EmptyButton.tsx

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,44 @@ import React from 'react'
22
import { TextButton } from '@redis-ui/components'
33
import { ButtonIcon } from 'uiSrc/components/base/forms/buttons/Button'
44
import { IconType } from 'uiSrc/components/base/icons'
5+
import { Row } from '../../layout/flex'
6+
import { FlexProps } from '../../layout/flex/flex.styles'
57

68
export type ButtonProps = React.ComponentProps<typeof TextButton> & {
79
icon?: IconType
810
iconSide?: 'left' | 'right'
911
loading?: boolean
1012
size?: 'small' | 'large' | 'medium'
13+
justify?: FlexProps['justify']
1114
}
1215
export const EmptyButton = ({
1316
children,
1417
icon,
1518
iconSide = 'left',
1619
loading,
1720
size = 'small',
21+
justify = 'center',
1822
...rest
1923
}: ButtonProps) => (
2024
<TextButton {...rest}>
21-
<ButtonIcon
22-
buttonSide="left"
23-
icon={icon}
24-
iconSide={iconSide}
25-
loading={loading}
26-
size={size}
27-
/>
28-
{children}
29-
<ButtonIcon
30-
buttonSide="right"
31-
icon={icon}
32-
iconSide={iconSide}
33-
loading={loading}
34-
size={size}
35-
/>
25+
<Row
26+
justify={justify}
27+
>
28+
<ButtonIcon
29+
buttonSide="left"
30+
icon={icon}
31+
iconSide={iconSide}
32+
loading={loading}
33+
size={size}
34+
/>
35+
{children}
36+
<ButtonIcon
37+
buttonSide="right"
38+
icon={icon}
39+
iconSide={iconSide}
40+
loading={loading}
41+
size={size}
42+
/>
43+
</Row>
3644
</TextButton>
3745
)

redisinsight/ui/src/pages/home/components/database-list-component/DatabasesListWrapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ const DatabasesListWrapper = (props: Props) => {
619619
<div className="controlsPopoverContent">
620620
<div>
621621
<EmptyButton
622+
justify="start"
622623
icon={EditIcon}
623624
className="editInstanceBtn"
624625
aria-label="Edit instance"

0 commit comments

Comments
 (0)