Skip to content

Commit f1fda9c

Browse files
committed
move the custom horizontal rule to styles.ts file
1 parent a1c37d7 commit f1fda9c

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import styled from 'styled-components'
2+
3+
export const CustomHorizontalRule = styled.div`
4+
margin: 12px 0;
5+
width: 100%;
6+
text-align: center;
7+
position: relative;
8+
9+
&:before,
10+
&:after {
11+
content: '';
12+
display: block;
13+
width: 47%;
14+
height: 1px;
15+
background: ${({ theme }: { theme: Theme }) =>
16+
theme.semantic.color.background.neutral500};
17+
position: absolute;
18+
top: 50%;
19+
}
20+
21+
&:after {
22+
right: 0;
23+
}
24+
`

redisinsight/ui/src/pages/home/components/add-database-screen/AddDatabaseScreen.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { useFormik } from 'formik'
33
import { useDispatch, useSelector } from 'react-redux'
44
import { useHistory } from 'react-router'
55
import { toNumber } from 'lodash'
6-
import styled from 'styled-components'
7-
import { Theme } from '@redis-ui/styles'
86

97
import { Nullable, parseRedisUrl } from 'uiSrc/utils'
108
import { AddDbType, DEFAULT_TIMEOUT } from 'uiSrc/pages/home/constants'
@@ -27,29 +25,7 @@ import { RiTooltip } from 'uiSrc/components'
2725
import ConnectivityOptions from './components/connectivity-options'
2826
import ConnectionUrl from './components/connection-url'
2927
import { Values } from './constants'
30-
31-
const CustomHorizontalRule = styled.div`
32-
margin: 12px 0;
33-
width: 100%;
34-
text-align: center;
35-
position: relative;
36-
37-
&:before,
38-
&:after {
39-
content: '';
40-
display: block;
41-
width: 47%;
42-
height: 1px;
43-
background: ${({ theme }: { theme: Theme }) =>
44-
theme.semantic.color.background.neutral500};
45-
position: absolute;
46-
top: 50%;
47-
}
48-
49-
&:after {
50-
right: 0;
51-
}
52-
`
28+
import { CustomHorizontalRule } from './AddDatabaseScreen.styles'
5329

5430
export interface Props {
5531
onSelectOption: (type: AddDbType, db: Nullable<Record<string, any>>) => void

0 commit comments

Comments
 (0)