mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-16 20:20:29 +03:00
refactored ChannelSelector component
This commit is contained in:
parent
9e9ea41bdd
commit
d3506acd94
4 changed files with 139 additions and 83 deletions
|
|
@ -102,6 +102,9 @@ function renderSelector(room, roomId, isSelected, isDM) {
|
|||
return (
|
||||
<ChannelSelector
|
||||
key={roomId}
|
||||
name={room.name}
|
||||
roomId={roomId}
|
||||
imageSrc={isDM ? imageSrc : null}
|
||||
iconSrc={
|
||||
isDM
|
||||
? null
|
||||
|
|
@ -112,16 +115,12 @@ function renderSelector(room, roomId, isSelected, isDM) {
|
|||
return (room.getJoinRule() === 'invite' ? HashLockIC : HashIC);
|
||||
})()
|
||||
}
|
||||
imageSrc={isDM ? imageSrc : null}
|
||||
roomId={roomId}
|
||||
unread={doesRoomHaveUnread(room)}
|
||||
onClick={() => selectRoom(roomId)}
|
||||
isSelected={isSelected}
|
||||
isUnread={doesRoomHaveUnread(room)}
|
||||
notificationCount={room.getUnreadNotificationCount('total')}
|
||||
alert={room.getUnreadNotificationCount('highlight') !== 0}
|
||||
selected={isSelected}
|
||||
>
|
||||
{room.name}
|
||||
</ChannelSelector>
|
||||
isAlert={room.getUnreadNotificationCount('highlight') !== 0}
|
||||
onClick={() => selectRoom(roomId)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,18 @@
|
|||
.channels-container {
|
||||
padding-bottom: var(--sp-extra-loose);
|
||||
|
||||
& > .channel-selector__button-wrapper:first-child {
|
||||
& > .channel-selector {
|
||||
width: calc(100% - var(--sp-extra-tight));
|
||||
margin-left: auto;
|
||||
|
||||
[dir=rtl] & {
|
||||
margin-left: 0;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
& > .channel-selector:first-child {
|
||||
margin-top: var(--sp-extra-tight);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue