Skip to content

Commit 2df024c

Browse files
authored
ref(aci): Remove providers for actions and breadcrumbs in layout components (#95296)
1 parent f25bff3 commit 2df024c

File tree

10 files changed

+202
-455
lines changed

10 files changed

+202
-455
lines changed

static/app/components/workflowEngine/layout/actions.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

static/app/components/workflowEngine/layout/breadcrumbs.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

static/app/components/workflowEngine/layout/detail.tsx

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,26 @@
1+
import {Fragment} from 'react';
12
import styled from '@emotion/styled';
23

34
import {Flex} from 'sentry/components/core/layout';
45
import ProjectBadge from 'sentry/components/idBadge/projectBadge';
56
import * as Layout from 'sentry/components/layouts/thirds';
6-
import {useDocumentTitle} from 'sentry/components/sentryDocumentTitle';
7-
import {ActionsFromContext} from 'sentry/components/workflowEngine/layout/actions';
8-
import {BreadcrumbsFromContext} from 'sentry/components/workflowEngine/layout/breadcrumbs';
7+
import {HeaderActions} from 'sentry/components/layouts/thirds';
98
import {space} from 'sentry/styles/space';
109
import type {AvatarProject} from 'sentry/types/project';
1110

1211
interface WorkflowEngineDetailLayoutProps {
1312
/**
1413
* The main content for this page
15-
* Expected to include `<DetailLayout.Main>` and `<DetailLayout.Sidebar>` components.
14+
* Expected to include `<DetailLayout.Body>` and `<DetailLayout.Header>` components.
1615
*/
1716
children: React.ReactNode;
18-
project?: AvatarProject;
1917
}
2018

2119
/**
2220
* Precomposed 67/33 layout for Automations / Monitors detail pages.
2321
*/
24-
function DetailLayout({children, project}: WorkflowEngineDetailLayoutProps) {
25-
const title = useDocumentTitle();
26-
return (
27-
<StyledPage>
28-
<Layout.Header unified>
29-
<Layout.HeaderContent>
30-
<BreadcrumbsFromContext />
31-
<Layout.Title>{title}</Layout.Title>
32-
{project && (
33-
<ProjectContainer>
34-
<ProjectBadge project={project} disableLink avatarSize={16} />
35-
</ProjectContainer>
36-
)}
37-
</Layout.HeaderContent>
38-
<ActionsFromContext />
39-
</Layout.Header>
40-
<StyledBody>{children}</StyledBody>
41-
</StyledPage>
42-
);
22+
function DetailLayout({children}: WorkflowEngineDetailLayoutProps) {
23+
return <StyledPage>{children}</StyledPage>;
4324
}
4425

4526
const ProjectContainer = styled('div')`
@@ -79,6 +60,43 @@ function Sidebar({children}: RequiredChildren) {
7960
);
8061
}
8162

82-
const WorkflowEngineDetailLayout = Object.assign(DetailLayout, {Main, Sidebar});
63+
function Header({children}: RequiredChildren) {
64+
return <Layout.Header unified>{children}</Layout.Header>;
65+
}
66+
67+
function HeaderContent({children}: RequiredChildren) {
68+
return <Layout.HeaderContent>{children}</Layout.HeaderContent>;
69+
}
70+
71+
function Actions({children}: RequiredChildren) {
72+
return (
73+
<HeaderActions>
74+
<Flex gap={space(1)}>{children}</Flex>
75+
</HeaderActions>
76+
);
77+
}
78+
79+
function Title({title, project}: {title: string; project?: AvatarProject}) {
80+
return (
81+
<Fragment>
82+
<Layout.Title>{title}</Layout.Title>
83+
{project && (
84+
<ProjectContainer>
85+
<ProjectBadge project={project} disableLink avatarSize={16} />
86+
</ProjectContainer>
87+
)}
88+
</Fragment>
89+
);
90+
}
91+
92+
const WorkflowEngineDetailLayout = Object.assign(DetailLayout, {
93+
Body: StyledBody,
94+
Main,
95+
Sidebar,
96+
Header,
97+
HeaderContent,
98+
Actions,
99+
Title,
100+
});
83101

84102
export default WorkflowEngineDetailLayout;

static/app/components/workflowEngine/layout/index.spec.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

static/app/components/workflowEngine/layout/index.stories.tsx

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)