2023-09-14 00:37:40 +08:00
|
|
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
2023-07-25 02:56:40 +08:00
|
|
|
import styled, { css, keyframes } from 'styled-components';
|
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
|
|
|
import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints';
|
|
|
|
import { colorWhite } from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import { smPaddingX, smPaddingY } from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
|
2024-08-06 01:19:34 +08:00
|
|
|
const pulse = keyframes`
|
|
|
|
0% {
|
|
|
|
box-shadow: 0 0 0 0 white;
|
|
|
|
}
|
|
|
|
70% {
|
|
|
|
box-shadow: 0 0 0 0.5625rem transparent;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
box-shadow: 0 0 0 0 transparent;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-08-15 04:52:35 +08:00
|
|
|
// @ts-ignore - as button comes from JS, we can't provide its props
|
2023-07-25 02:56:40 +08:00
|
|
|
const LeaveButtonWithoutLiveStreamSelector = styled(Button)`
|
2023-09-14 00:37:40 +08:00
|
|
|
${({ ghost }) => ghost && `
|
2023-07-25 02:56:40 +08:00
|
|
|
span {
|
|
|
|
background-color: transparent !important;
|
|
|
|
border-color: ${colorWhite} !important;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
2023-08-15 04:52:35 +08:00
|
|
|
// @ts-ignore - as button comes from JS, we can't provide its props
|
2023-07-25 02:56:40 +08:00
|
|
|
const MuteToggleButton = styled(Button)`
|
|
|
|
margin-right: ${smPaddingX};
|
|
|
|
margin-left: 0;
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
margin-right: ${smPaddingY};
|
|
|
|
}
|
|
|
|
|
|
|
|
[dir='rtl'] & {
|
|
|
|
margin-left: ${smPaddingX};
|
|
|
|
margin-right: 0;
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
margin-left: ${smPaddingY};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-14 00:37:40 +08:00
|
|
|
${({ ghost }) => ghost && `
|
2023-07-25 02:56:40 +08:00
|
|
|
span {
|
|
|
|
background-color: transparent !important;
|
|
|
|
border-color: ${colorWhite} !important;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
|
2023-09-14 00:37:40 +08:00
|
|
|
${({ talking }) => talking && `
|
2023-07-25 02:56:40 +08:00
|
|
|
border-radius: 50%;
|
|
|
|
`}
|
|
|
|
|
2023-09-14 00:37:40 +08:00
|
|
|
${({ talking, animations }) => talking && animations && css`
|
2023-07-25 02:56:40 +08:00
|
|
|
animation: ${pulse} 1s infinite ease-in;
|
|
|
|
`}
|
|
|
|
|
2023-09-14 00:37:40 +08:00
|
|
|
${({ talking, animations }) => talking && !animations && css`
|
2023-07-25 02:56:40 +08:00
|
|
|
& span {
|
|
|
|
content: '';
|
|
|
|
outline: none !important;
|
|
|
|
background-clip: padding-box;
|
|
|
|
box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Container = styled.span`
|
|
|
|
display: flex;
|
|
|
|
flex-flow: row;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
& > div {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > :last-child {
|
|
|
|
margin-right: 0;
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
margin-left: ${smPaddingY};
|
|
|
|
}
|
|
|
|
|
|
|
|
[dir='rtl'] & {
|
|
|
|
margin-left: 0;
|
|
|
|
margin-right: ${smPaddingX};
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
margin-right: ${smPaddingY};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default {
|
|
|
|
LeaveButtonWithoutLiveStreamSelector,
|
|
|
|
MuteToggleButton,
|
|
|
|
Container,
|
|
|
|
};
|