Skip to content

chore(site): remove Typography component #10769

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

Merged
merged 12 commits into from
Nov 20, 2023
Prev Previous commit
Next Next commit
Remove Typography from EmptyState
  • Loading branch information
BrunoQuaresma committed Nov 17, 2023
commit 1fda7b7f021b82ba18b75c408c3993f941ac5b7f
20 changes: 8 additions & 12 deletions site/src/components/EmptyState/EmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import type { FC, ReactNode } from "react";

export interface EmptyStateProps {
Expand Down Expand Up @@ -40,24 +39,21 @@ export const EmptyState: FC<React.PropsWithChildren<EmptyStateProps>> = (
}}
{...boxProps}
>
<Typography variant="h5" css={{ fontSize: 24 }}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect an <h5> to at least have a weight of 500

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I think this could be something we should set as a global style? Wondering if as part of the theme thing, we could include the TailwindCSS reset.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but my point was that here, you manually set it to 400. it should be a <p> or something instead, not a header.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh ok, but it is a title so I think makes sense to make it a heading element 🤔

{message}
</Typography>
<h5 css={{ fontSize: 24, fontWeight: 400, margin: 0 }}>{message}</h5>
{description && (
<Typography
variant="body2"
color="textSecondary"
css={{
marginTop: 12,
<p
css={(theme) => ({
marginTop: 16,
fontSize: 16,
lineHeight: "140%",
maxWidth: 480,
}}
color: theme.palette.text.secondary,
})}
>
{description}
</Typography>
</p>
)}
{cta && <div css={{ marginTop: 32 }}>{cta}</div>}
{cta && <div css={{ marginTop: 24 }}>{cta}</div>}
{image}
</Box>
);
Expand Down