Skip to content

RI-7244 -Edit-and-remove-buttons-are-not-aligned #4786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions redisinsight/ui/src/components/base/forms/buttons/EmptyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,44 @@ import React from 'react'
import { TextButton } from '@redis-ui/components'
import { ButtonIcon } from 'uiSrc/components/base/forms/buttons/Button'
import { IconType } from 'uiSrc/components/base/icons'
import { Row } from '../../layout/flex'
import { FlexProps } from '../../layout/flex/flex.styles'

export type ButtonProps = React.ComponentProps<typeof TextButton> & {
icon?: IconType
iconSide?: 'left' | 'right'
loading?: boolean
size?: 'small' | 'large' | 'medium'
justify?: FlexProps['justify']
}
export const EmptyButton = ({
children,
icon,
iconSide = 'left',
loading,
size = 'small',
justify = 'center',
...rest
}: ButtonProps) => (
<TextButton {...rest}>
<ButtonIcon
buttonSide="left"
icon={icon}
iconSide={iconSide}
loading={loading}
size={size}
/>
{children}
<ButtonIcon
buttonSide="right"
icon={icon}
iconSide={iconSide}
loading={loading}
size={size}
/>
<Row
justify={justify}
>
<ButtonIcon
buttonSide="left"
icon={icon}
iconSide={iconSide}
loading={loading}
size={size}
/>
{children}
<ButtonIcon
buttonSide="right"
icon={icon}
iconSide={iconSide}
loading={loading}
size={size}
/>
</Row>
</TextButton>
)
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ const DatabasesListWrapper = (props: Props) => {
<div className="controlsPopoverContent">
<div>
<EmptyButton
justify="start"
icon={EditIcon}
className="editInstanceBtn"
aria-label="Edit instance"
Expand Down
Loading