forked from ddrilling/asb_cloud_front
* LayoutPortal установлен как memo
* LayoutPortalProps расширен с LayoutProps * тип заголовка изменён на ReactNode * добавлен экспорт LayoutPortalProps * добавлен экспорт по-умолчанию
This commit is contained in:
parent
d92ba25089
commit
702e994e64
@ -1,13 +1,14 @@
|
|||||||
import { Button, Layout } from 'antd'
|
import { memo, ReactNode } from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
import { Button, Layout, LayoutProps } from 'antd'
|
||||||
|
|
||||||
import PageHeader from '../PageHeader'
|
import PageHeader from '../PageHeader'
|
||||||
|
|
||||||
type LayoutPortalProps = {
|
export type AdminLayoutPortalProps = LayoutProps & {
|
||||||
title?: string
|
title?: ReactNode
|
||||||
[props: string]: any
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AdminLayoutPortal: React.FC<LayoutPortalProps> = ({title, ...props}) => (
|
export const AdminLayoutPortal = memo<AdminLayoutPortalProps>(({ title, ...props }) => (
|
||||||
<Layout.Content>
|
<Layout.Content>
|
||||||
<PageHeader isAdmin title={title} style={{ backgroundColor: '#900' }}>
|
<PageHeader isAdmin title={title} style={{ backgroundColor: '#900' }}>
|
||||||
<Button size={'large'}>
|
<Button size={'large'}>
|
||||||
@ -18,4 +19,6 @@ export const AdminLayoutPortal: React.FC<LayoutPortalProps> = ({title, ...props}
|
|||||||
<Layout.Content className={'site-layout-background sheet'} {...props}/>
|
<Layout.Content className={'site-layout-background sheet'} {...props}/>
|
||||||
</Layout>
|
</Layout>
|
||||||
</Layout.Content>
|
</Layout.Content>
|
||||||
)
|
))
|
||||||
|
|
||||||
|
export default AdminLayoutPortal
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
import { Layout } from 'antd'
|
import { memo, ReactNode } from 'react'
|
||||||
|
import { Layout, LayoutProps } from 'antd'
|
||||||
|
|
||||||
import PageHeader from '../PageHeader'
|
import PageHeader from '../PageHeader'
|
||||||
import WellTreeSelector from '../WellTreeSelector'
|
import WellTreeSelector from '../WellTreeSelector'
|
||||||
|
|
||||||
type LayoutPortalProps = {
|
export type LayoutPortalProps = LayoutProps & {
|
||||||
title?: string
|
title?: ReactNode
|
||||||
noSheet?: boolean
|
noSheet?: boolean
|
||||||
[props: string]: any
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LayoutPortal: React.FC<LayoutPortalProps> = ({title, noSheet, ...props}) => (
|
export const LayoutPortal = memo<LayoutPortalProps>(({ title, noSheet, ...props }) => (
|
||||||
<Layout.Content>
|
<Layout.Content>
|
||||||
<PageHeader title={title}>
|
<PageHeader title={title}>
|
||||||
<WellTreeSelector />
|
<WellTreeSelector />
|
||||||
@ -19,4 +20,6 @@ export const LayoutPortal: React.FC<LayoutPortalProps> = ({title, noSheet, ...pr
|
|||||||
)}
|
)}
|
||||||
</Layout>
|
</Layout>
|
||||||
</Layout.Content>
|
</Layout.Content>
|
||||||
)
|
))
|
||||||
|
|
||||||
|
export default LayoutPortal
|
||||||
|
@ -1,2 +1,5 @@
|
|||||||
export { AdminLayoutPortal } from './AdminLayoutPortal'
|
export { AdminLayoutPortal } from './AdminLayoutPortal'
|
||||||
export { LayoutPortal } from './LayoutPortal'
|
export { LayoutPortal } from './LayoutPortal'
|
||||||
|
|
||||||
|
export type { AdminLayoutPortalProps } from './AdminLayoutPortal'
|
||||||
|
export type { LayoutPortalProps } from './LayoutPortal'
|
||||||
|
Loading…
Reference in New Issue
Block a user