Skip to content

Commit

Permalink
rename adduser to addfriend
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Jul 28, 2017
1 parent e7f9f8e commit e6a79f0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import classes from './style.css';

@inject(stores => ({
me: stores.session.user,
show: stores.adduser.show,
close: () => stores.adduser.toggle(false),
sendRequest: stores.adduser.sendRequest,
show: stores.addfriend.show,
close: () => stores.addfriend.toggle(false),
sendRequest: stores.addfriend.sendRequest,
}))
@observer
export default class AddUser extends Component {
sendRequest() {
export default class AddFriend extends Component {
addFriend() {
this.props.sendRequest(this.refs.input.value);
this.props.close();
}
Expand All @@ -29,7 +29,7 @@ export default class AddUser extends Component {
<input type="text" defaultValue={`Hallo, im ${me && me.User.NickName}`} autoFocus={true} ref="input" />

<div>
<button onClick={e => this.sendRequest()}>Send</button>
<button onClick={e => this.addFriend()}>Send</button>

<button onClick={e => close()}>Cancel</button>
</div>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/js/pages/Home/ChatContent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import helper from 'utils/helper';

return { message, user };
},
showAddFriend: (user) => stores.adduser.toggle(true, user),
showAddFriend: (user) => stores.addfriend.toggle(true, user),
}))
@observer
export default class ChatContent extends Component {
Expand Down
4 changes: 2 additions & 2 deletions src/js/pages/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Header from './Header';
import Footer from './Footer';
import Login from './Login';
import UserInfo from './UserInfo';
import AddUser from './AddUser';
import AddFriend from './AddFriend';

@inject(stores => ({
isLogin: () => !!stores.session.auth,
Expand All @@ -34,7 +34,7 @@ export default class Layout extends Component {
</div>
<Footer location={this.props.location} />
<UserInfo />
<AddUser />
<AddFriend />
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/pages/UserInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Modal, ModalBody } from 'components/Modal';
updateUser(user);
filter(filtered.query);
},
showAddFriend: (user) => stores.adduser.toggle(true, user),
showAddFriend: (user) => stores.addfriend.toggle(true, user),
isme: () => {
return stores.session.user
&& stores.userinfo.user.UserName === stores.session.user.User.UserName;
Expand Down
4 changes: 2 additions & 2 deletions src/js/stores/adduser.js → src/js/stores/addfriend.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import axios from 'axios';

import storage from 'utils/storage';

class AddUser {
class AddFriend {
@observable show = false;
user;

Expand Down Expand Up @@ -37,5 +37,5 @@ class AddUser {
}
}

const self = new AddUser();
const self = new AddFriend();
export default self;
4 changes: 2 additions & 2 deletions src/js/stores/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

import session from './session';
import home from './home';
import adduser from './adduser';
import addfriend from './addfriend';
import userinfo from './userinfo';
import contacts from './contacts';
import settings from './settings';

export default {
session,
home,
adduser,
addfriend,
userinfo,
contacts,
settings,
Expand Down

0 comments on commit e6a79f0

Please sign in to comment.