better distinction of partners

develop
Morisse 6 years ago
parent fbc5f7767d
commit 97d3096654
  1. 4
      .eslintrc.js
  2. 14
      src/App.js
  3. 16
      src/CollapsableRightPanel.js
  4. 5
      src/User.css
  5. 4
      src/UserTable.js

@ -53,10 +53,6 @@ module.exports = {
// rules we do not want from the google styleguide
"object-curly-spacing": ["off"],
"spaced-comment": ["off"],
// in principle we prefer single quotes, but life is too short
quotes: ["off"],
// rules we'd ideally like to adhere to, but the current
// code does not (in most cases because it's still ES5)
// we set these to warnings, and assert that the number

@ -28,14 +28,14 @@ class App extends Component {
const loginRequest = await fetch( homeserver + '_matrix/client/r0/login', {
method: 'POST',
body: JSON.stringify({
"initial_device_display_name": "Web setup account",
"user": userName,
"password": password,
"type": "m.login.password",
'initial_device_display_name': 'Web setup account',
'user': userName,
'password': password,
'type': 'm.login.password',
}),
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
'Content-Type': 'application/json',
'Accept': 'application/json',
},
});
const loginData = JSON.parse(await loginRequest.text());
@ -55,7 +55,7 @@ class App extends Component {
getServerName() {
const currentLocation = window.location.hostname;
console.log(currentLocation);
return "https://localhost:8448/";
return 'https://localhost:8448/';
}
onNameChange = (evt) => {

@ -43,17 +43,22 @@ export default class CollapsableRightPanel extends Component {
this.setState({emailValue: ''});
}
render() {
let upgradePartner;
let isPartner;
let editEmail;
let bsStyle;
let title;
bsStyle = 'primary';
title = 'User';
const open = this.props.data ? true : false;
if (this.props.data['partner']=== 'true') {
isPartner = true;
}
if (isPartner) {
upgradePartner=<Button bsStyle='primary'>Upgrade to member</Button>;
bsStyle='warning';
title='Partner';
}
editEmail=
<td>
@ -87,9 +92,9 @@ export default class CollapsableRightPanel extends Component {
<Collapse in={open} dimension='width' timeout={0}>
<div>
<Panel bsStyle='primary' className='panel'>
<Panel bsStyle={bsStyle} className='panel'>
<Panel.Heading>
<Panel.Title componentClass='h3'>User : { this.props.data['userId'] }</Panel.Title>
<Panel.Title componentClass='h3'>{ title } : { this.props.data['userId'] }</Panel.Title>
</Panel.Heading>
<div className='pannelContainer'>
@ -115,8 +120,9 @@ export default class CollapsableRightPanel extends Component {
</tbody>
</Table>
</Well>
{ upgradePartner }
<Button bsStyle='primary'>Reset Password</Button>
<div className='bottomButton'>
{ upgradePartner }
<Button bsStyle='primary'>Reset Password</Button></div>
</div>
</Panel>
</div>

@ -37,3 +37,8 @@
font-size: 14px;
font-weight: 700;
}
.bottomButton{
display: flex;
justify-content: space-around;
}

@ -13,10 +13,10 @@ export default class UserTable extends Component {
}
componentDidMount() {
document.addEventListener("keydown", this.escFunction, false);
document.addEventListener('keydown', this.escFunction, false);
}
componentWillUnmount() {
document.removeEventListener("keydown", this.escFunction, false);
document.removeEventListener('keydown', this.escFunction, false);
}
onUserSelected = (data) => {

Loading…
Cancel
Save