Skip to content

Commit 37b428e

Browse files
refactor: use PageHeader component in layout (#1324)
1 parent 65cb727 commit 37b428e

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

sdks/js/packages/core/react/components/Layout/index.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
import { Flex, Text } from '@raystack/apsara';
1+
import { Flex } from '@raystack/apsara';
22
import { PropsWithChildren } from 'react';
3-
import styles from './layout.module.css';
3+
import { PageHeader } from '../common/page-header';
4+
import sharedStyles from '../organization/styles.module.css';
45

56
interface LayoutProps {
67
title: string;
8+
description?: string;
79
}
810

9-
export function Layout({ title, children }: PropsWithChildren<LayoutProps>) {
11+
export function Layout({ title, description, children }: PropsWithChildren<LayoutProps>) {
1012
return (
1113
<Flex direction="column" style={{ width: '100%' }}>
12-
<Flex className={styles.header}>
13-
<Text size="large">{title}</Text>
14-
</Flex>
15-
<Flex direction="column" gap={9} className={styles.container}>
16-
{children}
14+
<Flex direction="column" className={sharedStyles.container}>
15+
<Flex direction="row" justify="between" align="center" className={sharedStyles.header}>
16+
<PageHeader title={title} description={description} />
17+
</Flex>
18+
<Flex direction="column" gap={9}>
19+
{children}
20+
</Flex>
1721
</Flex>
1822
</Flex>
1923
);

sdks/js/packages/core/react/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export { useBillingPermission } from './hooks/useBillingPermission';
2222
export { useConnectQueryPolling } from './hooks/useConnectQueryPolling';
2323
export { usePreferences } from './hooks/usePreferences';
2424
export { Layout } from './components/Layout';
25+
export { PageHeader } from './components/common/page-header';
2526

2627
export type {
2728
FrontierClientOptions,

0 commit comments

Comments
 (0)