Skip to content

Commit 80d9b39

Browse files
committed
fix tips header alignment
1 parent 75deac0 commit 80d9b39

File tree

4 files changed

+20
-29
lines changed

4 files changed

+20
-29
lines changed

redisinsight/ui/src/components/side-panels/components/insights-panel/InsightsPanel.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useMemo } from 'react'
22
import { useDispatch, useSelector } from 'react-redux'
33
import { useParams } from 'react-router-dom'
44
import { Header } from 'uiSrc/components/side-panels/components'
5-
import styles from 'uiSrc/components/side-panels/styles.module.scss'
65
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
76
import EnablementAreaWrapper from 'uiSrc/components/side-panels/panels/enablement-area'
87
import LiveTimeRecommendations from 'uiSrc/components/side-panels/panels/live-time-recommendations'
@@ -19,6 +18,8 @@ import {
1918
TELEMETRY_EMPTY_VALUE,
2019
TelemetryEvent,
2120
} from 'uiSrc/telemetry'
21+
import { Col } from 'uiSrc/components/base/layout/flex'
22+
import styles from 'uiSrc/components/side-panels/styles.module.scss'
2223

2324
export interface Props {
2425
isFullScreen: boolean
@@ -93,7 +94,7 @@ const InsightsPanel = (props: Props) => {
9394
<span className={styles.title}>Insights</span>
9495
</div>
9596
</Header>
96-
<div className={styles.body}>
97+
<Col className={styles.body}>
9798
<Tabs
9899
tabs={tabs}
99100
value={tabSelected}
@@ -105,7 +106,7 @@ const InsightsPanel = (props: Props) => {
105106
{tabSelected === InsightsPanelTabs.Recommendations && (
106107
<LiveTimeRecommendations />
107108
)}
108-
</div>
109+
</Col>
109110
</>
110111
)
111112
}

redisinsight/ui/src/components/side-panels/panels/live-time-recommendations/LiveTimeRecommendations.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
3939
import Recommendation from './components/recommendation'
4040
import WelcomeScreen from './components/welcome-screen'
4141
import PopoverRunAnalyze from './components/popover-run-analyze'
42-
import styles from './styles.module.scss'
4342
import { Row } from 'uiSrc/components/base/layout/flex'
4443
import { Spacer } from 'uiSrc/components/base/layout'
44+
import { Link } from 'uiSrc/components/base/link/Link'
45+
46+
import styles from './styles.module.scss'
4547

4648
const FooterLink = styled.button<{
4749
onClick?: () => void
@@ -154,14 +156,13 @@ const LiveTimeRecommendations = () => {
154156
}
155157

156158
const renderHeader = () => (
157-
<div className={styles.actions}>
158-
<Row align="center" gap="s">
159-
<ColorText variant="semiBold" className={styles.boldText}>
160-
Our Tips
161-
</ColorText>
159+
<Row align="center" justify="between" className={styles.actions}>
160+
<Row align="center" gap="m">
161+
<ColorText variant="semiBold">Our Tips</ColorText>
162162
<RiTooltip
163163
position="bottom"
164164
className={styles.tooltip}
165+
anchorClassName={styles.tooltipAnchor}
165166
content={
166167
<Text size="s">
167168
Tips will help you improve your database.
@@ -180,12 +181,14 @@ const LiveTimeRecommendations = () => {
180181
<RiIcon
181182
className={styles.infoIcon}
182183
type="InfoIcon"
183-
size="s"
184+
size="m"
184185
data-testid="recommendations-info-icon"
185186
/>
186187
</RiTooltip>
187188
<FeatureFlagComponent name={FeatureFlags.envDependent}>
188-
<a
189+
<Link
190+
variant="inline"
191+
size="M"
189192
href={EXTERNAL_LINKS.githubRepo}
190193
target="_blank"
191194
data-testid="github-repo-btn"
@@ -197,7 +200,7 @@ const LiveTimeRecommendations = () => {
197200
size="m"
198201
data-testid="github-repo-icon"
199202
/>
200-
</a>
203+
</Link>
201204
</FeatureFlagComponent>
202205
</Row>
203206

@@ -213,7 +216,7 @@ const LiveTimeRecommendations = () => {
213216
aria-label="checkbox show hidden"
214217
/>
215218
)}
216-
</div>
219+
</Row>
217220
)
218221

219222
return (

redisinsight/ui/src/components/side-panels/panels/live-time-recommendations/styles.module.scss

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,22 @@ $animation-duration: 300ms;
8181
}
8282

8383
.actions {
84-
display: flex;
85-
align-items: center;
8684
background: var(--browserTableRowEven);
8785
padding: 8px 16px;
88-
justify-content: space-between;
89-
90-
.boldText {
91-
font:
92-
normal normal 500 14px/17px Graphik,
93-
sans-serif !important;
94-
}
9586

9687
.githubIcon {
9788
color: var(--htmlColor);
9889
}
9990

10091
.infoIcon {
101-
width: 16px !important;
102-
height: 16px !important;
10392
fill: var(--htmlColor);
10493
cursor: pointer;
10594
}
10695

10796
.tooltipAnchor {
108-
margin-left: 6px;
97+
svg {
98+
vertical-align: middle;
99+
}
109100
}
110101
}
111102

redisinsight/ui/src/components/side-panels/styles.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ $animation-duration: 300ms;
3636

3737
.body {
3838
height: calc(100% - 60px);
39-
display: flex;
40-
flex-direction: column;
4139
}
4240

4341
.trigger {
@@ -112,10 +110,8 @@ $animation-duration: 300ms;
112110
}
113111

114112
.tabs {
115-
display: flex;
116113
flex-shrink: 0 !important;
117114
overflow: initial !important;
118-
align-items: center;
119115
flex-grow: 0;
120116

121117
& > div {

0 commit comments

Comments
 (0)