Skip to content

Commit

Permalink
feat (mentorship-request): send message to mentee (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
moshfeu committed Jun 8, 2021
1 parent 08e2fca commit a1ad19a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
46 changes: 37 additions & 9 deletions src/Me/MentorshipReq/ReqContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import styled from 'styled-components';
import Button from '../components/Button';
import { STATUS } from '../../helpers/mentorship';
import { Tooltip } from 'react-tippy';
import { report } from '../../ga';

const Block = styled.div`
& + div {
Expand All @@ -19,17 +21,25 @@ const Block = styled.div`
}
`;

const RequestFooter = styled.div`
display: flex;
flex-direction: column;
justify-content: flex-end;
`;

const CallToAction = styled.div`
margin-top: 1rem;
display: flex;
justify-content: flex-end;
align-items: center;
> button {
width: 110px;
height: 36px;
border-radius: 3px;
margin: 0;
& + button {
&:not(:first-child) {
margin-left: 8px;
}
}
Expand All @@ -44,6 +54,7 @@ const ReqContent = ({
onDeclined,
isLoading,
isMine,
menteeEmail,
}) => {
const hideBtns =
isMine || [STATUS.approved, STATUS.rejected].includes(status);
Expand All @@ -66,14 +77,31 @@ const ReqContent = ({
</Block>
)}
{hideBtns ? null : (
<CallToAction>
<Button skin="secondary" onClick={onDeclined}>
Declined
</Button>
<Button skin="primary" onClick={onAccept} isLoading={isLoading}>
Accept
</Button>
</CallToAction>
<RequestFooter>
<CallToAction>
<Button skin="secondary" onClick={onDeclined}>
Decline
</Button>
<Button skin="primary" onClick={onAccept} isLoading={isLoading}>
Accept
</Button>
</CallToAction>
<CallToAction>
<Tooltip
title="Don't forget to approve the request if it works for you"
size="regular"
arrow={true}
position="top"
>
<a
onClick={() => report('mentorship request', 'send message')}
href={`mailto:${menteeEmail}`}
>
Send a message
</a>
</Tooltip>
</CallToAction>
</RequestFooter>
)}
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/Me/MentorshipReq/UsersList.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const renderList = ({
info={formatRequestTime(Date.parse(date))}
>
<ReqContent
menteeEmail={props.mentee.email}
status={status}
isLoading={isLoading}
isMine={isMine}
Expand Down

0 comments on commit a1ad19a

Please sign in to comment.