From 1bdcfd5cdf74cadf760d6d35c5a355da4d2ec997 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 18 Aug 2021 22:29:00 -0400 Subject: [PATCH] Fix layout --- .../NavigatorRoomSettingsView.scss | 10 ++ .../NavigatorRoomSettingsRightsTabView.tsx | 125 +++++++++++++----- .../user-profile-icon/UserProfileIconView.tsx | 16 +++ .../UserProfileIconView.types.ts | 5 + 4 files changed, 120 insertions(+), 36 deletions(-) create mode 100644 src/views/shared/user-profile-icon/UserProfileIconView.tsx create mode 100644 src/views/shared/user-profile-icon/UserProfileIconView.types.ts diff --git a/src/views/navigator/views/room-settings/NavigatorRoomSettingsView.scss b/src/views/navigator/views/room-settings/NavigatorRoomSettingsView.scss index 0c681ba2..b8d49327 100644 --- a/src/views/navigator/views/room-settings/NavigatorRoomSettingsView.scss +++ b/src/views/navigator/views/room-settings/NavigatorRoomSettingsView.scss @@ -5,6 +5,16 @@ height: 350px; } + .user-rights-container { + + .row { + + .col:nth-child(even) { + //background: $light !important; + } + } + } + .list-container { max-height: 100px; min-height: 100px; diff --git a/src/views/navigator/views/room-settings/views/tab-rights/NavigatorRoomSettingsRightsTabView.tsx b/src/views/navigator/views/room-settings/views/tab-rights/NavigatorRoomSettingsRightsTabView.tsx index 30f0a160..4b63cc4d 100644 --- a/src/views/navigator/views/room-settings/views/tab-rights/NavigatorRoomSettingsRightsTabView.tsx +++ b/src/views/navigator/views/room-settings/views/tab-rights/NavigatorRoomSettingsRightsTabView.tsx @@ -2,6 +2,7 @@ import { RemoveAllRightsMessageComposer, RoomGiveRightsComposer, RoomTakeRightsC import { FC, useCallback, useMemo } from 'react'; import { LocalizeText } from '../../../../../../api'; import { SendMessageHook } from '../../../../../../hooks'; +import { UserProfileIconView } from '../../../../../shared/user-profile-icon/UserProfileIconView'; import { NavigatorRoomSettingsTabViewProps } from '../../NavigatorRoomSettingsView.types'; export const NavigatorRoomSettingsRightsTabView: FC = props => @@ -52,48 +53,100 @@ export const NavigatorRoomSettingsRightsTabView: FC +
-
-
{LocalizeText('navigator.flatctrls.userswithrights', ['displayed', 'total'], [roomSettingsData.usersWithRights.size.toString(), roomSettingsData.usersWithRights.size.toString()])}
-
-
-
{LocalizeText('navigator.flatctrls.friends', ['displayed', 'total'], [friendsWithoutRights.size.toString(), friendsWithoutRights.size.toString()])}
+
+ filter
-
-
- { - Array.from(roomSettingsData.usersWithRights.entries()).map(([id, name], index) => - { - return
- {name} - -
- }) - } +
+
{ LocalizeText('navigator.flatctrls.userswithrights', [ 'displayed', 'total' ], [ roomSettingsData.usersWithRights.size.toString(), roomSettingsData.usersWithRights.size.toString() ]) }
+
+
+ { Array.from(roomSettingsData.usersWithRights.entries()).map(([id, name], index) => + { + return ( +
removeUserRights(id) }> +
+ + { name } +
+ +
+ ); + }) + } +
+
-
-
-
- { - Array.from(friendsWithoutRights.entries()).map(([id, name], index) => - { - return
- {name} - -
- }) - } +
+
{ LocalizeText('navigator.flatctrls.friends', [ 'displayed', 'total' ], [ friendsWithoutRights.size.toString(), friendsWithoutRights.size.toString() ]) }
+
+
+ { Array.from(friendsWithoutRights.entries()).map(([id, name], index) => + { + return ( +
giveUserRights(id, name) }> + +
+ + { name } +
+
+ ); + }) + } +
-
-
- +
+
+
+ //
+ //
+ //
{LocalizeText('navigator.flatctrls.userswithrights', ['displayed', 'total'], [roomSettingsData.usersWithRights.size.toString(), roomSettingsData.usersWithRights.size.toString()])}
+ //
+ //
+ //
{LocalizeText('navigator.flatctrls.friends', ['displayed', 'total'], [friendsWithoutRights.size.toString(), friendsWithoutRights.size.toString()])}
+ //
+ //
+ //
+ //
+ //
+ // { + // Array.from(roomSettingsData.usersWithRights.entries()).map(([id, name], index) => + // { + // return ( + //
+ // {name} + // + //
+ // ); + // }) + // } + //
+ // + //
+ //
+ //
+ // { + // Array.from(friendsWithoutRights.entries()).map(([id, name], index) => + // { + // return ( + //
+ // {name} + // + //
+ // ); + // }) + // } + //
+ //
+ //
); } diff --git a/src/views/shared/user-profile-icon/UserProfileIconView.tsx b/src/views/shared/user-profile-icon/UserProfileIconView.tsx new file mode 100644 index 00000000..6d1c2dc6 --- /dev/null +++ b/src/views/shared/user-profile-icon/UserProfileIconView.tsx @@ -0,0 +1,16 @@ +import { FC, useCallback } from 'react'; +import { UserProfileIconViewProps } from './UserProfileIconView.types'; + +export const UserProfileIconView: FC = props => +{ + const { userId = -1, userName = null } = props; + + const visitProfile = useCallback(() => + { + + }, [ userId, userName ]); + + return ( + + ); +} diff --git a/src/views/shared/user-profile-icon/UserProfileIconView.types.ts b/src/views/shared/user-profile-icon/UserProfileIconView.types.ts new file mode 100644 index 00000000..1662dfa8 --- /dev/null +++ b/src/views/shared/user-profile-icon/UserProfileIconView.types.ts @@ -0,0 +1,5 @@ +export interface UserProfileIconViewProps +{ + userId?: number; + userName?: string; +}