diff --git a/client/components/basic/Page.js b/client/components/basic/Page.js index 67034e0caec7..37b39c81edec 100644 --- a/client/components/basic/Page.js +++ b/client/components/basic/Page.js @@ -1,32 +1,40 @@ import { Box, Flex, Margins, Scrollable } from '@rocket.chat/fuselage'; -import React, { useMemo } from 'react'; +import React, { useMemo, createContext, useContext, useState } from 'react'; import { BurgerMenuButton } from './BurgerMenuButton'; +const PageContext = createContext(); export function Page(props) { - return - ({ height: '100%' }), [])} {...props} /> - ; + const [border, setBorder] = useState(false); + return + + ({ height: '100%' }), [])} {...props} /> + + ; } export function PageHeader({ children, title, ...props }) { - return - - - - - - - {title} - - {children} - - - ; + const [border] = useContext(PageContext); + return + + + + + + + + {title} + + {children} + + + + ; } export function PageContent(props) { - return + const [, setBorder] = useContext(PageContext); + return { setBorder(!top); }}> ({ padding: '1rem' }), [])} {...props} /> ; }