File tree Expand file tree Collapse file tree 6 files changed +57
-61
lines changed
redisinsight/ui/src/pages
vector-search/components/commands-view/CommandsView Expand file tree Collapse file tree 6 files changed +57
-61
lines changed Original file line number Diff line number Diff line change
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
+ `
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
- import cx from 'classnames'
3
2
import { useParams } from 'react-router-dom'
4
3
5
4
import { CodeButtonParams } from 'uiSrc/constants'
@@ -15,7 +14,11 @@ import { ProgressBarLoader } from 'uiSrc/components/base/display'
15
14
import { collectTelemetryQueryReRun } from 'uiSrc/pages/vector-search/telemetry'
16
15
import QueryCard from '../../QueryCard'
17
16
18
- import styles from './styles.module.scss'
17
+ import {
18
+ StyledContainer ,
19
+ StyledHeader ,
20
+ StyledWrapper ,
21
+ } from './CommandsView.styles'
19
22
20
23
export interface Props {
21
24
isResultsLoaded : boolean
@@ -80,25 +83,24 @@ const CommandsView = (props: Props) => {
80
83
}
81
84
82
85
return (
83
- < div className = { styles . wrapper } >
86
+ < StyledWrapper >
84
87
{ ! isResultsLoaded && (
85
88
< ProgressBarLoader color = "primary" data-testid = "progress-wb-history" />
86
89
) }
87
90
{ ! ! items ?. length && (
88
- < div className = { styles . header } >
91
+ < StyledHeader >
89
92
< EmptyButton
90
93
size = "small"
91
94
icon = { DeleteIcon }
92
- className = { styles . clearAllBtn }
93
95
onClick = { ( ) => onAllQueriesDelete ?.( ) }
94
96
disabled = { clearing || processing }
95
97
data-testid = "clear-history-btn"
96
98
>
97
99
Clear Results
98
100
</ EmptyButton >
99
- </ div >
101
+ </ StyledHeader >
100
102
) }
101
- < div className = { cx ( styles . container ) } >
103
+ < StyledContainer >
102
104
< div ref = { scrollDivRef } />
103
105
{ items ?. length
104
106
? items . map (
@@ -161,8 +163,8 @@ const CommandsView = (props: Props) => {
161
163
)
162
164
: null }
163
165
{ isResultsLoaded && ! items . length && ( noResultsPlaceholder ?? null ) }
164
- </ div >
165
- </ div >
166
+ </ StyledContainer >
167
+ </ StyledWrapper >
166
168
)
167
169
}
168
170
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
.container {
13
13
display : flex ;
14
14
flex-direction : column ;
15
- padding : 8 px 16px ;
15
+ padding : 16px ;
16
16
width : 100% ;
17
17
height : 100% ;
18
18
word-break : break-word ;
21
21
background-color : var (--rsInputWrapperColor );
22
22
color : var (--euiTextSubduedColor ) !important ;
23
23
border : 1px solid var (--euiColorLightShade );
24
+ border-radius : var (--border-radius-medium );
24
25
}
25
26
26
27
.disabled {
62
63
align-items : center ;
63
64
justify-content : space-between ;
64
65
65
- margin-top : 8 px ;
66
+ margin-top : 16 px ;
66
67
flex-shrink : 0 ;
67
68
}
68
69
Original file line number Diff line number Diff line change 1
1
.wrapper {
2
2
flex : 1 ;
3
- height : 100% ;
3
+ height : calc ( 100% - var ( --border-radius-medium )) ;
4
4
width : 100% ;
5
5
background-color : var (--euiColorEmptyShade );
6
6
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 );
7
10
8
11
display : flex ;
9
12
flex-direction : column ;
Original file line number Diff line number Diff line change 19
19
width : 100% ;
20
20
}
21
21
22
- .queryResults {
23
- & > div {
24
- border-bottom-width : 0 ;
25
- }
26
- }
27
-
28
22
:global(.show-cli ) {
29
23
.queryResults {
30
24
& > div {
You can’t perform that action at this time.
0 commit comments