2021-11-09 03:54:19 +08:00
|
|
|
import styled from 'styled-components';
|
|
|
|
import {
|
|
|
|
avatarSide,
|
|
|
|
borderSize,
|
|
|
|
avatarInset,
|
|
|
|
smPaddingX,
|
|
|
|
toastIconSide,
|
|
|
|
toastMargin,
|
2022-03-04 02:35:05 +08:00
|
|
|
toastMarginMobile,
|
2021-11-09 03:54:19 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import {
|
|
|
|
colorWhite,
|
|
|
|
colorGrayLighter,
|
|
|
|
colorGrayLight,
|
|
|
|
colorPrimary,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import {
|
|
|
|
fontSizeXL,
|
|
|
|
fontSizeSmall,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/typography';
|
2022-03-04 02:35:05 +08:00
|
|
|
import {
|
|
|
|
smallOnly,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/breakpoints';
|
2022-02-15 04:20:50 +08:00
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
2022-02-16 01:57:50 +08:00
|
|
|
import ToastStyled from '/imports/ui/components/common/toast/styles';
|
2021-11-09 03:54:19 +08:00
|
|
|
|
|
|
|
const Avatar = styled.div`
|
|
|
|
cursor: pointer;
|
|
|
|
outline: transparent;
|
|
|
|
outline-style: dotted;
|
|
|
|
outline-width: ${borderSize};
|
|
|
|
width: ${avatarSide};
|
|
|
|
height: ${avatarSide};
|
|
|
|
color: ${colorWhite};
|
|
|
|
border-radius: 50%;
|
|
|
|
border: solid ${borderSize} ${colorWhite};
|
|
|
|
margin-left: ${avatarInset};
|
|
|
|
text-align: center;
|
|
|
|
padding: 5px 0;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
border: solid ${borderSize} ${colorGrayLighter};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const AvatarsExtra = styled.div`
|
|
|
|
background-color: ${colorGrayLight};
|
|
|
|
outline: transparent;
|
|
|
|
outline-style: dotted;
|
|
|
|
outline-width: ${borderSize};
|
|
|
|
width: ${avatarSide};
|
|
|
|
height: ${avatarSide};
|
|
|
|
color: ${colorWhite};
|
|
|
|
border-radius: 50%;
|
|
|
|
border: solid ${borderSize} ${colorWhite};
|
|
|
|
margin-left: ${avatarInset};
|
|
|
|
text-align: center;
|
|
|
|
padding: 5px 0;
|
|
|
|
`;
|
|
|
|
|
2024-02-07 00:38:17 +08:00
|
|
|
const ToastContent = styled.div`
|
2021-11-09 03:54:19 +08:00
|
|
|
margin-right: ${smPaddingX};
|
2024-02-07 00:38:17 +08:00
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
// justify-content: flex-end;
|
2021-11-09 03:54:19 +08:00
|
|
|
[dir="rtl"] & {
|
|
|
|
margin-right: 0;
|
|
|
|
margin-left: ${smPaddingX};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const IconWrapper = styled.div`
|
|
|
|
background-color: ${colorPrimary};
|
|
|
|
width: ${toastIconSide};
|
|
|
|
height: ${toastIconSide};
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
|
|
& > i {
|
|
|
|
position: relative;
|
|
|
|
color: ${colorWhite};
|
|
|
|
top: ${toastMargin};
|
|
|
|
left: ${toastMargin};
|
|
|
|
font-size: ${fontSizeXL};
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
left: 0;
|
|
|
|
right: 10px;
|
|
|
|
}
|
2022-03-04 02:35:05 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
{
|
|
|
|
top: ${toastMarginMobile};
|
|
|
|
left: ${toastMarginMobile};
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
left: 0;
|
|
|
|
right: ${toastMargin};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-09 03:54:19 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ToastMessage = styled.div`
|
|
|
|
font-size: ${fontSizeSmall};
|
|
|
|
margin-top: ${toastMargin};
|
|
|
|
|
|
|
|
& > div {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ClearButton = styled(Button)`
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
margin-top: ${toastMargin};
|
|
|
|
color: ${colorPrimary};
|
|
|
|
|
|
|
|
&:focus,
|
|
|
|
&:hover,
|
|
|
|
&:active {
|
|
|
|
color: ${colorPrimary};
|
|
|
|
box-shadow: 0;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2021-11-11 19:47:39 +08:00
|
|
|
const ToastSeparator = styled(ToastStyled.Separator)``;
|
|
|
|
|
2021-11-09 03:54:19 +08:00
|
|
|
export default {
|
|
|
|
Avatar,
|
|
|
|
AvatarsExtra,
|
2024-02-07 00:38:17 +08:00
|
|
|
ToastContent,
|
2021-11-09 03:54:19 +08:00
|
|
|
IconWrapper,
|
|
|
|
ToastMessage,
|
|
|
|
ClearButton,
|
2021-11-11 19:47:39 +08:00
|
|
|
ToastSeparator,
|
2021-11-09 03:54:19 +08:00
|
|
|
};
|