You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DialInLimit.tsx 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import React from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { makeStyles } from 'tss-react/mui';
  4. import { translate } from '../../../../base/i18n/functions';
  5. import { withPixelLineHeight } from '../../../../base/styles/functions.web';
  6. import { UPGRADE_OPTIONS_LINK, UPGRADE_OPTIONS_TEXT } from '../../../constants';
  7. const useStyles = makeStyles()(theme => {
  8. return {
  9. limitContainer: {
  10. backgroundColor: theme.palette.warning01,
  11. borderRadius: '6px',
  12. padding: '8px 16px'
  13. },
  14. limitInfo: {
  15. color: theme.palette.text.primary,
  16. ...withPixelLineHeight(theme.typography.bodyShortRegular)
  17. },
  18. link: {
  19. color: `${theme.palette.text.primary} !important`,
  20. fontWeight: 'bold',
  21. textDecoration: 'underline'
  22. }
  23. };
  24. });
  25. /**
  26. * Component that displays a message when the dial in limit is reached.
  27. * * @param {Function} t - Function which translate strings.
  28. *
  29. * @returns {ReactElement}
  30. */
  31. const DialInLimit: React.FC<WithTranslation> = ({ t }) => {
  32. const { classes } = useStyles();
  33. return (
  34. <div className = { classes.limitContainer }>
  35. <span className = { classes.limitInfo }>
  36. <b>{ `${t('info.dialInNumber')} ` }</b>
  37. { `${t('info.reachedLimit')} `}
  38. { `${t('info.upgradeOptions')} ` }
  39. <a
  40. className = { classes.link }
  41. href = { UPGRADE_OPTIONS_LINK }
  42. rel = 'noopener noreferrer'
  43. target = '_blank'>
  44. { `${UPGRADE_OPTIONS_TEXT}` }
  45. </a>
  46. .
  47. </span>
  48. </div>
  49. );
  50. };
  51. export default translate(DialInLimit);