index.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import qrCode from '../../../img/qrCode_telegram.png'
  2. import { makeStyles, Button, } from '@material-ui/core'
  3. const useStyles = makeStyles({
  4. container: {
  5. display: 'flex',
  6. alignItems: 'center',
  7. alignContent:'center',
  8. flexDirection: 'column',
  9. width: 350,
  10. margin: '0 auto',
  11. paddingTop: 64,
  12. paddingBottom: 24,
  13. },
  14. picture: {
  15. marginBottom: 16,
  16. },
  17. title: {
  18. textAlign: 'center',
  19. marginBottom: 16,
  20. },
  21. titleSpan: {
  22. display: 'flex',
  23. justifyContent: 'center',
  24. alignContent: 'center',
  25. alignItems: 'center',
  26. width: 25,
  27. height: 25,
  28. position: 'absolute',
  29. left:780,
  30. backgroundColor: '#5497f0',
  31. borderRadius: '50%',
  32. color: '#ffffff',
  33. },
  34. button: {
  35. marginTop: 20,
  36. height: 50,
  37. color: '#5497f0'
  38. }
  39. })
  40. interface IQRCode {
  41. handleIsQR:() => void
  42. }
  43. const QRCode = ({ handleIsQR }: IQRCode) => {
  44. const classes = useStyles()
  45. return (
  46. <div className={classes.container} >
  47. <img className={classes.picture} alt="QRCode" src={qrCode} width='300' height='300' />
  48. <h2 className={classes.title}>Log in to Telegram by QR Code</h2>
  49. <h3 className={classes.title}>
  50. <span className={classes.titleSpan}>1</span>
  51. Open Telegram on your phone
  52. </h3>
  53. <h3 className={classes.title}>
  54. <span className={classes.titleSpan}>2</span>
  55. {`Go to Settings > Devices > Link Desktop Device`}
  56. </h3>
  57. <h3 className={classes.title}>
  58. <span className={classes.titleSpan}>3</span>
  59. Log in to Telegram by QR Code
  60. </h3>
  61. <Button onClick={handleIsQR}
  62. className={classes.button}
  63. variant="text"
  64. color="default"
  65. fullWidth>
  66. LOG IN BY PHONE NUMBER
  67. </Button>
  68. </div>
  69. );
  70. };
  71. export default QRCode;