Skip to content

Commit 1930b38

Browse files
malwilleyandrewshie-sentry
authored andcommitted
fix(nav): Update nav styles in disabled member page (#89816)
1 parent 2662a29 commit 1930b38

File tree

2 files changed

+44
-15
lines changed

2 files changed

+44
-15
lines changed

static/app/views/nav/orgDropdown.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ function createOrganizationMenuItem(): MenuItemProps {
4747
};
4848
}
4949

50-
export function OrgDropdown({className}: {className?: string}) {
50+
export function OrgDropdown({
51+
className,
52+
hideOrgLinks,
53+
}: {
54+
className?: string;
55+
hideOrgLinks?: boolean;
56+
}) {
5157
const api = useApi();
5258
const theme = useTheme();
5359

@@ -108,25 +114,25 @@ export function OrgDropdown({className}: {className?: string}) {
108114
key: 'organization-settings',
109115
label: t('Organization Settings'),
110116
to: `/organizations/${organization.slug}/settings/`,
111-
hidden: !hasOrgRead,
117+
hidden: !hasOrgRead || hideOrgLinks,
112118
},
113119
{
114120
key: 'members',
115121
label: t('Members'),
116122
to: `/organizations/${organization.slug}/settings/members/`,
117-
hidden: !hasMemberRead,
123+
hidden: !hasMemberRead || hideOrgLinks,
118124
},
119125
{
120126
key: 'teams',
121127
label: t('Teams'),
122128
to: `/organizations/${organization.slug}/settings/teams/`,
123-
hidden: !hasTeamRead,
129+
hidden: !hasTeamRead || hideOrgLinks,
124130
},
125131
{
126132
key: 'billing',
127133
label: t('Usage & Billing'),
128134
to: `/organizations/${organization.slug}/settings/billing/`,
129-
hidden: !hasBillingAccess,
135+
hidden: !hasBillingAccess || hideOrgLinks,
130136
},
131137
{
132138
key: 'switch-organization',

static/gsApp/hooks/disabledMemberView.tsx

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ import Footer from 'sentry/components/footer';
1010
import LoadingError from 'sentry/components/loadingError';
1111
import LoadingIndicator from 'sentry/components/loadingIndicator';
1212
import PageOverlay from 'sentry/components/pageOverlay';
13-
import {SidebarWrapper} from 'sentry/components/sidebar';
13+
import {SidebarWrapper as LegacySidebarWrapper} from 'sentry/components/sidebar';
1414
import SidebarDropdown from 'sentry/components/sidebar/sidebarDropdown';
1515
import {t, tct} from 'sentry/locale';
16+
import {space} from 'sentry/styles/space';
1617
import type {Organization} from 'sentry/types/organization';
1718
import {useApiQuery, useMutation} from 'sentry/utils/queryClient';
1819
import useApi from 'sentry/utils/useApi';
1920
import {useParams} from 'sentry/utils/useParams';
21+
import {OrgDropdown} from 'sentry/views/nav/orgDropdown';
22+
import {usePrefersStackedNav} from 'sentry/views/nav/prefersStackedNav';
2023

2124
import {sendUpgradeRequest} from 'getsentry/actionCreators/upsell';
2225
import DeactivatedMember from 'getsentry/components/features/illustrations/deactivatedMember';
@@ -36,6 +39,8 @@ function DisabledMemberView(props: Props) {
3639
const {subscription} = props;
3740
const orgSlug = subscription.slug;
3841

42+
const prefersStackedNav = usePrefersStackedNav();
43+
3944
const {
4045
data: organization,
4146
isPending,
@@ -49,9 +54,11 @@ function DisabledMemberView(props: Props) {
4954
);
5055

5156
useEffect(() => {
52-
// needed to make the left margin work as expected
53-
document.body.classList.add('body-sidebar');
54-
}, []);
57+
if (!prefersStackedNav) {
58+
// needed to make the left margin work as expected
59+
document.body.classList.add('body-sidebar');
60+
}
61+
}, [prefersStackedNav]);
5562

5663
useEffect(() => {
5764
if (organization) {
@@ -123,11 +130,17 @@ function DisabledMemberView(props: Props) {
123130
);
124131
return (
125132
<PageContainer>
126-
<MinimalistSidebar collapsed={false}>
127-
{organization && (
128-
<SidebarDropdown orientation="left" collapsed={false} hideOrgLinks />
129-
)}
130-
</MinimalistSidebar>
133+
{prefersStackedNav ? (
134+
<MinimalistSidebar>
135+
{organization ? <OrgDropdown hideOrgLinks /> : null}
136+
</MinimalistSidebar>
137+
) : (
138+
<MinimalistSidebarLegacy collapsed={false}>
139+
{organization && (
140+
<SidebarDropdown orientation="left" collapsed={false} hideOrgLinks />
141+
)}
142+
</MinimalistSidebarLegacy>
143+
)}
131144
{organization && (
132145
<PageOverlay
133146
background={DeactivatedMember}
@@ -200,10 +213,20 @@ function DisabledMemberView(props: Props) {
200213

201214
export default withSubscription(DisabledMemberView);
202215

203-
const MinimalistSidebar = styled(SidebarWrapper)`
216+
const MinimalistSidebarLegacy = styled(LegacySidebarWrapper)`
204217
padding: 12px 19px;
205218
`;
206219

220+
const MinimalistSidebar = styled('div')`
221+
height: 60px;
222+
border-bottom: 1px solid
223+
${p => (p.theme.isChonk ? p.theme.border : p.theme.translucentGray200)};
224+
background: ${p => (p.theme.isChonk ? p.theme.background : p.theme.surface300)};
225+
display: flex;
226+
align-items: center;
227+
padding: 0 ${space(2)};
228+
`;
229+
207230
const PageContainer = styled('div')`
208231
display: flex;
209232
flex-direction: column;

0 commit comments

Comments
 (0)