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