Refactor Welcome

This commit is contained in:
Jeremie Pardou-Piquemal 2022-12-15 22:02:51 +01:00
parent 6e237d72fd
commit a49db05eb9

View File

@ -1,16 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import RoomLink from '@/components/RoomLink';
class Welcome extends Component {
constructor(props) {
super(props);
this.state = {
roomUrl: `https://darkwire.io/${props.roomId}`,
};
}
render() {
const Welcome = ({ roomId, translations, close }) => {
return (
<div>
<div>
@ -32,16 +23,15 @@ class Welcome extends Component {
</div>
<br />
<p className="mb-2">Others can join this room using the following URL:</p>
<RoomLink roomId={this.props.roomId} translations={this.props.translations} />
<RoomLink roomId={roomId} translations={translations} />
<div className="react-modal-footer">
<button className="btn btn-primary btn-lg" onClick={this.props.close}>
{this.props.translations.welcomeModalCTA}
<button className="btn btn-primary btn-lg" onClick={close}>
{translations.welcomeModalCTA}
</button>
</div>
</div>
);
}
}
};
Welcome.propTypes = {
roomId: PropTypes.string.isRequired,