From c1c3bed5f5c9b847a3312ac7ab5e848d394cd638 Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 18 Jul 2020 23:51:59 -0500 Subject: [PATCH] fix: user actions --- src/client/chat--rightUsers.jsx | 67 +++++++++++++++++++-------------- src/common/state/user.js | 5 +++ 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/src/client/chat--rightUsers.jsx b/src/client/chat--rightUsers.jsx index e697c2a..da75096 100644 --- a/src/client/chat--rightUsers.jsx +++ b/src/client/chat--rightUsers.jsx @@ -4,6 +4,7 @@ import React from 'react'; import {useSelector} from 'react-redux'; import {channelUsersSelector} from '~/common/state/chat'; +import {redditUsernameSelector} from '~/common/state/user'; import {usernamesSelector} from '~/common/state/usernames'; import useChannel from '~/client/hooks/useChannel'; @@ -13,43 +14,51 @@ import Channel from './channel'; export default function ChatRightUsers() { const channel = useChannel(); const ids = useSelector((state) => channelUsersSelector(state, channel)); + const redditUsername = useSelector(redditUsernameSelector); const usernames = useSelector(usernamesSelector); const list = ids.map((id) => usernames[id]).sort(); - const usersActions = [ - { - icon: '❤️', - label: 'Favorite', - onClick: () => {}, - }, - { - icon: '🚫', - label: 'Unfriend', - onClick: () => {}, - }, - { - icon: '☢️', - label: 'Block', - onClick: () => {}, - }, - ]; return (

Who's here

); diff --git a/src/common/state/user.js b/src/common/state/user.js index 64b2542..458b839 100644 --- a/src/common/state/user.js +++ b/src/common/state/user.js @@ -45,6 +45,11 @@ export const activeFriendshipSelector = createSelector( (friendship) => Object.values(friendship).filter(({state}) => 'active' === state), ); +export const isAnonymousSelector = createSelector( + [userSelector], + ({isAnonymous}) => isAnonymous, +); + export const pendingFriendshipSelector = createSelector( friendshipSelector, (friendship) => Object.values(friendship).filter(({state}) => 'pending' === state),