Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : added icon to show Update ChannelHeader and RoomInfo UI for (Channels Converted to Teams). #926

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/react/src/store/channelStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ const useChannelStore = create((set) => ({
showChannelinfo: false,
isChannelPrivate: false,
isChannelReadOnly: false,
isRoomTeam: false,
setShowChannelinfo: (showChannelinfo) => set(() => ({ showChannelinfo })),
channelInfo: {},
setChannelInfo: (channelInfo) => set(() => ({ channelInfo })),
setIsChannelPrivate: (isChannelPrivate) => set(() => ({ isChannelPrivate })),
setIsRoomTeam: (isRoomTeam) => set(() => ({ isRoomTeam })),
setIsChannelReadOnly: (isChannelReadOnly) =>
set(() => ({ isChannelReadOnly })),
}));
Expand Down
11 changes: 10 additions & 1 deletion packages/react/src/views/ChatHeader/ChatHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ const ChatHeader = ({
const setIsChannelPrivate = useChannelStore(
(state) => state.setIsChannelPrivate
);
const isRoomTeam = useChannelStore((state) => state.isRoomTeam);
const setIsRoomTeam = useChannelStore((state) => state.setIsRoomTeam);
const setIsChannelReadOnly = useChannelStore(
(state) => state.setIsChannelReadOnly
);
Expand Down Expand Up @@ -177,6 +179,7 @@ const ChatHeader = ({
if (res.success) {
setChannelInfo(res.room);
if (res.room.t === 'p') setIsChannelPrivate(true);
if (res.room?.teamMain) setIsRoomTeam(true);
if (res.room.ro) {
setIsChannelReadOnly(true);
setMessageAllowed();
Expand Down Expand Up @@ -377,7 +380,13 @@ const ChatHeader = ({
onClick={() => setExclusiveState(setShowChannelinfo)}
>
<Icon
name={isChannelPrivate ? 'hash_lock' : 'hash'}
name={
isRoomTeam
? 'team'
: isChannelPrivate
? 'hash_lock'
: 'hash'
}
size={fullScreen ? '1.25rem' : '1rem'}
/>
<div
Expand Down
8 changes: 5 additions & 3 deletions packages/react/src/views/RoomInformation/RoomInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Roominfo = () => {
const styles = getRoomInformationStyles();
const channelInfo = useChannelStore((state) => state.channelInfo);
const isChannelPrivate = useChannelStore((state) => state.isChannelPrivate);
const isRoomTeam = useChannelStore((state) => state.isRoomTeam);
const { variantOverrides } = useComponentOverrides('RoomMember');
const viewType = variantOverrides.viewType || 'Sidebar';
const setExclusiveState = useSetExclusiveState();
Expand All @@ -30,7 +31,7 @@ const Roominfo = () => {

return (
<ViewComponent
title="Room Information"
title={isRoomTeam ? 'Team Information' : 'Room Information'}
iconName="info"
onClose={() => setExclusiveState(null)}
style={{ width: '400px', zIndex: window.innerWidth <= 780 ? 1 : null }}
Expand Down Expand Up @@ -59,12 +60,13 @@ const Roominfo = () => {
<Box css={styles.infoContainer}>
<Box css={styles.infoHeader}>
<Icon
name={isChannelPrivate ? 'lock' : 'hash'}
name={
isRoomTeam ? 'team' : isChannelPrivate ? 'hash_lock' : 'hash'
}
size="1.25rem"
css={css`
vertical-align: middle;
margin-right: 0.5rem;
margin-bottom: 0.25rem;
`}
/>
{channelInfo.name}
Expand Down
15 changes: 15 additions & 0 deletions packages/ui-elements/src/components/Icon/icons/Team.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/ui-elements/src/components/Icon/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import Arc from './Arc';
import Avatar from './Avatar';
import FormatText from './FormatText';
import Cog from './Cog';
import Team from './Team';

const icons = {
file: File,
Expand All @@ -76,6 +77,7 @@ const icons = {
computer: Computer,
cross: Cross,
copy: Copy,
team: Team,
mic: Mic,
'video-recorder': VideoRecorder,
'disabled-recorder': DisabledRecorder,
Expand Down
1 change: 1 addition & 0 deletions packages/ui-elements/tools/icons-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const iconsList = [
'computer',
'cross',
'mic',
'team',
'circle-cross',
'circle-check',
'send',
Expand Down
Loading