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