docbrown/app/javascript/chat/channelRequest.jsx
Lisa Sy 36e271e1cb
Deprecate old button stylings with Crayons buttons (#10694) [deploy]
* Deprecate old buttons.scss file

* Replace outdated button styles with Crayons button styling

* Update additional views after removing old button styling

* Update tests

* Update test

* Update test

* Fix button placements
2020-10-14 07:28:41 -07:00

48 lines
1.4 KiB
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
import { Button } from '@crayons';
const ChannelRequest = ({ resource: data, handleJoiningRequest }) => (
<div className="activechatchannel__activeArticle activesendrequest">
<div className="joining-message">
<h2>Hey {data.user.name} !</h2>
<h3>You are not a member of this group yet. Send a request to join.</h3>
</div>
<div className="user-picture">
<div className="chatmessage__profilepic">
<img
className="chatmessagebody__profileimage"
src={data.user.profile_image_90}
alt={`${data.user.username} profile`}
/>
<img
className="chatmessagebody__profileimage"
src="/assets/organization.svg"
alt={`${data.channel.name} profile`}
/>
</div>
</div>
<div className="send-request">
{data.channel.status !== 'joining_request' ? (
<Button
variant="primary"
onClick={handleJoiningRequest}
data-channel-id={data.channel.id}
>
{' '}
Join {data.channel.name}{' '}
</Button>
) : (
<Button variant="secondary"> Requested Already </Button>
)}
</div>
</div>
);
ChannelRequest.propTypes = {
resource: PropTypes.shape({
data: PropTypes.object,
}).isRequired,
handleJoiningRequest: PropTypes.func.isRequired,
};
export default ChannelRequest;