Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(landing): replace landing by the subscription version #218

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion apps/landing/src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const StyledError = styled.div`
padding: 0.5rem 0;
`;

const StyledContainer = styled.div`
export const StyledContainer = styled.div`
margin-bottom: 4rem;
padding-top: 1rem;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/src/components/Video/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const Video = ({ sources: rawSources, poster }: VideoProps) => {
() =>
rawSources.map((source) => ({
...source,
url: `${import.meta.env.BASE_URL}/${source.url}`,
url: source.url,
})),
[rawSources],
);
Expand Down
22 changes: 8 additions & 14 deletions apps/landing/src/globalStyles/sliderOverrides.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import { createGlobalStyle } from 'styled-components';

import { breakpoints } from '../helpers';

export const SliderOverrides = createGlobalStyle`
.swiper {
&.swiper-vertical {
height: 58rem;

${breakpoints.desktop} {
height: 41rem;
}
}
background-color: #edeff3;
}

.swiper-button-next, .swiper-button-prev {
color: #fff !important;
}

.swiper-horizontal {
padding-bottom: 4rem !important;

& > .swiper-pagination-bullets { bottom: 0 !important; }

.swiper-pagination-bullet-active {
background-color: #fff !important;
}
`;
15 changes: 15 additions & 0 deletions apps/landing/src/locales/extractLocale.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defaultLocale, locales } from './locales';

export const extractLocale = (
urlPathname: string,
): { locale: string; urlWithoutLocale: string } => {
const urlPaths = urlPathname.split('/').filter(Boolean);

if (Object.values(locales).includes(urlPaths[0])) {
const [locale, ...paths] = urlPaths;

return { locale, urlWithoutLocale: `/${paths.join('/')}` };
}

return { locale: defaultLocale, urlWithoutLocale: urlPathname };
};
4 changes: 4 additions & 0 deletions apps/landing/src/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './extractLocale';
export * from './locales';
export * from './translate';
export * from './translations';
8 changes: 8 additions & 0 deletions apps/landing/src/locales/locales.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const locales = { en: 'en-US', ua: 'uk-UA' };

export const langs = Object.entries(locales).reduce<Record<string, string>>(
(acc, [lang, locale]) => ({ ...acc, [locale]: lang }),
{},
);

export const defaultLocale = locales.en;
10 changes: 10 additions & 0 deletions apps/landing/src/locales/translate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defaultLocale } from './locales';
import { translations } from './translations';

