redesign group invitation message type
parent
cbc816c3ed
commit
248494f15b
@ -1,41 +1,43 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { SessionButton, SessionButtonType } from '../session/SessionButton';
|
||||
import { SessionIconButton, SessionIconSize, SessionIconType } from '../session/icon';
|
||||
import { useTheme } from 'styled-components';
|
||||
|
||||
interface Props {
|
||||
type Props = {
|
||||
serverName: string;
|
||||
serverAddress: string;
|
||||
direction: string;
|
||||
onClick: any;
|
||||
}
|
||||
onJoinClick: () => void;
|
||||
};
|
||||
|
||||
export class GroupInvitation extends React.Component<Props> {
|
||||
public render() {
|
||||
const classes = ['group-invitation'];
|
||||
export const GroupInvitation = (props: Props) => {
|
||||
const theme = useTheme();
|
||||
const classes = ['group-invitation'];
|
||||
|
||||
if (this.props.direction === 'outgoing') {
|
||||
classes.push('invitation-outgoing');
|
||||
}
|
||||
if (props.direction === 'outgoing') {
|
||||
classes.push('invitation-outgoing');
|
||||
}
|
||||
const openGroupInvitation = window.i18n('openGroupInvitation');
|
||||
|
||||
return (
|
||||
<div className={'group-invitation-container'}>
|
||||
<div className={classNames(classes)}>
|
||||
<div className="title">Group invitation</div>
|
||||
<div className="contents">
|
||||
<img
|
||||
alt="group-avatar"
|
||||
src="images/session/session_chat_icon.png"
|
||||
className="invite-group-avatar"
|
||||
/>
|
||||
<span className="group-details">
|
||||
<span className="group-name">{this.props.serverName}</span>
|
||||
<span className="group-address">{this.props.serverAddress}</span>
|
||||
</span>
|
||||
<span role="button" className="join-btn" onClick={this.props.onClick}>
|
||||
Join
|
||||
</span>
|
||||
</div>
|
||||
return (
|
||||
<div className="group-invitation-container">
|
||||
<div className={classNames(classes)}>
|
||||
<div className="contents">
|
||||
<SessionIconButton
|
||||
iconType={SessionIconType.Plus}
|
||||
iconColor={theme.colors.accent}
|
||||
theme={theme}
|
||||
iconSize={SessionIconSize.Large}
|
||||
onClick={props.onJoinClick}
|
||||
/>
|
||||
<span className="group-details">
|
||||
<span className="group-name">{props.serverName}</span>
|
||||
<span className="group-type">{openGroupInvitation}</span>
|
||||
<span className="group-address">{props.serverAddress}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue