Skip to content

Commit cf34065

Browse files
authored
RI-7294: Fix borders style (#4834)
1 parent 1c4ac32 commit cf34065

File tree

6 files changed

+57
-61
lines changed

6 files changed

+57
-61
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import styled from 'styled-components'
2+
3+
/* TODO: use theme when it supports theme.semantic.core.radius */
4+
// to replace var(--border-radius-medium)
5+
export const StyledWrapper = styled.div`
6+
flex: 1;
7+
height: calc(100% - var(--border-radius-medium));
8+
width: 100%;
9+
background-color: ${({ theme }) =>
10+
theme.semantic?.color.background.neutral100};
11+
border: 1px solid ${({ theme }) => theme.semantic.color.border.neutral500};
12+
border-radius: var(--border-radius-medium);
13+
// HACK: to fix rectangle like view in rounded borders wrapper
14+
padding-bottom: ${({ theme }) => theme.core.space.space050};
15+
16+
display: flex;
17+
flex-direction: column;
18+
19+
position: relative;
20+
`
21+
22+
export const StyledContainer = styled.div`
23+
flex: 1;
24+
width: 100%;
25+
overflow: auto;
26+
color: ${({ theme }) => theme.color.gray700};
27+
`
28+
29+
export const StyledHeader = styled.div`
30+
height: 42px;
31+
display: flex;
32+
align-items: center;
33+
justify-content: flex-end;
34+
padding: 0 ${({ theme }) => theme.core.space.space150};
35+
36+
flex-shrink: 0;
37+
border-bottom: 1px solid
38+
${({ theme }) => theme.semantic.color.border.neutral500};
39+
`

redisinsight/ui/src/pages/vector-search/components/commands-view/CommandsView/CommandsView.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react'
2-
import cx from 'classnames'
32
import { useParams } from 'react-router-dom'
43

54
import { CodeButtonParams } from 'uiSrc/constants'
@@ -15,7 +14,11 @@ import { ProgressBarLoader } from 'uiSrc/components/base/display'
1514
import { collectTelemetryQueryReRun } from 'uiSrc/pages/vector-search/telemetry'
1615
import QueryCard from '../../QueryCard'
1716

18-
import styles from './styles.module.scss'
17+
import {
18+
StyledContainer,
19+
StyledHeader,
20+
StyledWrapper,
21+
} from './CommandsView.styles'
1922

2023
export interface Props {
2124
isResultsLoaded: boolean
@@ -80,25 +83,24 @@ const CommandsView = (props: Props) => {
8083
}
8184

8285
return (
83-
<div className={styles.wrapper}>
86+
<StyledWrapper>
8487
{!isResultsLoaded && (
8588
<ProgressBarLoader color="primary" data-testid="progress-wb-history" />
8689
)}
8790
{!!items?.length && (
88-
<div className={styles.header}>
91+
<StyledHeader>
8992
<EmptyButton
9093
size="small"
9194
icon={DeleteIcon}
92-
className={styles.clearAllBtn}
9395
onClick={() => onAllQueriesDelete?.()}
9496
disabled={clearing || processing}
9597
data-testid="clear-history-btn"
9698
>
9799
Clear Results
98100
</EmptyButton>
99-
</div>
101+
</StyledHeader>
100102
)}
101-
<div className={cx(styles.container)}>
103+
<StyledContainer>
102104
<div ref={scrollDivRef} />
103105
{items?.length
104106
? items.map(
@@ -161,8 +163,8 @@ const CommandsView = (props: Props) => {
161163
)
162164
: null}
163165
{isResultsLoaded && !items.length && (noResultsPlaceholder ?? null)}
164-
</div>
165-
</div>
166+
</StyledContainer>
167+
</StyledWrapper>
166168
)
167169
}
168170

redisinsight/ui/src/pages/vector-search/components/commands-view/CommandsView/styles.module.scss

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

redisinsight/ui/src/pages/workbench/components/query/Query/styles.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
.container {
1313
display: flex;
1414
flex-direction: column;
15-
padding: 8px 16px;
15+
padding: 16px;
1616
width: 100%;
1717
height: 100%;
1818
word-break: break-word;
@@ -21,6 +21,7 @@
2121
background-color: var(--rsInputWrapperColor);
2222
color: var(--euiTextSubduedColor) !important;
2323
border: 1px solid var(--euiColorLightShade);
24+
border-radius: var(--border-radius-medium);
2425
}
2526

2627
.disabled {
@@ -62,7 +63,7 @@
6263
align-items: center;
6364
justify-content: space-between;
6465

65-
margin-top: 8px;
66+
margin-top: 16px;
6667
flex-shrink: 0;
6768
}
6869

redisinsight/ui/src/pages/workbench/components/wb-results/WBResults/styles.module.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
.wrapper {
22
flex: 1;
3-
height: 100%;
3+
height: calc(100% - var(--border-radius-medium));
44
width: 100%;
55
background-color: var(--euiColorEmptyShade);
66
border: 1px solid var(--euiColorLightShade);
7+
border-radius: var(--border-radius-medium);
8+
// HACK: to fix rectangle like view in rounded borders wrapper
9+
padding-bottom: var(--border-radius-medium);
710

811
display: flex;
912
flex-direction: column;

redisinsight/ui/src/pages/workbench/components/wb-view/WBView/styles.module.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
width: 100%;
2020
}
2121

22-
.queryResults {
23-
& > div {
24-
border-bottom-width: 0;
25-
}
26-
}
27-
2822
:global(.show-cli) {
2923
.queryResults {
3024
& > div {

0 commit comments

Comments
 (0)