mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-24 17:44:50 +03:00
fix: nits
This commit is contained in:
parent
09a962257f
commit
ff521612b9
@ -242,6 +242,8 @@ function UserEntry({
|
||||
checkStatus,
|
||||
showStatusIndicator,
|
||||
}) {
|
||||
const isOnline = checkStatus({ id: user.id });
|
||||
|
||||
return (
|
||||
<div key={user.username} css={STYLES_USER_ENTRY}>
|
||||
{external ? (
|
||||
@ -254,8 +256,8 @@ function UserEntry({
|
||||
<div
|
||||
css={STYLES_DIRECTORY_STATUS_INDICATOR}
|
||||
style={{
|
||||
borderColor: checkStatus(user.id) && `${Constants.system.active}`,
|
||||
backgroundColor: checkStatus(user.id) && `${Constants.system.active}`,
|
||||
borderColor: isOnline && `${Constants.system.active}`,
|
||||
backgroundColor: isOnline && `${Constants.system.active}`,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@ -274,8 +276,8 @@ function UserEntry({
|
||||
<div
|
||||
css={STYLES_DIRECTORY_STATUS_INDICATOR}
|
||||
style={{
|
||||
borderColor: checkStatus(user.id) && `${Constants.system.active}`,
|
||||
backgroundColor: checkStatus(user.id) && `${Constants.system.active}`,
|
||||
borderColor: isOnline && `${Constants.system.active}`,
|
||||
backgroundColor: isOnline && `${Constants.system.active}`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@ -402,10 +404,9 @@ export default class Profile extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
checkStatus = (userId) => {
|
||||
const activeUsers = this.props.activeUsers;
|
||||
|
||||
return activeUsers && activeUsers.includes(userId);
|
||||
checkStatus = ({ id }) => {
|
||||
const { activeUsers } = this.props;
|
||||
return activeUsers && activeUsers.includes(id);
|
||||
};
|
||||
|
||||
render() {
|
||||
@ -580,9 +581,9 @@ export default class Profile extends React.Component {
|
||||
css={STYLES_STATUS_INDICATOR}
|
||||
style={{
|
||||
borderColor:
|
||||
this.checkStatus(this.props.data?.id) && `${Constants.system.active}`,
|
||||
this.checkStatus({ id: this.props.data?.id }) && `${Constants.system.active}`,
|
||||
backgroundColor:
|
||||
this.checkStatus(this.props.data?.id) && `${Constants.system.active}`,
|
||||
this.checkStatus({ id: this.props.data?.id }) && `${Constants.system.active}`,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
@ -113,6 +113,8 @@ const STYLES_NAME = css`
|
||||
`;
|
||||
|
||||
function UserEntry({ user, button, onClick, message, checkStatus }) {
|
||||
const isOnline = checkStatus({ id: user.id });
|
||||
|
||||
return (
|
||||
<div key={user.username} css={STYLES_USER_ENTRY}>
|
||||
<div css={STYLES_USER} onClick={onClick}>
|
||||
@ -120,8 +122,8 @@ function UserEntry({ user, button, onClick, message, checkStatus }) {
|
||||
<div
|
||||
css={STYLES_STATUS_INDICATOR}
|
||||
style={{
|
||||
borderColor: checkStatus(user.id) && `${Constants.system.active}`,
|
||||
backgroundColor: checkStatus(user.id) && `${Constants.system.active}`,
|
||||
borderColor: isOnline && `${Constants.system.active}`,
|
||||
backgroundColor: isOnline && `${Constants.system.active}`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@ -191,10 +193,10 @@ export default class SceneDirectory extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
checkStatus = (userId) => {
|
||||
const activeUsers = this.props.activeUsers;
|
||||
checkStatus = ({ id }) => {
|
||||
const { activeUsers } = this.props;
|
||||
|
||||
return activeUsers && activeUsers.includes(userId);
|
||||
return activeUsers && activeUsers.includes(id);
|
||||
};
|
||||
|
||||
render() {
|
||||
@ -283,7 +285,7 @@ export default class SceneDirectory extends React.Component {
|
||||
key={relation.id}
|
||||
user={relation.owner}
|
||||
button={button}
|
||||
userOnline={this.checkStatus(relation.id)}
|
||||
checkStatus={this.checkStatus}
|
||||
onClick={() => {
|
||||
this.props.onAction({
|
||||
type: "NAVIGATE",
|
||||
|
Loading…
Reference in New Issue
Block a user