Skip to content

Commit 047a61c

Browse files
authored
fix: subscriptions header (#4933)
1 parent d4155d8 commit 047a61c

File tree

4 files changed

+32
-9
lines changed

4 files changed

+32
-9
lines changed

src/writeData/subscriptions/components/BrokerDetails.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
position: fixed;
88
background-color: $cf-grey-5;
99
background-attachment: fixed;
10-
width: 61%;
11-
z-index: 9999;
10+
z-index: 10;
1211
padding-bottom: 20px;
1312

1413
&__broker-buttons {

src/writeData/subscriptions/components/BrokerDetails.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Libraries
2-
import React, {FC} from 'react'
2+
import React, {FC, useContext} from 'react'
33
import {useHistory} from 'react-router-dom'
44
import {useSelector} from 'react-redux'
55

@@ -27,6 +27,7 @@ import BrokerFormContent from 'src/writeData/subscriptions/components/BrokerForm
2727
// Utils
2828
import {getOrg} from 'src/organizations/selectors'
2929
import {event} from 'src/cloud/utils/reporting'
30+
import {AppSettingContext} from 'src/shared/contexts/app'
3031

3132
// Types
3233
import {SUBSCRIPTIONS, LOAD_DATA} from 'src/shared/constants/routes'
@@ -56,11 +57,18 @@ const BrokerDetails: FC<Props> = ({
5657
}) => {
5758
const history = useHistory()
5859
const org = useSelector(getOrg)
60+
const {navbarMode} = useContext(AppSettingContext)
61+
const navbarOpen = navbarMode === 'expanded'
5962
return (
6063
<div className="update-broker-form" id="broker">
6164
<SpinnerContainer spinnerComponent={<TechnoSpinner />} loading={loading}>
6265
<Form onSubmit={() => {}} testID="update-broker-form-overlay">
63-
<div className="update-broker-form__fixed">
66+
<div
67+
className="update-broker-form__fixed"
68+
style={{
69+
width: navbarOpen ? '61%' : '69%',
70+
}}
71+
>
6472
<FlexBox
6573
className="update-broker-form__fixed__broker-buttons"
6674
direction={FlexDirection.Row}

src/writeData/subscriptions/components/BrokerForm.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
position: fixed;
88
background-color: $cf-grey-5;
99
background-attachment: fixed;
10-
width: 61%;
11-
z-index: 9999;
10+
z-index: 10;
1211
padding-bottom: 20px;
12+
right: 0;
1313

1414
&__broker-buttons {
1515
padding-top: 46px;
@@ -34,6 +34,11 @@
3434
.cf-overlay--header {
3535
justify-content: unset;
3636
}
37+
38+
&__broker-header {
39+
padding-top: 150px;
40+
margin-bottom: 25px;
41+
}
3742
.cf-select-group.cf-select-group__stretch {
3843
margin-bottom: $cf-space-l;
3944
}

src/writeData/subscriptions/components/BrokerForm.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Libraries
2-
import React, {FC} from 'react'
2+
import React, {FC, useContext} from 'react'
33
import {useHistory} from 'react-router-dom'
44
import {useSelector} from 'react-redux'
55

@@ -35,6 +35,7 @@ import {
3535
getDataLayerIdentity,
3636
getExperimentVariantId,
3737
} from 'src/cloud/utils/experiments'
38+
import {AppSettingContext} from 'src/shared/contexts/app'
3839

3940
// Constants
4041
import {CREDIT_250_EXPERIMENT_ID} from 'src/shared/constants'
@@ -61,11 +62,18 @@ const BrokerForm: FC<Props> = ({formContent, updateForm, saveForm}) => {
6162
!isFlagEnabled('enableFreeSubscriptions')
6263
const isCredit250ExperienceActive = useSelector(shouldGetCredit250Experience)
6364
const requiredFields = checkRequiredFields(formContent)
65+
const {navbarMode} = useContext(AppSettingContext)
66+
const navbarOpen = navbarMode === 'expanded'
6467
return (
6568
formContent && (
6669
<div className="create-broker-form" id="broker">
6770
<Form onSubmit={() => {}} testID="create-broker-form-overlay">
68-
<div className="create-broker-form__fixed">
71+
<div
72+
className="create-broker-form__fixed"
73+
style={{
74+
width: navbarOpen ? 'calc(75% - 235px)' : 'calc(100% - 374px)',
75+
}}
76+
>
6977
<FlexBox
7078
className="create-broker-form__fixed__broker-buttons"
7179
direction={FlexDirection.Row}
@@ -135,7 +143,10 @@ const BrokerForm: FC<Props> = ({formContent, updateForm, saveForm}) => {
135143
)}
136144
</FlexBox>
137145
</div>
138-
<Overlay.Header title="Connect to Broker"></Overlay.Header>
146+
<Overlay.Header
147+
className="create-broker-form__broker-header"
148+
title="Connect to Broker"
149+
></Overlay.Header>
139150
<Overlay.Body>
140151
<Heading
141152
element={HeadingElement.H5}

0 commit comments

Comments
 (0)