ChoosePlatform.tsx 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { useTranslation } from 'react-i18next';
  2. import btnAndroid from '@/assets/images/home/btn-android.svg';
  3. import btnAppStore from '@/assets/images/home/btn-app-store.svg';
  4. import btnGooglePlay from '@/assets/images/home/btn-google-play.svg';
  5. import btnMacos from '@/assets/images/home/btn-macos.svg';
  6. import btnWindows from '@/assets/images/home/btn-windows.svg';
  7. // import devicesMockup from '@/assets/images/home/devices-mockup.png';
  8. import { /*useAppUrls,*/ type AppUrls } from '@/hooks/useAppUrls';
  9. import { useComingSoonDialog } from '@/hooks/useComingSoonDialog';
  10. import Wrapper from './Wrapper';
  11. interface PlatformButton {
  12. image: string;
  13. alt: string;
  14. urlKey: keyof AppUrls;
  15. }
  16. const STORE_BUTTONS: PlatformButton[] = [
  17. { image: btnAppStore, alt: 'App Store', urlKey: 'appleStoreUrl' },
  18. { image: btnGooglePlay, alt: 'Google Play', urlKey: 'googleStoreUrl' },
  19. { image: btnAndroid, alt: 'Android', urlKey: 'apkUrl' },
  20. { image: btnWindows, alt: 'Windows', urlKey: 'windowsUrl' },
  21. { image: btnMacos, alt: 'Mac OS', urlKey: 'macosUrl' },
  22. ];
  23. export function ChoosePlatform() {
  24. const { t } = useTranslation();
  25. const openComingSoonDialog = useComingSoonDialog();
  26. // const urls = useAppUrls();
  27. return (
  28. <section className="w-full py-8 sm:py-10 lg:py-16">
  29. <Wrapper className="flex flex-col items-center gap-9 sm:gap-10 lg:gap-[72px]">
  30. <div className="flex flex-col items-center gap-6 w-full">
  31. <div className="flex flex-col items-center gap-4 max-w-[672px] text-center">
  32. <h2 className="text-2xl lg:text-[32px] font-semibold italic text-white leading-[1.667] lg:leading-[0.94] tracking-[-0.019em] lg:tracking-[-0.014em] font-[REM]">
  33. {t('pages.home.choosePlatform.title')}
  34. </h2>
  35. <p className="text-sm lg:text-base font-normal text-white/60 leading-[1.5]">
  36. {t('pages.home.choosePlatform.subtitle')}
  37. </p>
  38. </div>
  39. <div className="grid grid-cols-2 gap-6 px-4 w-full sm:flex sm:flex-wrap sm:items-center sm:justify-center">
  40. {STORE_BUTTONS.map(({ image, alt }) => (
  41. <button
  42. key={alt}
  43. type="button"
  44. onClick={() => openComingSoonDialog()}
  45. className="h-[50px] p-0 bg-transparent border-none cursor-pointer outline-none focus:outline-none [-webkit-tap-highlight-color:transparent]"
  46. >
  47. <img
  48. src={image}
  49. alt={alt}
  50. className="h-full w-full object-contain sm:w-auto"
  51. />
  52. </button>
  53. ))}
  54. {/* {STORE_BUTTONS.map(({ image, alt, urlKey }) => {
  55. const url = urls[urlKey];
  56. if (!url) return null;
  57. return (
  58. <a
  59. key={alt}
  60. href={url}
  61. target="_blank"
  62. rel="noopener noreferrer"
  63. className="h-[50px]"
  64. >
  65. <img
  66. src={image}
  67. alt={alt}
  68. className="h-full w-full object-contain sm:w-auto"
  69. />
  70. </a>
  71. );
  72. })} */}
  73. </div>
  74. </div>
  75. {/* <img
  76. src={devicesMockup}
  77. alt="FlashLink VPN on multiple devices"
  78. className="w-full max-w-[350px] sm:max-w-[600px] lg:max-w-[786px] h-auto object-contain"
  79. /> */}
  80. </Wrapper>
  81. </section>
  82. );
  83. }