Skip to content

Commit 55d162e

Browse files
authored
Ri-0000 fix recommendations styles (#4833)
* fix FilterKeyType.tsx dropdown display * fix scan more * fix vote option link (button) styles * fix recommendation styles * fix LiveTimeRecommendations.tsx styles
1 parent 31deddc commit 55d162e

File tree

5 files changed

+137
-97
lines changed

5 files changed

+137
-97
lines changed

redisinsight/ui/src/components/recommendation/recommendation-voting/components/vote-option/VoteOption.tsx

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,39 @@ import { Nullable } from 'uiSrc/utils'
1515
import { Col, FlexItem, Row } from 'uiSrc/components/base/layout/flex'
1616
import { Text } from 'uiSrc/components/base/text'
1717
import { CancelSlimIcon } from 'uiSrc/components/base/icons'
18-
import { IconButton, PrimaryButton } from 'uiSrc/components/base/forms/buttons'
18+
import { IconButton } from 'uiSrc/components/base/forms/buttons'
1919
import { Link } from 'uiSrc/components/base/link/Link'
2020
import { RiPopover, RiTooltip } from 'uiSrc/components/base'
2121
import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
2222

2323
import { getVotedText, iconType, voteTooltip } from './utils'
2424
import styles from './styles.module.scss'
25+
import styled from 'styled-components'
26+
import { Theme } from 'uiSrc/components/base/theme/types'
27+
28+
const GitHubLink = styled(Link)`
29+
padding: 4px 8px 4px 4px;
30+
31+
margin-top: 10px;
32+
height: 22px !important;
33+
background-color: ${({ theme }: { theme: Theme }) =>
34+
theme.components.button.variants.primary.normal?.bgColor};
35+
color: ${({ theme }: { theme: Theme }) =>
36+
theme.components.button.variants.primary.normal?.textColor};
37+
&:hover {
38+
text-decoration: none !important;
39+
background-color: ${({ theme }: { theme: Theme }) =>
40+
theme.components.button.variants.primary.hover?.bgColor};
41+
color: ${({ theme }: { theme: Theme }) =>
42+
theme.components.button.variants.primary.normal?.textColor};
43+
}
44+
45+
& > span {
46+
display: flex;
47+
gap: 4px;
48+
align-items: center;
49+
}
50+
`
2551

2652
export interface Props {
2753
voteOption: Vote
@@ -148,28 +174,22 @@ const VoteOption = (props: Props) => {
148174
</Row>
149175
</FlexItem>
150176
<FlexItem grow>
151-
<PrimaryButton
152-
aria-label="recommendation feedback"
177+
<GitHubLink
153178
data-testid="recommendation-feedback-btn"
154-
className={styles.feedbackBtn}
155-
size="s"
179+
className={styles.link}
180+
href={EXTERNAL_LINKS.recommendationFeedback}
181+
target="_blank"
182+
data-test-subj="github-repo-link"
156183
>
157-
<Link
158-
className={styles.link}
159-
href={EXTERNAL_LINKS.recommendationFeedback}
160-
target="_blank"
161-
data-test-subj="github-repo-link"
162-
>
163-
<RiIcon
164-
className={styles.githubIcon}
165-
aria-label="redis insight github issues"
166-
type="GithubIcon"
167-
color="informative100"
168-
data-testid="github-repo-icon"
169-
/>
170-
To Github
171-
</Link>
172-
</PrimaryButton>
184+
<RiIcon
185+
className={styles.githubIcon}
186+
aria-label="redis insight github issues"
187+
type="GithubIcon"
188+
color="informative100"
189+
data-testid="github-repo-icon"
190+
/>
191+
To Github
192+
</GitHubLink>
173193
</FlexItem>
174194
</Col>
175195
</div>

redisinsight/ui/src/components/scan-more/ScanMore.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const ScanMore = ({
4040
size="s"
4141
style={style ?? { marginLeft: 25, height: 26 }}
4242
disabled={loading}
43-
className={styles.btn}
4443
onClick={() =>
4544
loadMoreItems?.({
4645
stopIndex: SCAN_COUNT_DEFAULT - 1,
@@ -50,7 +49,11 @@ const ScanMore = ({
5049
data-testid="scan-more"
5150
>
5251
{withAlert && (
53-
<RiTooltip content={WARNING_MESSAGE} position="top">
52+
<RiTooltip
53+
content={WARNING_MESSAGE}
54+
position="top"
55+
anchorClassName={styles.anchor}
56+
>
5457
<RiIcon type="InfoIcon" />
5558
</RiTooltip>
5659
)}
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.btn {
2-
:global(.euiButtonContent .euiButton__text) {
3-
font: normal normal normal 12px/18px Graphik, sans-serif !important;
4-
letter-spacing: -0.12px;
5-
}
6-
7-
svg {
8-
margin-bottom: 2px;
9-
margin-right: 6px;
10-
}
1+
.anchor {
2+
display: inline-flex;
3+
align-items: center;
4+
justify-content: center;
5+
margin-right: var(--size-s);
116
}

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

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
22
import { useDispatch, useSelector } from 'react-redux'
33
import { useHistory, useParams } from 'react-router-dom'
44
import { remove } from 'lodash'
5+
import styled from 'styled-components'
56

67
import { FeatureFlags, DEFAULT_DELIMITER, Pages } from 'uiSrc/constants'
78
import {
@@ -35,11 +36,28 @@ import { ColorText, Text } from 'uiSrc/components/base/text'
3536
import { Checkbox } from 'uiSrc/components/base/forms/checkbox/Checkbox'
3637

3738
import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
38-
import { Link } from 'uiSrc/components/base/link/Link'
3939
import Recommendation from './components/recommendation'
4040
import WelcomeScreen from './components/welcome-screen'
4141
import PopoverRunAnalyze from './components/popover-run-analyze'
4242
import styles from './styles.module.scss'
43+
import { Row } from 'uiSrc/components/base/layout/flex'
44+
import { Spacer } from 'uiSrc/components/base/layout'
45+
46+
const FooterLink = styled.button<{
47+
onClick?: () => void;
48+
'data-testid'?: string;
49+
children?: React.ReactNode;
50+
}>`
51+
font:
52+
normal normal 400 12px/14px Graphik,
53+
sans-serif !important;
54+
padding: 2px 0 0;
55+
margin: 0;
56+
text-decoration: underline !important;
57+
:hover {
58+
text-decoration: none !important;
59+
}
60+
`
4361

4462
const LiveTimeRecommendations = () => {
4563
const { provider, connectionType } = useSelector(connectedInstanceSelector)
@@ -137,25 +155,26 @@ const LiveTimeRecommendations = () => {
137155

138156
const renderHeader = () => (
139157
<div className={styles.actions}>
140-
<div>
141-
<ColorText className={styles.boldText}>Our Tips</ColorText>
158+
<Row align="center" gap="s">
159+
<ColorText variant="semiBold" className={styles.boldText}>
160+
Our Tips
161+
</ColorText>
142162
<RiTooltip
143163
position="bottom"
144164
className={styles.tooltip}
145-
anchorClassName={styles.tooltipAnchor}
146165
content={
147-
<>
166+
<Text size="s">
148167
Tips will help you improve your database.
149-
<br />
168+
<Spacer size="s" />
150169
New tips appear while you work with your database, including how
151170
to improve performance and optimize memory usage.
152171
<FeatureFlagComponent name={FeatureFlags.envDependent}>
153172
<>
154-
<br />
173+
<Spacer size="s" />
155174
Eager for more tips? Run Database Analysis to get started.
156175
</>
157176
</FeatureFlagComponent>
158-
</>
177+
</Text>
159178
}
160179
>
161180
<RiIcon
@@ -166,10 +185,9 @@ const LiveTimeRecommendations = () => {
166185
/>
167186
</RiTooltip>
168187
<FeatureFlagComponent name={FeatureFlags.envDependent}>
169-
<Link
188+
<a
170189
href={EXTERNAL_LINKS.githubRepo}
171190
target="_blank"
172-
style={{ marginLeft: 6 }}
173191
data-testid="github-repo-btn"
174192
>
175193
<RiIcon
@@ -179,9 +197,9 @@ const LiveTimeRecommendations = () => {
179197
size="s"
180198
data-testid="github-repo-icon"
181199
/>
182-
</Link>
200+
</a>
183201
</FeatureFlagComponent>
184-
</div>
202+
</Row>
185203

186204
{isShowHiddenDisplayed && (
187205
<Checkbox
@@ -230,13 +248,12 @@ const LiveTimeRecommendations = () => {
230248
: ANALYZE_TOOLTIP_MESSAGE
231249
}
232250
>
233-
<Link
234-
className={styles.link}
251+
<FooterLink
235252
onClick={() => setIsShowApproveRun(true)}
236253
data-testid="footer-db-analysis-link"
237254
>
238255
Database Analysis
239-
</Link>
256+
</FooterLink>
240257
</PopoverRunAnalyze>
241258
{' to get more tips'}
242259
</Text>

0 commit comments

Comments
 (0)