Skip to content

Commit d12e6a7

Browse files
committed
feat(pageframe): adopt TopBar.Slot in Layout.Title
1 parent bd79c6d commit d12e6a7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

static/app/components/layouts/thirds.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {Tabs} from '@sentry/scraps/tabs';
1212

1313
import {usePrimaryNavigation} from 'sentry/views/navigation/primaryNavigationContext';
1414
import {SecondaryNavigationContext} from 'sentry/views/navigation/secondaryNavigationContext';
15+
import {TopBar} from 'sentry/views/navigation/topBar';
1516
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
1617

1718
/**
@@ -137,7 +138,16 @@ export const HeaderActions = styled('div')`
137138
* Includes flex gap for additional items placed with the text (such as feature
138139
* badges or ID badges)
139140
*/
140-
export const Title = styled('h1')<{withMargins?: boolean}>`
141+
export function Title(props: React.ComponentProps<typeof LegacyTitle>) {
142+
const hasPageFrame = useHasPageFrameFeature();
143+
144+
if (hasPageFrame) {
145+
return <TopBar.Slot name="title">{props.children}</TopBar.Slot>;
146+
}
147+
148+
return <LegacyTitle {...props} />;
149+
}
150+
const LegacyTitle = styled('h1')<{withMargins?: boolean}>`
141151
width: 100%;
142152
white-space: nowrap;
143153
overflow: hidden;

0 commit comments

Comments
 (0)