chore: Move to Typescript (#2783)
This PR moves the entire project to Typescript. Due to the ~1000 ignores this will lead to a messy codebase for a while, but the churn is worth it – all of those ignore comments are places that were never type-safe previously. closes #1282
This commit is contained in:
55
app/components/Scene.tsx
Normal file
55
app/components/Scene.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import CenteredContent from "~/components/CenteredContent";
|
||||
import Header from "~/components/Header";
|
||||
import PageTitle from "~/components/PageTitle";
|
||||
|
||||
type Props = {
|
||||
icon?: React.ReactNode;
|
||||
title: React.ReactNode;
|
||||
textTitle?: string;
|
||||
children: React.ReactNode;
|
||||
breadcrumb?: React.ReactNode;
|
||||
actions?: React.ReactNode;
|
||||
centered?: boolean;
|
||||
};
|
||||
|
||||
function Scene({
|
||||
title,
|
||||
icon,
|
||||
textTitle,
|
||||
actions,
|
||||
breadcrumb,
|
||||
children,
|
||||
centered,
|
||||
}: Props) {
|
||||
return (
|
||||
<FillWidth>
|
||||
<PageTitle title={textTitle || title} />
|
||||
<Header
|
||||
title={
|
||||
icon ? (
|
||||
<>
|
||||
{icon} {title}
|
||||
</>
|
||||
) : (
|
||||
title
|
||||
)
|
||||
}
|
||||
actions={actions}
|
||||
breadcrumb={breadcrumb}
|
||||
/>
|
||||
{centered !== false ? (
|
||||
<CenteredContent withStickyHeader>{children}</CenteredContent>
|
||||
) : (
|
||||
children
|
||||
)}
|
||||
</FillWidth>
|
||||
);
|
||||
}
|
||||
|
||||
const FillWidth = styled.div`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
export default Scene;
|
||||
Reference in New Issue
Block a user