✨(frontend) introduce active speaker pushToTalk variant
Will be used to indicate when the push to talk is open. It gives the user a feedback wether or not her mic is active.
This commit is contained in:
committed by
aleb_the_flash
parent
f27d451eb6
commit
62855fe12c
@@ -12,6 +12,19 @@ const StyledContainer = styled('div', {
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
gap: '2px',
|
gap: '2px',
|
||||||
},
|
},
|
||||||
|
variants: {
|
||||||
|
pushToTalk: {
|
||||||
|
true: {
|
||||||
|
height: '46px',
|
||||||
|
width: '58px',
|
||||||
|
borderLeftRadius: 8,
|
||||||
|
borderRightRadius: 0,
|
||||||
|
backgroundColor: '#dbeafe',
|
||||||
|
border: '1px solid #3b82f6',
|
||||||
|
gap: '3px',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const StyledChild = styled('div', {
|
const StyledChild = styled('div', {
|
||||||
@@ -39,13 +52,29 @@ const StyledChild = styled('div', {
|
|||||||
animationName: 'active_speaker_small',
|
animationName: 'active_speaker_small',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
pushToTalk: {
|
||||||
|
true: {
|
||||||
|
backgroundColor: 'primary',
|
||||||
|
width: '6px',
|
||||||
|
height: '6px',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const ActiveSpeaker = ({ isSpeaking }: { isSpeaking: boolean }) => {
|
export type ActiveSpeakerProps = {
|
||||||
|
isSpeaking: boolean
|
||||||
|
pushToTalk?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ActiveSpeaker = ({
|
||||||
|
isSpeaking,
|
||||||
|
pushToTalk,
|
||||||
|
}: ActiveSpeakerProps) => {
|
||||||
return (
|
return (
|
||||||
<StyledContainer>
|
<StyledContainer pushToTalk={pushToTalk}>
|
||||||
<StyledChild
|
<StyledChild
|
||||||
|
pushToTalk={pushToTalk}
|
||||||
active={isSpeaking}
|
active={isSpeaking}
|
||||||
size="small"
|
size="small"
|
||||||
style={{
|
style={{
|
||||||
@@ -53,12 +82,14 @@ export const ActiveSpeaker = ({ isSpeaking }: { isSpeaking: boolean }) => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<StyledChild
|
<StyledChild
|
||||||
|
pushToTalk={pushToTalk}
|
||||||
active={isSpeaking}
|
active={isSpeaking}
|
||||||
style={{
|
style={{
|
||||||
animationDelay: '100ms',
|
animationDelay: '100ms',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<StyledChild
|
<StyledChild
|
||||||
|
pushToTalk={pushToTalk}
|
||||||
active={isSpeaking}
|
active={isSpeaking}
|
||||||
size="small"
|
size="small"
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in New Issue
Block a user