11import React from 'react'
2- import styled from 'styled-components'
32
43import { AddDbType } from 'uiSrc/pages/home/constants'
54import { FeatureFlagComponent , OAuthSsoHandlerDialog } from 'uiSrc/components'
65import { getUtmExternalLink } from 'uiSrc/utils/links'
76import { EXTERNAL_LINKS , UTM_CAMPAINGS } from 'uiSrc/constants/links'
87import { FeatureFlags } from 'uiSrc/constants'
98import { OAuthSocialAction , OAuthSocialSource } from 'uiSrc/slices/interfaces'
10-
11- // to be replaced with cloud icon from @redis -ui/icons once redis-ui bumped
12- import CloudIcon from 'uiSrc/assets/img/oauth/cloud_centered.svg?react'
13- import { RocketIcon } from 'uiSrc/components/base/icons'
14-
15- import { Col , FlexItem , Grid } from 'uiSrc/components/base/layout/flex'
9+ import { Col , FlexItem , Grid , Row } from 'uiSrc/components/base/layout/flex'
1610import { Spacer } from 'uiSrc/components/base/layout/spacer'
17- import { SecondaryButton } from 'uiSrc/components/base/forms/buttons'
18- import { RiBadge } from 'uiSrc/components/base/display/badge/RiBadge'
1911import { Text } from 'uiSrc/components/base/text/Text'
20- import { Link } from 'uiSrc/components/base/link/Link '
12+ import { RiIcon } from 'uiSrc/components/base/icons '
2113import { CONNECTIVITY_OPTIONS } from '../../constants'
2214
23- import styles from './styles.module.scss'
15+ import {
16+ StyledBadge ,
17+ StyledConnectivityLink ,
18+ StyledIcon ,
19+ } from './ConnectivityOptions.styles'
2420
2521export interface Props {
2622 onClickOption : ( type : AddDbType ) => void
2723 onClose ?: ( ) => void
2824}
2925
30- const NewCloudLink = styled ( Link ) `
31- min-width: 160px;
32- display: flex;
33- align-items: center;
34- justify-content: center;
35- text-decoration: none !important;
36- & * {
37- text-decoration: none !important;
38- }
39- position: relative;
40- width: 100%;
41- height: 84px !important;
42- padding: 0 12px;
43- border: 1px solid ${ ( { theme } ) => theme . semantic . color . border . primary500 } ;
44- border-radius: 5px;
45-
46- & .freeBadge {
47- position: absolute;
48- top: 10px;
49- left: 10px;
50-
51- text-transform: uppercase;
52- border-radius: 3px;
53- }
54-
55- & .btnIcon {
56- margin-bottom: 8px;
57- width: 30px;
58- height: 30px;
59- }
60- `
61-
6226const ConnectivityOptions = ( props : Props ) => {
6327 const { onClickOption, onClose } = props
6428
6529 return (
6630 < >
67- < section className = { styles . cloudSection } >
31+ < section >
6832 < Text color = "primary" > Get started with Redis Cloud account</ Text >
6933 < Spacer />
7034 < Grid gap = "l" columns = { 3 } responsive >
7135 < FlexItem >
72- < SecondaryButton
73- className = { styles . typeBtn }
36+ < StyledConnectivityLink
7437 onClick = { ( ) => onClickOption ( AddDbType . cloud ) }
7538 data-testid = "discover-cloud-btn"
7639 >
77- < Col align = "center" >
78- < CloudIcon />
79- Add databases
40+ < Col align = "center" gap = "s" >
41+ < StyledIcon type = " CloudIcon" size = "xl" />
42+ < Text color = "primary" > Add databases</ Text >
8043 </ Col >
81- </ SecondaryButton >
44+ </ StyledConnectivityLink >
8245 </ FlexItem >
8346 < FeatureFlagComponent name = { FeatureFlags . cloudAds } >
8447 < FlexItem >
8548 < OAuthSsoHandlerDialog >
8649 { ( ssoCloudHandlerClick , isSSOEnabled ) => (
87- < NewCloudLink
50+ < StyledConnectivityLink
8851 data-testid = "create-free-db-btn"
8952 color = "primary"
9053 onClick = { ( e : React . MouseEvent ) => {
@@ -99,17 +62,16 @@ const ConnectivityOptions = (props: Props) => {
9962 } ) }
10063 target = "_blank"
10164 >
102- < RiBadge className = "freeBadge" label = "Free " variant = "notice" />
103- < Col align = "center" >
104- < RocketIcon className = "btnIcon " />
105- New database
65+ < StyledBadge label = "FREE " variant = "notice" />
66+ < Col align = "center" gap = "s" >
67+ < StyledIcon type = " RocketIcon" size = "xl " />
68+ < Text color = "primary" > New database</ Text >
10669 </ Col >
107- </ NewCloudLink >
70+ </ StyledConnectivityLink >
10871 ) }
10972 </ OAuthSsoHandlerDialog >
11073 </ FlexItem >
11174 </ FeatureFlagComponent >
112- < FlexItem grow />
11375 </ Grid >
11476 </ section >
11577 < Spacer size = "xxl" />
@@ -119,14 +81,15 @@ const ConnectivityOptions = (props: Props) => {
11981 < Grid gap = "l" responsive columns = { 3 } >
12082 { CONNECTIVITY_OPTIONS . map ( ( { id, type, title, icon } ) => (
12183 < FlexItem key = { id } >
122- < SecondaryButton
123- icon = { icon }
84+ < StyledConnectivityLink
12485 onClick = { ( ) => onClickOption ( type ) }
12586 data-testid = { `option-btn-${ id } ` }
126- size = "large"
12787 >
128- { title }
129- </ SecondaryButton >
88+ < Row gap = "s" align = "center" justify = "center" >
89+ < RiIcon type = { icon } size = "xl" />
90+ < Text color = "primary" > { title } </ Text >
91+ </ Row >
92+ </ StyledConnectivityLink >
13093 </ FlexItem >
13194 ) ) }
13295 </ Grid >
0 commit comments