-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c937178
commit 19a1e5d
Showing
9 changed files
with
83 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/Member.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useParticipants } from '@livekit/components-react'; | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Icon, UserListItem } from '@capital/component'; | ||
import { useEvent } from '@capital/common'; | ||
import type { Participant } from 'livekit-client'; | ||
import { Translate } from '../../translate'; | ||
|
||
const MemberList = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
width: clamp(200px, 55ch, 60ch); | ||
background-color: var(--lk-bg2); | ||
border-left: 1px solid var(--lk-border-color); | ||
padding: 8px; | ||
`; | ||
|
||
const IsSpeakingTip = styled.div` | ||
font-size: 12px; | ||
opacity: 0.6; | ||
`; | ||
|
||
export const Member: React.FC = React.memo(() => { | ||
const participants = useParticipants(); | ||
|
||
const getAction = useEvent((participant: Participant) => { | ||
return [ | ||
!participant.isSpeaking && ( | ||
<IsSpeakingTip>({Translate.isSpeaking})</IsSpeakingTip> | ||
), | ||
<div key="mic-state"> | ||
{participant.isMicrophoneEnabled ? ( | ||
<Icon icon="mdi:microphone" /> | ||
) : ( | ||
<Icon icon="mdi:microphone-off" /> | ||
)} | ||
</div>, | ||
]; | ||
}); | ||
|
||
return ( | ||
<MemberList> | ||
{participants.map((member) => ( | ||
<UserListItem | ||
key={member.sid} | ||
userId={member.identity} | ||
actions={getAction(member)} | ||
/> | ||
))} | ||
</MemberList> | ||
); | ||
}); | ||
Member.displayName = 'Member'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
...com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/icons/ChatIcon.tsx
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...om.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/lib/icons/LeaveIcon.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters