Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions oxlint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1383,11 +1383,6 @@
"count": 1
}
},
"static/app/components/sidebarSection.tsx": {
"@sentry/scraps/prefer-primitives": {
"count": 1
}
},
"static/app/components/slider/index.tsx": {
"@sentry/scraps/prefer-primitives": {
"count": 1
Expand Down
19 changes: 15 additions & 4 deletions static/app/components/sidebarSection.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
import styled from '@emotion/styled';

import {Container, type ContainerProps} from '@sentry/scraps/layout';
import {Heading} from '@sentry/scraps/text';

export function Wrap(props: ContainerProps) {
return <Container marginBottom="3xl" {...props} />;
}

export const Title = styled('h6')`
color: ${p => p.theme.tokens.content.secondary};
interface TitleProps {
children: React.ReactNode;
className?: string;
style?: React.CSSProperties;
variant?: React.ComponentProps<typeof Heading>['variant'];
}

export function Title(props: TitleProps) {
return <StyledHeading as="h6" size="md" variant="muted" {...props} />;
}

// Titles often carry a trailing InfoTip or icon that needs to sit centered next to the text
const StyledHeading = styled(Heading)`
display: flex;
align-items: center;
gap: ${p => p.theme.space.xs};
font-size: ${p => p.theme.font.size.md};
margin: ${p => p.theme.space.md} 0 0;
margin-top: ${p => p.theme.space.md};
`;

export const IconWrapper = styled('div')`
Expand Down
7 changes: 5 additions & 2 deletions static/app/views/issueDetails/sidebar/detectorSection.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import styled from '@emotion/styled';

import {LinkButton} from '@sentry/scraps/button';
import {Container} from '@sentry/scraps/layout';

import * as SidebarSection from 'sentry/components/sidebarSection';
import {t} from 'sentry/locale';
import type {Event} from 'sentry/types/event';
import type {Group} from 'sentry/types/group';
Expand All @@ -11,7 +13,6 @@ import {getConfigForIssueType} from 'sentry/utils/issueTypeConfig';
import {makeMonitorDetailsPathname} from 'sentry/views/detectors/pathnames';
import {useIssueDetails} from 'sentry/views/issueDetails/context';
import type {DetectorDetails} from 'sentry/views/issueDetails/sidebar/detectorDetails';
import {SidebarSectionTitle} from 'sentry/views/issueDetails/sidebar/sidebar';

export function getDetectorDetails({
event,
Expand Down Expand Up @@ -124,7 +125,9 @@ function DetectorSectionContent({

return (
<div>
<SidebarSectionTitle>{title}</SidebarSectionTitle>
<Container marginBottom="md">
<SidebarSection.Title variant="primary">{title}</SidebarSection.Title>
</Container>
{description && <DetectorDescription>{description}</DetectorDescription>}
<LinkButton
aria-label={ctaText}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Flex} from '@sentry/scraps/layout';

import * as SidebarSection from 'sentry/components/sidebarSection';
import {t} from 'sentry/locale';
import {useLocation} from 'sentry/utils/useLocation';
import {SidebarSectionTitle} from 'sentry/views/issueDetails/sidebar/sidebar';
import {ViewButton} from 'sentry/views/issueDetails/sidebar/viewButton';
import {Tab, TabPaths} from 'sentry/views/issueDetails/types';
import {useGroupDetailsRoute} from 'sentry/views/issueDetails/useGroupDetailsRoute';
Expand All @@ -13,7 +13,9 @@ export function MergedIssuesSidebarSection() {

return (
<Flex justify="between" align="center">
<SidebarSectionTitle style={{margin: 0}}>{t('Merged Issues')}</SidebarSectionTitle>
<SidebarSection.Title variant="primary" style={{margin: 0}}>
{t('Merged Issues')}
</SidebarSection.Title>
<ViewButton
aria-label={t('View Merged Issues')}
to={{
Expand Down
6 changes: 0 additions & 6 deletions static/app/views/issueDetails/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {ExternalLink} from '@sentry/scraps/link';

import {ErrorBoundary} from 'sentry/components/errorBoundary';
import * as Layout from 'sentry/components/layouts/thirds';
import * as SidebarSection from 'sentry/components/sidebarSection';
import {t, tct} from 'sentry/locale';
import type {Event} from 'sentry/types/event';
import type {Group, TeamParticipant, UserParticipant} from 'sentry/types/group';
Expand Down Expand Up @@ -140,11 +139,6 @@ const StyledBreak = styled('hr')`
border-color: ${p => p.theme.tokens.border.primary};
`;

export const SidebarSectionTitle = styled(SidebarSection.Title)`
margin-bottom: ${p => p.theme.space.md};
color: ${p => p.theme.tokens.content.primary};
`;

const Side = styled(Layout.Side)<{isBottomSidebar: boolean}>`
position: relative;
padding: ${p => p.theme.space.lg} ${p => p.theme.space.xl};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Flex} from '@sentry/scraps/layout';

import * as SidebarSection from 'sentry/components/sidebarSection';
import {t} from 'sentry/locale';
import {useLocation} from 'sentry/utils/useLocation';
import {SidebarSectionTitle} from 'sentry/views/issueDetails/sidebar/sidebar';
import {ViewButton} from 'sentry/views/issueDetails/sidebar/viewButton';
import {Tab, TabPaths} from 'sentry/views/issueDetails/types';
import {useGroupDetailsRoute} from 'sentry/views/issueDetails/useGroupDetailsRoute';
Expand All @@ -13,7 +13,9 @@ export function SimilarIssuesSidebarSection() {

return (
<Flex justify="between" align="center">
<SidebarSectionTitle style={{margin: 0}}>{t('Similar Issues')}</SidebarSectionTitle>
<SidebarSection.Title variant="primary" style={{margin: 0}}>
{t('Similar Issues')}
</SidebarSection.Title>
<ViewButton
aria-label={t('View Similar Issues')}
to={{
Expand Down
Loading