style.js 2.03 KB
/** @format */

import styled from 'styled-components';
import KeyboardBackspaceIcon from '@mui/icons-material/KeyboardBackspace';
import { boxDialerWidjetPosition } from '../../lib/boxDialerWidjetPosition';

const ModalPhoneNumpadStyle = styled.div`
	width: 230px;
	position: fixed;
	bottom: 120px;
	transition: 0.2s;
	z-index: 999;
	${({ hidden, position, variant }) =>
		hidden
			? boxDialerWidjetPosition[variant][position].numpad.hidden
			: boxDialerWidjetPosition[variant][position].numpad.seen}

	background-color: #c9d5d9;
	border-radius: 20px;
	padding: 15px;
	display: grid;
	grid-template-rows: 40px 1fr;
	grid-gap: 15px;
	cursor: default;
`;
ModalPhoneNumpadStyle.InputArea = styled.div`
	position: relative;
`;
ModalPhoneNumpadStyle.ButtonArea = styled.div`
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	grid-gap: 8px;
`;
const Input = styled.input`
	width: 100%;
	height: 100%;
	border-radius: 3px;
	background-color: #fff;
	border: 0;
	padding: 0 35px 0 10px;
	font-size: 22px;
	color: #000;

	:focus {
		border-color: inherit;
		-webkit-box-shadow: none;
		box-shadow: none;
		padding: 0 10px;
		font-size: 24px;
		outline: 0 none;
	}

	position: relative;
	display: inline-block;
	margin: 0;
	outline: none;

	&::-webkit-outer-spin-button,
	&::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}

	/* Firefox */

	&[type='number'] {
		-moz-appearance: textfield;
	}
`;
Input.BackSpaceIcon = styled(KeyboardBackspaceIcon)`
	color: black;
	position: absolute;
	right: 5px;
	cursor: pointer;
	top: 50%;
	transform: translate(0, -50%);
`;

const NumberButton = styled.div`
	color: #fff;
	font-weight: bold;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 7px;
	font-size: 22px;
	cursor: pointer;
	height: 33px;
	background-color: ${({ status, type }) =>
		type === 'call_button'
			? status === 'pending'
				? 'orange'
				: status === 'connected' && '#a0c13d'
			: '#5e5e5e'};
`;
NumberButton.Icon = styled.div`
	font-size: 20px;
`;

export { NumberButton, Input };
export default ModalPhoneNumpadStyle;