Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export {
GoogleSigninIcon,
SsoIcon,
GithubIcon,
RedisLogoDarkMinIcon,
} from '@redis-ui/icons/multicolor'

// Common icons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import React from 'react'

import { RiSideBarItemIconProps, StyledIcon } from './sidebar-item-icon.styles'

export const SideBarItemIcon = (props: RiSideBarItemIconProps) => (
<StyledIcon {...props} />
export const SideBarItemIcon = ({centered, ...props}: RiSideBarItemIconProps) => (
<StyledIcon {...props} $centered={centered} />
)
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
import { SideBar } from '@redis-ui/components'
import styled, { css } from 'styled-components'
import styled from 'styled-components'

export type RiSideBarItemIconProps = Omit<
React.ComponentProps<typeof SideBar.Item.Icon>,
'width' | 'height'
> & {
width?: string
height?: string
centered?: boolean
}

export const StyledIcon = styled(SideBar.Item.Icon)<RiSideBarItemIconProps>`
${({ width = 'inherit' }) => css`
export const StyledIcon = styled(SideBar.Item.Icon)<RiSideBarItemIconProps & {
$centered?: boolean
}>`
${({ width = 'inherit' }) => `
width: ${width};
`}
${({ height = 'inherit' }) => css`
${({ height = 'inherit' }) => `
height: ${height};
`}
${({ $centered }) => $centered && `
justify-content: center;
align-items: center;
`}
`
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import cx from 'classnames'
import React from 'react'
import { useSelector } from 'react-redux'

Expand All @@ -12,22 +11,38 @@ import {
import { getRouterLinkProps } from 'uiSrc/services'
import { Pages } from 'uiSrc/constants'
import { Link } from 'uiSrc/components/base/link/Link'
import LogoSVG from 'uiSrc/assets/img/logo_small.svg?react'
import styles from '../../styles.module.scss'
import { RedisLogoDarkMinIcon } from 'uiSrc/components/base/icons'
import styled from 'styled-components'

type Props = {
isRdiWorkspace: boolean
}

const RedisLogoIcon = styled.span`
height: 60px;
width: 100%;
@media only screen and (min-width: 768px) {
height: 72px;
}
svg {
width: 30px;
height: 34px;
}
`

export const RedisLogo = ({ isRdiWorkspace }: Props) => {
const { envDependent } = useSelector(appFeatureFlagsFeaturesSelector)
const { server } = useSelector(appInfoSelector)

if (!envDependent?.flag) {
return (
<span className={cx(styles.iconNavItem, styles.homeIcon)}>
<SideBarItemIcon aria-label="Redis Insight Homepage" icon={LogoSVG} />
</span>
<RedisLogoIcon>
<SideBarItemIcon height="50px" width="50px"
aria-label="Redis Insight Homepage"
icon={RedisLogoDarkMinIcon}
centered
/>
</RedisLogoIcon>
)
}

Expand All @@ -49,7 +64,7 @@ export const RedisLogo = ({ isRdiWorkspace }: Props) => {
}}
style={{ marginBlock: '2rem', marginInline: 'auto' }}
>
<SideBarItemIcon icon={LogoSVG} />
<SideBarItemIcon icon={RedisLogoDarkMinIcon} />
</SideBarItem>
</Link>
)
Expand Down
Loading