Commit 9c872c0 1 parent 25650b2 commit 9c872c0 Copy full SHA for 9c872c0
File tree 2 files changed +17
-4
lines changed
2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change
1
+ import { ReactNode } from 'react' ;
1
2
import styled from 'styled-components' ;
2
3
3
4
import { Route } from '@suite-common/suite-types' ;
@@ -28,14 +29,17 @@ const Container = styled.div`
28
29
// TODO: perhaps this could be a part of some router config / useLayoutHook / somthing else?
29
30
interface PageHeaderProps {
30
31
backRoute ?: Route [ 'name' ] ;
32
+ children ?: ReactNode ;
31
33
}
32
34
33
- export const PageHeader = ( { backRoute } : PageHeaderProps ) => {
35
+ export const PageHeader = ( { backRoute, children } : PageHeaderProps ) => {
34
36
const selectedAccount = useSelector ( selectSelectedAccount ) ;
35
37
// TODO subpages + tabs could be in some router config? this approach feels a bit fragile
36
38
const isAccountTabPage = useSelector ( selectIsAccountTabPage ) ;
37
39
38
- return (
40
+ return children ? (
41
+ < Container > { children } </ Container >
42
+ ) : (
39
43
< Container >
40
44
< PageName backRoute = { backRoute } />
41
45
Original file line number Diff line number Diff line change 1
1
import { useLayout } from 'src/hooks/suite' ;
2
2
import { PasswordManager } from './PasswordManager/PasswordManager' ;
3
+ import { PageHeader } from 'src/components/suite/layouts/SuiteLayout' ;
4
+ import { BasicName } from 'src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName' ;
5
+
6
+ const PasswordManagerView = ( ) => {
7
+ useLayout ( 'Password manager' , ( ) => (
8
+ < PageHeader >
9
+ < BasicName nameId = "TR_PASSWORD_MANAGER" />
10
+ </ PageHeader >
11
+ ) ) ;
3
12
4
- export default ( ) => {
5
- useLayout ( 'Password manager' ) ;
6
13
return < PasswordManager /> ;
7
14
} ;
15
+
16
+ export default PasswordManagerView ;
You can’t perform that action at this time.
0 commit comments