export const translate = (text: string, locale: string) => {
if (locale === defaultLocale) {
return text;
}

return translations[text]?.[locale] ?? text;
};
121 changes: 121 additions & 0 deletions apps/landing/src/locales/translations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
export const translations: Record<string, Record<string, string>> = {
'Support BigCommerce colleagues defending Ukraine': {
'uk-UA': 'Підтримайте наших колег з BigCommerce, які захищають Україну в лавах ЗСУ',
},
"Our colleagues from Kyiv office are defending Ukraine on a frontline. Let's help them to stay safe!":
{
'uk-UA':
'Наші колеги з київського офісу долучились до лав Збройних Сил і стали на захист Украіни.',
},
'Denis Matveev. Product designer (MSF, Localization), officer in Ukraine army': {
'uk-UA': 'Денис Матвєєв. Дизайнер (MSF, Localization), військовослужбовець ЗСУ',
},
'Andrii Hurzhiy. Senior Engineer (MSF, Catalog), officer in Ukraine army': {
'uk-UA': 'Андрій Гуржий. Інженер (MSF, Catalog), військовослужбовець ЗСУ',
},
'Petro Donin. Senior Engineer (Inventory), officer in Ukraine army': {
'uk-UA': 'Петро, Донін, Інженер, (Inventory), військовослужбовець ЗСУ',
},
'Ostap Ivanishyn. Senior Engineer (Payments), officer in Ukraine army': {
'uk-UA': 'Остап Інванішин, Інженер (Payments), військовослужбовець ЗСУ',
},
Donate: {
'uk-UA': 'Підтримати',
},
'Why your help is important': {
'uk-UA': 'Чому підтримка важлива',
},
'War in Ukraine is still going.': { 'uk-UA': 'Війна в україні триває.' },
'THE needs are growing every day. Government is unable to fulfil all of them and rely on volunteers to help.':
{ 'uk-UA': 'І кількість потреб зростає кожен день.' },
"let's help by supporting people we know and love, our colleagues.": {
'uk-UA': 'Давайте допоможемо підтримуючи тих, кого ми знаємо і любимо – наших колег.',
},
'Field is required': {
'uk-UA': "Це поле є обов'язковим",
},
'Please use correct email address': {
'uk-UA': 'Будь ласка використовуйте правильну пошту',
},
'Contact us': {
'uk-UA': 'Напишіть нам',
},
'We appreciate you taking the time to help us improve the application so we are able to continue raising awareness, and generating support for our comrades in Ukraine.':
{
'uk-UA':
"Будемо вдячні за вашу допомогу з підтримки наших колег в BigCommerce які захищають Україну в лавах ЗСУ. Якщо у вас є питання або потрібна допомога – зв'яжіться з нами заповнивши форму або пишіть на email.",
},
'Our emails:': { 'uk-UA': 'Наші імейли:' },
'Contact form': { 'uk-UA': 'Напишіть нам' },
'Thank you for your submission': { 'uk-UA': 'Дякуюємо за ваше повідомлення' },
Reset: { 'uk-UA': 'Скинути' },
'Describe your question below': { 'uk-UA': 'Опишіть своє питання' },
'First and Last name': { 'uk-UA': "Ім'я та Прізвище" },
Email: { 'uk-UA': 'Email' },
'Your question or comment': { 'uk-UA': 'Ваше питання або коментар' },
Submit: { 'uk-UA': 'Надіслати' },
'Your impact': { 'uk-UA': 'Ваш вклад' },
"In the past 2 years, with your help we've handed over essential supplies at almost $100,000": {
'uk-UA':
'За минулі 2 роки, з вашою підтримкою ми допомогли Збройним силам України на майже 4,000,000 грн',
},
'Pickup trucks': { 'uk-UA': 'Транспорт' },
'Drones & batteries': { 'uk-UA': 'Дрони і батареї до них' },
'Mini excavator': { 'uk-UA': 'Міні екскаватор' },
Powerstations: { 'uk-UA': 'Генератори' },
'Starlink kits': { 'uk-UA': 'Starlink набори' },
'Active headphones': { 'uk-UA': 'Активні наушники' },
'Night vision monoculars': { 'uk-UA': 'Прилади нічного бачення' },
Laptops: { 'uk-UA': 'Ноутбуки' },
Monitors: { 'uk-UA': 'Монітори' },
'Hertz analyzer': { 'uk-UA': 'Аналізатор частот' },
'Sleeping bags': { 'uk-UA': 'Спальні мішки' },
'Medical tourniquets': { 'uk-UA': 'Турнікети' },
'Thermal vision cameras': { 'uk-UA': 'Камери з тепловізором' },
'Body armors': { 'uk-UA': 'Броня і плити' },
FAQ: { 'uk-UA': 'Запитання й відповіді' },
'Many more...': { 'uk-UA': 'та багато іншого...' },
'What are the constant needs': { 'uk-UA': 'Напрямки підтримки' },
"There's a constant need in transport, protection and medical supplies. And our focus is in making sure we can provide help fast.":
{
'uk-UA':
'Транспорт, засоби захисту та медичні товари – це постійні потребі. Наш фокус – надання регулярної та прогнозованої підтримки. ',
},
Transport: { 'uk-UA': 'Транспорт' },
'Transport is essential to survive and transport people and ammunition. Cars get damaged every day and require either maintenance or full replacement.':
{
'uk-UA':
'Транспорт необхідний для перевезення людей та обладлення. Автівки виходять з ладу та потребують або постійного ремонту, або повної заміни.',
},
'Radio protection tools': { 'uk-UA': 'Засоби радіо захисту' },
'Anti drone protection is #1 request today, in addition to body armor, night vision, Starlink kits and powerstations for stable connection, drones with thermal vision.':
{
'uk-UA':
'Засоби РЕБ для захисту проти дронів – це потреба №1. Потреба є також в розвідувальних дронах, приладах нічного бачення, Starlink та генераторах для стабільного зв’язку.',
},
'Medical supplies': { 'uk-UA': 'Медичні товари' },
'Medical tourniquets, medical bandage, medical kits and medicines, body warmers and sleeping bags.':
{
'uk-UA':
'Турнікети, бандажі, аптечки, грілки для тіла, спальні мішки – це постійні потреби, яких ніколи не бувє забагато, бо це рятує життя.',
},
subscribers: { 'uk-UA': 'донатера' },
countries: { 'uk-UA': 'країн' },
'monthly support': { 'uk-UA': 'щомісячної підтримки' },
'Subscription that saves lives': { 'uk-UA': 'Підтримка, що рятує життя' },
'Monthly support would provide the ability to help systematically and quickly. However, we would appreciate one time donation as well':
{ 'uk-UA': 'Щомісячна підтримка дасть нам змогу допомагати регулярно і прогнозовано' },
Support: { 'uk-UA': 'Підтримати' },
'* If you are subscribed, but want to cancel subscription': {
'uk-UA': '* ви можете відмовитись від підписки в будь який момент, натиснувши',
},
'click here': { 'uk-UA': 'СЮДИ' },
'1 time donation': { 'uk-UA': 'Разовий донат' },
Custom: { 'uk-UA': 'Інша сума' },
'per month': { 'uk-UA': '/ місяць' },
'Enter donation amount': { 'uk-UA': 'Введіть бажану суму' },
'Enter subscription amount': { 'uk-UA': 'Введіть бажану суму' },
Proceed: {
'uk-UA': 'Продовжити',
},
};
Loading
Loading