-
Notifications
You must be signed in to change notification settings - Fork 419
RI-7224 - in messages - ACK / CLAIM buttons need space between #4769
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
KIvanow
merged 1 commit into
fe/feature/RI-7039-replace-eui
from
fe/feature/RI-7224---in-messages---ACK-/-CLAIM-buttons-need-space-between
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
redisinsight/ui/src/components/base/layout/horizontal-spacer/HorizontalSpacer.spec.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import React from 'react' | ||
| import { render } from 'uiSrc/utils/test-utils' | ||
| import { HorizontalSpacer } from './horizontal-spacer' | ||
|
|
||
| describe('HorizontalSpacer', () => { | ||
| it('should render with different sizes correctly', () => { | ||
| const sizes = ['xs', 's', 'm', 'l', 'xl', 'xxl'] as const | ||
|
|
||
| sizes.forEach(size => { | ||
| const { container } = render(<HorizontalSpacer size={size} />) | ||
| const spacer = container.querySelector('.RI-horizontal-spacer') as HTMLElement | ||
|
|
||
| if (size === 'xl') { | ||
| expect(spacer).toHaveStyle('width: calc(var(--base) * 2.25)') | ||
| } else { | ||
| expect(spacer).toHaveStyle(`width: var(--size-${size})`) | ||
| } | ||
| }) | ||
| }) | ||
|
|
||
| it('should render children when provided', () => { | ||
| const { getByText } = render( | ||
| <HorizontalSpacer size="s"> | ||
| <span>Test content</span> | ||
| </HorizontalSpacer> | ||
| ) | ||
| const content = getByText('Test content') | ||
| expect(content).toBeInTheDocument() | ||
| expect(content.parentElement).toHaveStyle('width: var(--size-s)') | ||
| }) | ||
|
|
||
| it('should apply custom className', () => { | ||
| const { container } = render(<HorizontalSpacer className="custom-class" />) | ||
| const spacer = container.querySelector('.RI-horizontal-spacer') as HTMLElement | ||
|
|
||
| expect(spacer).toHaveClass('RI-horizontal-spacer') | ||
| expect(spacer).toHaveClass('custom-class') | ||
| }) | ||
|
|
||
| it('should pass through custom props', () => { | ||
| const { container } = render( | ||
| <HorizontalSpacer data-testid="my-spacer" id="spacer-id" /> | ||
| ) | ||
| const spacer = container.querySelector('.RI-horizontal-spacer') as HTMLElement | ||
|
|
||
| expect(spacer).toHaveAttribute('data-testid', 'my-spacer') | ||
| expect(spacer).toHaveAttribute('id', 'spacer-id') | ||
| }) | ||
| }) |
26 changes: 26 additions & 0 deletions
26
redisinsight/ui/src/components/base/layout/horizontal-spacer/horizontal-spacer.styles.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { HTMLAttributes, ReactNode } from 'react' | ||
| import styled from 'styled-components' | ||
| import { CommonProps } from 'uiSrc/components/base/theme/types' | ||
|
|
||
| export const HorizontalSpacerSizes = ['xs', 's', 'm', 'l', 'xl', 'xxl'] as const | ||
| export type HorizontalSpacerSize = (typeof HorizontalSpacerSizes)[number] | ||
| export type HorizontalSpacerProps = CommonProps & | ||
| HTMLAttributes<HTMLDivElement> & { | ||
| children?: ReactNode | ||
| size?: HorizontalSpacerSize | ||
| } | ||
|
|
||
| export const horizontalSpacerStyles = { | ||
| xs: 'var(--size-xs)', | ||
| s: 'var(--size-s)', | ||
| m: 'var(--size-m)', | ||
| l: 'var(--size-l)', | ||
| xl: 'calc(var(--base) * 2.25)', | ||
| xxl: 'var(--size-xxl)', | ||
| } | ||
|
|
||
| export const StyledHorizontalSpacer = styled.div<HorizontalSpacerProps>` | ||
| flex-shrink: 0; | ||
| width: ${({ size = 'l' }) => horizontalSpacerStyles[size]}; | ||
| display: inline-block; | ||
| ` |
12 changes: 12 additions & 0 deletions
12
redisinsight/ui/src/components/base/layout/horizontal-spacer/horizontal-spacer.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import React from 'react' | ||
| import cx from 'classnames' | ||
| import { | ||
| HorizontalSpacerProps, | ||
| StyledHorizontalSpacer, | ||
| } from './horizontal-spacer.styles' | ||
|
|
||
| export const HorizontalSpacer = ({ className, children, ...rest }: HorizontalSpacerProps) => ( | ||
| <StyledHorizontalSpacer {...rest} className={cx('RI-horizontal-spacer', className)}> | ||
| {children} | ||
| </StyledHorizontalSpacer> | ||
| ) |
2 changes: 2 additions & 0 deletions
2
redisinsight/ui/src/components/base/layout/horizontal-spacer/index.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { HorizontalSpacer } from './horizontal-spacer' | ||
| export type { HorizontalSpacerSize, HorizontalSpacerProps } from './horizontal-spacer.styles' |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.