diff --git a/packages/uiweb/src/lib/components/space/SpaceFeed/SpaceFeed.tsx b/packages/uiweb/src/lib/components/space/SpaceFeed/SpaceFeed.tsx index 485eff9b8..187b95df8 100644 --- a/packages/uiweb/src/lib/components/space/SpaceFeed/SpaceFeed.tsx +++ b/packages/uiweb/src/lib/components/space/SpaceFeed/SpaceFeed.tsx @@ -187,10 +187,10 @@ export const SpaceFeed: React.FC = ({ padding: "10px", }} > - {orientation === OrientationEnums.Horizontal ? ( - - {orientation === OrientationEnums.Horizontal - ? mySpaces && + {orientation === OrientationEnums.Horizontal ? ( + + {orientation === OrientationEnums.Horizontal + ? mySpaces && mySpaces.apiData?.map((space: SpaceIFeeds) => { return ( = ({ /> ); }) - : mySpaces && + : mySpaces && mySpaces.apiData?.map((space: SpaceIFeeds) => { return ( = ({ /> ); })} - - ) : ( - <> - - - {sortingOrder.map((tabName: TabsValues) => { - return ( - setSelectedFeedTab(FeedTabs[tabName])} - > - {FeedTabs[tabName]} - - ); - })} - - + + ) : ( + <> + + + {sortingOrder.map((tabName: TabsValues) => { + return ( + setSelectedFeedTab(FeedTabs[tabName])} + > + {FeedTabs[tabName]} + + ); + })} + + = ({ )} {loading && } + diff --git a/packages/uiweb/src/lib/components/space/SpaceWidget/LiveSpaceProfileContainer.tsx b/packages/uiweb/src/lib/components/space/SpaceWidget/LiveSpaceProfileContainer.tsx index 0c5205658..206856d29 100644 --- a/packages/uiweb/src/lib/components/space/SpaceWidget/LiveSpaceProfileContainer.tsx +++ b/packages/uiweb/src/lib/components/space/SpaceWidget/LiveSpaceProfileContainer.tsx @@ -41,7 +41,7 @@ export const LiveSpaceProfileContainer = ( const { spacesObjectRef, -} = useSpaceData(); + } = useSpaceData(); const handleDDState = () => { setIsDDOpen(!isDDOpen); @@ -49,21 +49,21 @@ export const LiveSpaceProfileContainer = ( const inviteListener = async () => { await spacesObjectRef?.current?.inviteToPromote?.({ role: 'SPEAKER', inviteeAddress: pCAIP10ToWallet(wallet) }) -} + } useEffect(() => { const handleOutsideClick = (event: any) => { - if (dropdownRef.current && !dropdownRef.current.contains(event.target)) { - setIsDDOpen(false); - } + if (dropdownRef.current && !dropdownRef.current.contains(event.target)) { + setIsDDOpen(false); + } }; document.addEventListener('mousedown', handleOutsideClick); return () => { - document.removeEventListener('mousedown', handleOutsideClick); + document.removeEventListener('mousedown', handleOutsideClick); }; -}, []); + }, []); return ( @@ -82,7 +82,7 @@ export const LiveSpaceProfileContainer = ( cursor='pointer' onClick={handleDDState} /> - + {wallet.replace('eip155:', '').slice(0, -36) + '...'} {stream && } @@ -127,13 +127,13 @@ export const LiveSpaceProfileContainer = ( )} - {/* {isDDOpen ? ( + {isDDOpen ? ( Invite to Speak - Kick Listener - Mute + {/* Mute + Kick Listener */} - ) : null} */} + ) : null} ); }; diff --git a/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx b/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx index 33e1a00cb..a79538d64 100644 --- a/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx +++ b/packages/uiweb/src/lib/components/space/SpaceWidget/LiveWidgetContent.tsx @@ -16,6 +16,7 @@ import { Button, Image, Item, Text } from '../../../config'; import MicOnIcon from '../../../icons/micon.svg'; import MicEngagedIcon from '../../../icons/MicEngage.svg'; import MuteIcon from '../../../icons/Muted.svg'; +import HandIcon from '../../../icons/hand.svg'; import ShareIcon from '../../../icons/Share.svg'; import MembersIcon from '../../../icons/Members.svg'; import { useSpaceData } from '../../../hooks'; @@ -34,6 +35,7 @@ export const LiveWidgetContent: React.FC = ({ isHost, setSpaceStatusState, }) => { + console.log("🚀 ~ file: LiveWidgetContent.tsx:37 ~ spaceData:", spaceData) const [showMembersModal, setShowMembersModal] = useState(false); const [playBackUrl, setPlayBackUrl] = useState(''); const [isLoading, setIsLoading] = useState(false); @@ -55,6 +57,7 @@ export const LiveWidgetContent: React.FC = ({ initSpaceObject, raisedHandInfo, } = useSpaceData(); + console.log("🚀 ~ file: LiveWidgetContent.tsx:59 ~ spaceObjectData:", spaceObjectData) const isMicOn = spaceObjectData?.connectionData?.local?.audio; @@ -210,95 +213,121 @@ export const LiveWidgetContent: React.FC = ({ - {/* local peer details if speaker or host */} - {(isSpeaker || isHost) && ( - - )} - - {/* details of peer connected via webRTC if speaker or host */} - {(isSpeaker || isHost) && - spaceObjectData?.connectionData?.incoming - ?.slice(1) - .map((profile) => ( - - ))} - - {/* details of host in the space if listener */} - {isListener && !isHost && ( -
- -
- )} - {/* details of speakers in the space if listener */} - {isListener && - !isHost && - spaceObjectData?.liveSpaceData.speakers.map((profile) => ( -
- -
- ))} - - {/* details of listeners */} - {spaceObjectData?.liveSpaceData.listeners.map((profile) => ( -
- -
- ))} + { + isJoined + ? + <> + {/* local peer details if speaker or host */} + {(isSpeaker || isHost) && ( +
+ +
+ )} + + {/* details of peer connected via webRTC if speaker or host */} + {(isSpeaker || isHost) && + spaceObjectData?.connectionData?.incoming + ?.slice(1) + .map((profile) => ( +
+ +
+ ))} + + {/* details of host in the space if listener */} + {isListener && !isHost && ( +
+ +
+ )} + + {/* details of speakers in the space if listener */} + {isListener && + !isHost && + spaceObjectData?.liveSpaceData.speakers.map((profile) => ( +
+ +
+ ))} + + {/* details of listeners */} + {spaceObjectData?.liveSpaceData.listeners.map((profile) => ( +
+ +
+ ))} + + : + spaceData?.members + .map((profile) => ( +
+ +
+ )) + }
+ {isJoined ? ( = ({ ? isMicOn ? MicEngagedIcon : MuteIcon - : MicOnIcon + : isRequestedForMic + ? HandIcon + : MicOnIcon } alt="Mic Icon" /> @@ -339,17 +370,20 @@ export const LiveWidgetContent: React.FC = ({ ? isMicOn ? 'Speaking' : 'Muted' - : 'Request'} + : isRequestedForMic + ? 'Requested' + : 'Request' + } { isHost && numberOfRequests ? - - { numberOfRequests } - - : null + + {numberOfRequests} + + : null } = (props) => { const response = await PushAPI.space.update(spaceUpdate); console.log(response); - } catch (e:any) { + } catch (e: any) { console.error(e.message); } finally { setLoading(false); @@ -86,78 +86,84 @@ export const SpacesInfo: React.FC = (props) => { width='400px' > - - - - - - {spaceData?.spaceName} - {spaceData?.spaceDescription} - - - - - - {spaceData?.pendingMembers && - spaceData.pendingMembers.map((item: any) => { - return + + + + + {spaceData?.spaceName} + {spaceData?.spaceDescription} + + + + + { + spaceData?.pendingMembers?.length ? + + {spaceData?.pendingMembers && + spaceData.pendingMembers.map((item: any) => { + return + }) + } + + : null + } + + + {adminsArray && + adminsArray.slice(1).map((item: any) => { + return + }) + } + + + { + isInviteVisible ? + - }) + : null } - - - {adminsArray && - adminsArray.slice(1).map((item: any) => { - return - }) - } - - { - isInviteVisible ? - - : null - } ) @@ -182,3 +188,10 @@ const Title = styled.div` const Description = styled.div` color: ${(props => props.theme?.textColorSecondary)}; `; + +const AdminsList = styled.div` + display: flex; + flex-direction: column; + gap: 8px; + margin-top: 8px; +`; diff --git a/packages/uiweb/src/lib/components/space/SpaceWidget/WidgetHeader.tsx b/packages/uiweb/src/lib/components/space/SpaceWidget/WidgetHeader.tsx index 49f354ef7..8be99aca9 100644 --- a/packages/uiweb/src/lib/components/space/SpaceWidget/WidgetHeader.tsx +++ b/packages/uiweb/src/lib/components/space/SpaceWidget/WidgetHeader.tsx @@ -88,55 +88,55 @@ export const WidgetHeader: React.FC = ({ {(isSpaceLive === SpaceStatus.Scheduled || isSpaceLive === SpaceStatus.Ended) && ( -
- - - - - {/* {isHost && } */} - - Settings icon - - - setIsMinimized(!isMinimized)} - src={isMinimized ? CaretUpIcon : CaretDownIcon} - alt="Maximize/Minimize icon" +
+ + - + {/* {isHost && } */} + + Settings icon + + + setIsMinimized(!isMinimized)} + src={isMinimized ? CaretUpIcon : CaretDownIcon} + alt="Maximize/Minimize icon" + /> + + + + - -
- )} +
+ )}
{spaceData?.spaceName || 'Test Space'} @@ -234,16 +234,3 @@ const Section = styled.div<{ marginTop?: string }>` justify-content: space-between; margin-top: ${(props) => props.marginTop}; `; - -const Button = styled.button<{ - padding?: string; - color?: string; -}>` - padding: ${(props) => props.padding ?? '0px'}; - color: ${(props) => props.color ?? 'inherit'}; - margin-left: 10px; - background: ${(props) => props.theme.btnColorPrimary}}; - border-radius: 6px; - border: none; - cursor: pointer; -`; diff --git a/packages/uiweb/src/lib/config/styles.tsx b/packages/uiweb/src/lib/config/styles.tsx index 7bbce9aa6..81d0ffb0e 100644 --- a/packages/uiweb/src/lib/config/styles.tsx +++ b/packages/uiweb/src/lib/config/styles.tsx @@ -16,6 +16,8 @@ const commonStyle = css` flex-direction: ${(props) => props.flexDirection}; flex-wrap: ${(props) => props.flexWrap}; gap: ${(props) => props.gap}; + grid-template-columns: ${(props) => props.gridTemplateColumns}; + grid-template-rows: ${(props) => props.gridTemplateRows}; align-self: ${(props) => props.alignSelf}; align-items: ${(props) => props.alignItems}; align-content: ${(props) => props.alignContent}; @@ -29,6 +31,7 @@ const commonStyle = css` min-width: ${(props) => props.minWidth}; max-width: ${(props) => props.maxWidth}; overflow-y: ${(props) => props.overflowY}; + overflow-x: ${(props) => props.overflowX}; font-size: ${(props) => props.fontSize}; font-weight: ${(props) => props.fontWeight}; text-align: ${(props) => props.textAlign};