Skip to content

Commit 4cadc4a

Browse files
fix: Account page header alignment for multi account (#3760)
1 parent 331329f commit 4cadc4a

File tree

3 files changed

+47
-44
lines changed

3 files changed

+47
-44
lines changed

src/accounts/AccountPage.tsx

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
UserAccountProvider,
2020
} from 'src/accounts/context/userAccount'
2121
import AccountTabContainer from 'src/accounts/AccountTabContainer'
22+
import AccountHeader from 'src/accounts/AccountHeader'
2223

2324
import {SwitchAccountOverlay} from 'src/accounts/SwitchAccountOverlay'
2425

@@ -64,53 +65,52 @@ const AccountAboutPage: FC = () => {
6465
const labelStyle = {marginBottom: 8}
6566

6667
return (
67-
<Page titleTag={pageTitleSuffixer(['About', 'Account'])}>
68-
<AccountTabContainer activeTab="about">
69-
<>
70-
{userAccounts && userAccounts.length >= 2 && (
71-
<React.Fragment>
72-
<Button
73-
text="Switch Account"
74-
icon={IconFont.Switch_New}
75-
onClick={showSwitchAccountDialog}
76-
testID="user-account-switch-btn"
77-
/>
78-
<hr />
79-
</React.Fragment>
80-
)}
81-
82-
<h2 data-testid="account-settings--header"> Account Details </h2>
83-
<div style={labelStyle}>Account Name</div>
84-
<FlexBox direction={FlexDirection.Row} margin={ComponentSize.Medium}>
85-
<Input
86-
name="accountName"
87-
testID="input--active-account-name"
88-
type={InputType.Text}
89-
value={activeAcctName}
90-
onChange={updateAcctName}
91-
size={ComponentSize.Medium}
92-
style={inputStyle}
93-
/>
68+
<AccountTabContainer activeTab="about">
69+
<>
70+
{userAccounts && userAccounts.length >= 2 && (
71+
<React.Fragment>
9472
<Button
95-
onClick={() =>
96-
handleRenameActiveAccount(activeAccount.id, activeAcctName)
97-
}
98-
testID="rename-account--button"
99-
text="Save"
73+
text="Switch Account"
74+
icon={IconFont.Switch_New}
75+
onClick={showSwitchAccountDialog}
76+
testID="user-account-switch-btn"
10077
/>
101-
</FlexBox>
102-
<Overlay visible={isSwitchAccountVisible}>
103-
<SwitchAccountOverlay onDismissOverlay={closeSwitchAccountDialog} />
104-
</Overlay>
105-
</>
106-
</AccountTabContainer>
107-
</Page>
78+
<hr />
79+
</React.Fragment>
80+
)}
81+
82+
<h2 data-testid="account-settings--header"> Account Details </h2>
83+
<div style={labelStyle}>Account Name</div>
84+
<FlexBox direction={FlexDirection.Row} margin={ComponentSize.Medium}>
85+
<Input
86+
name="accountName"
87+
testID="input--active-account-name"
88+
type={InputType.Text}
89+
value={activeAcctName}
90+
onChange={updateAcctName}
91+
size={ComponentSize.Medium}
92+
style={inputStyle}
93+
/>
94+
<Button
95+
onClick={() =>
96+
handleRenameActiveAccount(activeAccount.id, activeAcctName)
97+
}
98+
testID="rename-account--button"
99+
text="Save"
100+
/>
101+
</FlexBox>
102+
<Overlay visible={isSwitchAccountVisible}>
103+
<SwitchAccountOverlay onDismissOverlay={closeSwitchAccountDialog} />
104+
</Overlay>
105+
</>
106+
</AccountTabContainer>
108107
)
109108
}
110109

111110
const AccountPage: FC = () => {
112111
return (
113112
<Page titleTag={pageTitleSuffixer(['Account Settings Page'])}>
113+
<AccountHeader testID="account-page--header" />
114114
<UserAccountProvider>
115115
<AccountAboutPage />
116116
</UserAccountProvider>

src/accounts/AccountTabContainer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React, {PureComponent} from 'react'
33

44
// Components
55
import AccountTabs from 'src/accounts/AccountTabs'
6-
import AccountHeader from 'src/accounts/AccountHeader'
76

87
import {Tabs, Orientation, Page} from '@influxdata/clockface'
98

@@ -22,7 +21,6 @@ class AccountTabContainer extends PureComponent<Props> {
2221
return (
2322
<Page.Contents fullWidth={false} scrollable={true}>
2423
<Tabs.Container orientation={Orientation.Horizontal}>
25-
<AccountHeader testID="account-page--header" />
2624
<AccountTabs activeTab={activeTab} />
2725
<Tabs.TabContents>{children}</Tabs.TabContents>
2826
</Tabs.Container>

src/billing/components/BillingPage.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ const BillingPage: FC = () => {
1818

1919
if (isFlagEnabled('multiAccount')) {
2020
contents = (
21-
<AccountTabContainer activeTab="billing">
22-
<BillingPageContents />
23-
</AccountTabContainer>
21+
<>
22+
<Page.Header fullWidth={false}>
23+
<Page.Title title="Account" />
24+
</Page.Header>
25+
<AccountTabContainer activeTab="billing">
26+
<BillingPageContents />
27+
</AccountTabContainer>
28+
</>
2429
)
2530
} else {
2631
contents = (

0 commit comments

Comments
 (0)