Skip to content

Commit fe1ffff

Browse files
committed
refactor(ui): rework external link component
- change the display mode to inline-flex, so it does alignproperly when rendered with icon re #RI-7415
1 parent 6ee4f28 commit fe1ffff

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import styled from 'styled-components'
2+
import { Link } from '../link/Link'
3+
4+
export const StyledExternalLink = styled(Link)`
5+
display: inline-flex;
6+
`

redisinsight/ui/src/components/base/external-link/ExternalLink.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react'
22
import { IconProps } from 'uiSrc/components/base/icons'
33
import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
4-
import { Link, type RiLinkProps } from 'uiSrc/components/base/link/Link'
4+
import { type RiLinkProps } from 'uiSrc/components/base/link/Link'
5+
import { StyledExternalLink } from './ExternalLink.styles'
56

67
export type Props = RiLinkProps & {
78
href: string
@@ -30,11 +31,11 @@ const ExternalLink = (props: Props) => {
3031
)
3132

3233
return (
33-
<Link {...rest} target="_blank" rel="noopener noreferrer">
34+
<StyledExternalLink {...rest} target="_blank" rel="noopener noreferrer">
3435
{iconPosition === 'left' && <ArrowIcon />}
3536
{children}
3637
{iconPosition === 'right' && <ArrowIcon />}
37-
</Link>
38+
</StyledExternalLink>
3839
)
3940
}
4041

redisinsight/ui/src/components/base/external-link/styles.module.scss

Lines changed: 0 additions & 3 deletions
This file was deleted.

redisinsight/ui/src/components/notifications/components/infinite-messages/InfiniteMessages.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,7 @@ export const INFINITE_MESSAGES: InfiniteMessagesType = {
165165
<Spacer size="m" />
166166
<Row justify="between" align="center">
167167
<FlexItem>
168-
<ExternalLink
169-
href={MANAGE_DB_LINK}
170-
iconSize="S"
171-
variant="inline"
172-
style={{ display: 'inline-flex' }}
173-
>
168+
<ExternalLink href={MANAGE_DB_LINK} iconSize="S" variant="inline">
174169
Manage DB
175170
</ExternalLink>
176171
</FlexItem>

0 commit comments

Comments
 (0)