Skip to content

Commit

Permalink
Rewrite user/account page layout to React/JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
yvanzo committed Oct 5, 2018
1 parent 3b58b71 commit 84b33bb
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions root/components/UserAccountLayout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* @flow
* Copyright (C) 2018 MetaBrainz Foundation
*
* This file is part of MusicBrainz, the open internet music database,
* and is licensed under the GPL version 2, or (at your option) any
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/

import * as React from 'react';

import Layout from '../layout';
import * as manifest from '../static/manifest';
import EditorLink from '../static/scripts/common/components/EditorLink';
import {hyphenateTitle, l} from '../static/scripts/common/i18n';

import UserAccountTabs from './UserAccountTabs';

type Props = {|
+children: React.Node,
+page: string,
+title?: string,
+user: EditorT,
|};

const UserAccountLayout = ({
children,
page,
user,
title,
...layoutProps
}: Props) => (
<Layout
fullWidth
title={title
? hyphenateTitle(l('Editor “{user}”', {user: user.name}), title)
: l('Editor “{user}”', {user: user.name})}
{...layoutProps}
>
<h1>
<EditorLink avatarSize={54} editor={user} />
</h1>
<UserAccountTabs page={page} user={user} />
{children}
</Layout>
);

export default UserAccountLayout;

0 comments on commit 84b33bb

Please sign in to comment.