Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend: Adjust workflow layout whitespace #3155

Merged
merged 2 commits into from
Oct 23, 2024
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
2 changes: 0 additions & 2 deletions frontend/packages/core/src/AppProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ const ClutchApp = ({
? `${workflow.displayName}: ${route.displayName}`
: workflow.displayName;

// We define these props in order to avoid UI changes before refactoring
const workflowLayoutProps: LayoutProps = {
...route.layoutProps,
heading: route.layoutProps?.heading || heading,
Expand All @@ -231,7 +230,6 @@ const ClutchApp = ({
>
{React.cloneElement(<route.component />, {
...route.componentProps,
// This is going to be removed to be used in the WorkflowLayout only
heading,
})}
</AppNotification>
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/core/src/AppProvider/workflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface Route {
*/
featureFlag?: string;

layoutProps?: LayoutProps;
layoutProps?: Omit<LayoutProps, "workflow">;
}

export interface ConfiguredRoute extends Route {
Expand Down
1 change: 0 additions & 1 deletion frontend/packages/core/src/Breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ interface BreadcrumbsProps {
}

const StyledBreadcrumbs = styled(MuiBreadcrumbs)(({ theme }: { theme: Theme }) => ({
margin: theme.spacing(theme.clutch.spacing.sm, theme.clutch.spacing.none),
"& .MuiBreadcrumbs-separator": {
color: alpha(theme.colors.neutral[900], 0.6),
},
Expand Down
31 changes: 20 additions & 11 deletions frontend/packages/core/src/WorkflowLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,20 @@ const LayoutContainer = styled("div")(

const PageHeader = styled("div")(({ $variant, theme }: StyledVariantComponentProps) => ({
padding: theme.spacing(
theme.clutch.spacing.base,
theme.clutch.spacing.none,
$variant === "wizard" ? theme.clutch.spacing.md : theme.clutch.spacing.none
),
paddingBottom: theme.spacing(theme.clutch.spacing.base),
width: "100%",
}));

const HeaderTitle = styled(Typography)({
const PageHeaderMainContainer = styled("div")({
display: "flex",
alignItems: "center",
height: "70px",
jecr marked this conversation as resolved.
Show resolved Hide resolved
});

const Heading = styled(Typography)({
lineHeight: 1,
});

Expand All @@ -88,15 +95,17 @@ const WorkflowLayout = ({
{!hideHeader && (
<PageHeader $variant={variant}>
<Breadcrumbs entries={breadcrumbsEntries} />
{heading && (
<>
{React.isValidElement(heading) ? (
heading
) : (
<HeaderTitle variant="h2">{heading}</HeaderTitle>
)}
</>
)}
<PageHeaderMainContainer>
{heading && (
<>
{React.isValidElement(heading) ? (
heading
) : (
<Heading variant="h2">{heading}</Heading>
)}
</>
)}
</PageHeaderMainContainer>
</PageHeader>
)}
{children}
Expand Down
Loading