diff --git a/app/components/UserAccount.jsx b/app/components/UserAccount.jsx index cadea05d50ec068037e18b278fdc7df74aa9ef6e..52ae2a73ebe5918a9f5a2995d876af64d220d730 100644 --- a/app/components/UserAccount.jsx +++ b/app/components/UserAccount.jsx @@ -153,7 +153,7 @@ class UserAccount extends React.Component { <Page> {values.signup && <H1>Create a Europe PMC plus account</H1>} {values.myAccount && <H1>My Account</H1>} - {values.manageAccount && <H1>Manage User: {values.id}</H1>} + {values.success && ( <Notification type="success"> {values.success} </Notification> )} diff --git a/app/components/manage-account/ManageAccount.jsx b/app/components/manage-account/ManageAccount.jsx index fa9afe3d1e29d7f584ddbe05bdb6b5046f4e2a8f..dc8273d1491a34e131288914e1c29321bc769c7d 100644 --- a/app/components/manage-account/ManageAccount.jsx +++ b/app/components/manage-account/ManageAccount.jsx @@ -1,7 +1,8 @@ import React from 'react' import { Query } from 'react-apollo' import styled from 'styled-components' -import { Loading, LoadingIcon } from '../ui/' +import { H1, H2, Button } from '@pubsweet/ui' +import { Loading, LoadingIcon, Page } from '../ui/' import AccountDetails from './AccountDetailsContainer' import { GET_USER, GET_ROLES_BY_TYPE } from './queries' @@ -9,6 +10,12 @@ const Constainer = styled.div` .reset-pass { margin-top: 20px; } + div { + padding: 0px; + } + section { + margin-top: 60px; + } ` const ManageAccount = props => ( @@ -40,14 +47,29 @@ const ManageAccount = props => ( </Loading> ) } + const sendEmail = () => { + window.location.href = `mailto: ${ + userData.epmc_user.identities.filter( + identity => identity.type === 'local', + )[0].email + }` + } return ( - <Constainer> - <AccountDetails - {...props} - roles={data.rolesByType} - user={userData.epmc_user} - /> - </Constainer> + <Page> + <Constainer> + <H1>Manage User: {props.location.pathname.split('/')[2]}</H1> + <H2>Profile</H2> + <AccountDetails + {...props} + roles={data.rolesByType} + user={userData.epmc_user} + /> + <section> + <H1>Admin</H1> + <Button onClick={sendEmail}>Send email</Button> + </section> + </Constainer> + </Page> ) }} </Query>