Compare commits

..

2 Commits

Author SHA1 Message Date
5b3b2e53f2 Merge pull request 'add: certificates page' (#1) from add-pages into dev
Reviewed-on: #1
2025-04-26 14:47:13 +05:00
khadiatullo
0f62d24748 add: certificates page 2025-04-25 18:20:23 +03:00
7 changed files with 431 additions and 12 deletions

View File

@ -0,0 +1,8 @@
import { CertificatesPage } from "@/pages-templates/certificates"
export default function Certificates() {
return (
<CertificatesPage />
)
}

View File

@ -0,0 +1,122 @@
"use client"
import Image from "next/image"
import { Card, CardContent } from "@/shared/shadcn-ui/card"
import { Button } from "@/shared/shadcn-ui/button"
import { Download, Eye } from "lucide-react"
import { useLanguage } from "@/shared/language"
export function CertificatesPage() {
const { t } = useLanguage()
// This data would typically come from an API or CMS
// We're keeping it as-is since it's dynamic content
const certificates = [
{
id: 1,
title: "ISO 9001:2015",
description: "Сертификат системы менеджмента качества",
image: "/placeholder.svg?height=400&width=300",
issueDate: "15.03.2022",
expiryDate: "15.03.2025",
},
{
id: 2,
title: "ISO 14001:2015",
description: "Сертификат экологического менеджмента",
image: "/placeholder.svg?height=400&width=300",
issueDate: "10.05.2022",
expiryDate: "10.05.2025",
},
{
id: 3,
title: "OHSAS 18001",
description: "Сертификат системы управления охраной труда",
image: "/placeholder.svg?height=400&width=300",
issueDate: "22.07.2022",
expiryDate: "22.07.2025",
},
{
id: 4,
title: "Сертификат качества топлива",
description: "Подтверждение соответствия топлива стандартам качества",
image: "/placeholder.svg?height=400&width=300",
issueDate: "05.01.2023",
expiryDate: "05.01.2024",
},
{
id: 5,
title: "Сертификат соответствия",
description: "Соответствие услуг национальным стандартам",
image: "/placeholder.svg?height=400&width=300",
issueDate: "18.09.2022",
expiryDate: "18.09.2025",
},
{
id: 6,
title: "Лицензия на хранение ГСМ",
description: "Разрешение на хранение горюче-смазочных материалов",
image: "/placeholder.svg?height=400&width=300",
issueDate: "30.11.2021",
expiryDate: "30.11.2026",
},
]
return (
<>
<main className="container mx-auto py-10">
<div className="mb-10 text-center">
<h1 className="mb-4 text-4xl font-bold">{t("certificates.title")}</h1>
<p className="mx-auto max-w-2xl text-lg text-gray-600">{t("certificates.description")}</p>
</div>
<div className="grid gap-8 md:grid-cols-2 lg:grid-cols-3">
{certificates.map((certificate) => (
<Card key={certificate.id} className="overflow-hidden transition-all duration-300 hover:shadow-lg">
<div className="relative h-[300px] w-full overflow-hidden bg-gray-100">
<Image
src={certificate.image || "/placeholder.svg"}
alt={certificate.title}
fill
className="object-contain p-4"
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
/>
</div>
<CardContent className="p-6">
<h3 className="mb-2 text-xl font-bold">{certificate.title}</h3>
<p className="mb-4 text-gray-600">{certificate.description}</p>
<div className="mb-4 text-sm text-gray-500">
<p>
{t("certificates.issueDate")}: {certificate.issueDate}
</p>
<p>
{t("certificates.expiryDate")}: {certificate.expiryDate}
</p>
</div>
<div className="flex gap-2">
<Button variant="outline" size="sm" className="flex items-center gap-1">
<Eye size={16} />
<span>{t("common.buttons.view")}</span>
</Button>
<Button variant="outline" size="sm" className="flex items-center gap-1">
<Download size={16} />
<span>{t("common.buttons.download")}</span>
</Button>
</div>
</CardContent>
</Card>
))}
</div>
<div className="mt-16 rounded-lg bg-gray-50 p-8">
<h2 className="mb-4 text-2xl font-bold">{t("certificates.requestInfo")}</h2>
<p className="mb-6 text-gray-600">{t("certificates.requestInfoText")}</p>
<div className="flex flex-wrap gap-4">
<Button className="bg-red-600 hover:bg-red-700">{t("common.buttons.contactUs")}</Button>
<Button variant="outline">{t("certificates.faq")}</Button>
</div>
</div>
</main>
</>
)
}

View File

@ -0,0 +1,87 @@
"use client"
import { createContext, useContext, useState, useEffect, type ReactNode } from "react"
import enTranslations from "./locales/en.json"
import ruTranslations from "./locales/ru.json"
// Define available languages
export const languages = {
en: { name: "English", flag: "🇬🇧" },
ru: { name: "Русский", flag: "🇷🇺" },
}
export type Language = keyof typeof languages
// Define translations type with flat structure
export type Translations = Record<string, string>
// Load translations
const translations: Record<Language, Translations> = {
en: enTranslations,
ru: ruTranslations,
}
// Create context
type LanguageContextType = {
language: Language
setLanguage: (lang: Language) => void
t: (key: string) => string
}
const LanguageContext = createContext<LanguageContextType | undefined>(undefined)
// Create provider
export function LanguageProvider({ children }: { children: ReactNode }) {
// Default to Russian, but check localStorage on client
const [language, setLanguageState] = useState<Language>("ru")
const [isLoaded, setIsLoaded] = useState(false)
useEffect(() => {
// Check if we're in the browser
if (typeof window !== "undefined") {
const savedLanguage = localStorage.getItem("language") as Language
if (savedLanguage && languages[savedLanguage]) {
setLanguageState(savedLanguage)
}
setIsLoaded(true)
}
}, [])
const setLanguage = (lang: Language) => {
setLanguageState(lang)
if (typeof window !== "undefined") {
localStorage.setItem("language", lang)
}
}
// Translation function for flat structure
const t = (key: string): string => {
if (translations[language][key]) {
return translations[language][key]
}
console.warn(`Translation key not found: ${key}`)
return key
}
// Only render children when language is loaded from localStorage
if (!isLoaded && typeof window !== "undefined") {
return null // Or a loading spinner
}
return <LanguageContext.Provider value={{ language, setLanguage, t }}>{children}</LanguageContext.Provider>
}
// Create hook
export function useLanguage() {
const context = useContext(LanguageContext)
if (context === undefined) {
throw new Error("useLanguage must be used within a LanguageProvider")
}
if (typeof context.t !== 'function') {
throw new Error("Translation function (t) is not available");
}
return context
}

View File

@ -0,0 +1,99 @@
{
"common.buttons.readMore": "Read More",
"common.buttons.viewAll": "View All",
"common.buttons.findStation": "Find Station",
"common.buttons.learnMore": "Learn More",
"common.buttons.download": "Download",
"common.buttons.view": "View",
"common.buttons.contactUs": "Contact Us",
"common.buttons.apply": "Apply",
"common.buttons.login": "Login",
"common.buttons.logout": "Logout",
"common.buttons.submit": "Submit",
"common.buttons.filter": "Filter",
"common.buttons.resetFilters": "Reset Filters",
"common.buttons.downloadApp": "Download App",
"common.buttons.getLoyaltyCard": "Get Loyalty Card",
"common.buttons.sendResume": "Send Resume",
"common.buttons.showAllStations": "Show All Stations",
"common.buttons.allPromotions": "All Promotions",
"common.navigation.home": "Home",
"common.navigation.about": "About Us",
"common.navigation.clients": "For Clients",
"common.navigation.stations": "Our Stations",
"common.navigation.vacancies": "Vacancies",
"common.navigation.promotions": "Promotions",
"common.navigation.charity": "Charity",
"common.navigation.certificates": "Certificates",
"common.navigation.contacts": "Contacts",
"common.footer.contacts": "Contacts",
"common.footer.navigation": "Navigation",
"common.footer.subscribe": "Subscribe",
"common.footer.subscribeText": "Subscribe to our newsletter to receive news and special offers.",
"common.footer.yourEmail": "Your email",
"common.footer.rights": "All rights reserved.",
"home.hero.title": "Modern Gas Station Network in Tajikistan",
"home.hero.description": "Quality fuel, convenient locations, and excellent service for our customers",
"home.about.title": "About Our Company",
"home.about.description1": "Our gas station network is one of the leading in Tajikistan. We provide high-quality fuel and a high level of service for our customers for more than 15 years.",
"home.about.description2": "We are constantly developing, opening new stations and improving service at existing ones. Our goal is to make refueling as convenient and fast as possible for every customer.",
"home.about.features.quality.title": "Quality Fuel",
"home.about.features.quality.description": "We guarantee the high quality of our fuel",
"home.about.features.equipment.title": "Modern Equipment",
"home.about.features.equipment.description": "All our stations are equipped with modern equipment",
"home.about.features.staff.title": "Professional Staff",
"home.about.features.staff.description": "Our employees are professionals in their field",
"home.stations.title": "Our Stations",
"home.stations.description": "Find the nearest station in our network. We are located in convenient places throughout Tajikistan.",
"home.promotions.title": "Current Promotions",
"home.promotions.description": "Special offers and promotions for our customers. Refuel profitably!",
"home.vacancies.title": "Vacancies",
"home.vacancies.description": "Join our team of professionals. We offer stable work and opportunities for growth.",
"home.vacancies.all": "All vacancies",
"home.vacancies.office": "Office",
"home.vacancies.stations": "Stations",
"home.vacancies.fullTime": "Full time",
"home.vacancies.experience": "Experience from 1 year",
"home.vacancies.shiftWork": "Shift work",
"home.vacancies.training": "Training",
"home.partners.title": "Our Partners",
"home.partners.description": "We cooperate with leading companies to provide the best services to our customers.",
"home.partners.becomePartner": "Become Our Partner",
"home.partners.becomePartnerText": "We are open to cooperation and new partnerships. Contact us to discuss opportunities.",
"home.charity.title": "Charity Foundation",
"home.charity.description": "Our charity foundation was created to support socially significant projects in Tajikistan. We strive to contribute to the development of society and help those in need.",
"home.charity.directions": "Main directions of our foundation's activities:",
"home.charity.education": "Support for educational programs",
"home.charity.children": "Help for children from low-income families",
"home.charity.ecology": "Environmental initiatives",
"home.charity.sports": "Support for sports events",
"home.charity.learnMore": "Learn More About the Foundation",
"home.cta.title": "Join Us",
"home.cta.description": "Become part of our network. Get special offers, bonuses, and discounts.",
"certificates.title": "Our Certificates",
"certificates.description": "GasNetwork adheres to high standards of quality and safety. Our certificates confirm the compliance of our products and services with international and national standards.",
"certificates.requestInfo": "Request Additional Information",
"certificates.requestInfoText": "If you need additional information about our certificates or would like to receive copies of documents, please contact our quality department.",
"certificates.issueDate": "Issue Date",
"certificates.expiryDate": "Valid Until",
"certificates.faq": "Frequently Asked Questions",
"auth.title": "Login to your account",
"auth.description": "Log in to your personal account to access information about your bonuses, transaction history and other features.",
"auth.bonusClient": "Bonus Client",
"auth.corporateClient": "Corporate Client",
"auth.bonusLogin.title": "Login for bonus clients",
"auth.bonusLogin.description": "Enter your phone number and bonus card number to log in to your personal account.",
"auth.corporateLogin.title": "Login for corporate clients",
"auth.corporateLogin.description": "Enter your phone number and corporate card number to log in to your personal account.",
"auth.phoneNumber": "Phone number",
"auth.cardNumber": "Card number",
"auth.loginIssues": "Having trouble logging in?",
"map.filters": "Filters",
"map.stationsList": "Stations List",
"map.noStations": "No stations matching the selected filters",
"map.ourStations": "Our Stations",
"map.totalStations": "Total stations",
"map.services": "Services",
"map.cities": "Cities",
"map.allCities": "All Cities"
}

View File

@ -0,0 +1,99 @@
{
"common.buttons.readMore": "Подробнее",
"common.buttons.viewAll": "Смотреть все",
"common.buttons.findStation": "Найти заправку",
"common.buttons.learnMore": "Узнать больше",
"common.buttons.download": "Скачать",
"common.buttons.view": "Просмотр",
"common.buttons.contactUs": "Связаться с нами",
"common.buttons.apply": "Оформить",
"common.buttons.login": "Вход",
"common.buttons.logout": "Выйти",
"common.buttons.submit": "Отправить",
"common.buttons.filter": "Фильтры",
"common.buttons.resetFilters": "Сбросить фильтры",
"common.buttons.downloadApp": "Скачать приложение",
"common.buttons.getLoyaltyCard": "Получить карту лояльности",
"common.buttons.sendResume": "Отправить резюме",
"common.buttons.showAllStations": "Показать все заправки",
"common.buttons.allPromotions": "Все акции",
"common.navigation.home": "Главная",
"common.navigation.about": "О нас",
"common.navigation.clients": "Клиентам",
"common.navigation.stations": "Наши заправки",
"common.navigation.vacancies": "Вакансии",
"common.navigation.promotions": "Акции",
"common.navigation.charity": "Благотворительность",
"common.navigation.certificates": "Сертификаты",
"common.navigation.contacts": "Контакты",
"common.footer.contacts": "Контакты",
"common.footer.navigation": "Навигация",
"common.footer.subscribe": "Подписка",
"common.footer.subscribeText": "Подпишитесь на нашу рассылку, чтобы получать новости и специальные предложения.",
"common.footer.yourEmail": "Ваш email",
"common.footer.rights": "Все права защищены.",
"home.hero.title": "Сеть современных заправок в Таджикистане",
"home.hero.description": "Качественное топливо, удобное расположение и отличный сервис для наших клиентов",
"home.about.title": "О нашей компании",
"home.about.description1": "Наша сеть заправок является одной из ведущих в Таджикистане. Мы предоставляем качественное топливо и высокий уровень обслуживания для наших клиентов уже более 15 лет.",
"home.about.description2": "Мы постоянно развиваемся, открывая новые станции и улучшая сервис на существующих. Наша цель - сделать заправку автомобиля максимально удобной и быстрой для каждого клиента.",
"home.about.features.quality.title": "Качественное топливо",
"home.about.features.quality.description": "Мы гарантируем высокое качество нашего топлива",
"home.about.features.equipment.title": "Современное оборудование",
"home.about.features.equipment.description": "Все наши станции оснащены современным оборудованием",
"home.about.features.staff.title": "Профессиональный персонал",
"home.about.features.staff.description": "Наши сотрудники - профессионалы своего дела",
"home.stations.title": "Наши заправки",
"home.stations.description": "Найдите ближайшую к вам заправку нашей сети. Мы расположены в удобных местах по всему Таджикистану.",
"home.promotions.title": "Актуальные акции",
"home.promotions.description": "Специальные предложения и акции для наших клиентов. Заправляйтесь выгодно!",
"home.vacancies.title": "Вакансии",
"home.vacancies.description": "Присоединяйтесь к нашей команде профессионалов. Мы предлагаем стабильную работу и возможности для роста.",
"home.vacancies.all": "Все вакансии",
"home.vacancies.office": "Офис",
"home.vacancies.stations": "Заправки",
"home.vacancies.fullTime": "Полный день",
"home.vacancies.experience": "Опыт от 1 года",
"home.vacancies.shiftWork": "Сменный график",
"home.vacancies.training": "Обучение",
"home.partners.title": "Наши партнеры",
"home.partners.description": "Мы сотрудничаем с ведущими компаниями для предоставления лучших услуг нашим клиентам.",
"home.partners.becomePartner": "Станьте нашим партнером",
"home.partners.becomePartnerText": "Мы открыты для сотрудничества и новых партнерских отношений. Свяжитесь с нами для обсуждения возможностей.",
"home.charity.title": "Благотворительный фонд",
"home.charity.description": "Наш благотворительный фонд был создан для поддержки социально значимых проектов в Таджикистане. Мы стремимся внести свой вклад в развитие общества и помочь тем, кто в этом нуждается.",
"home.charity.directions": "Основные направления деятельности нашего фонда:",
"home.charity.education": "Поддержка образовательных программ",
"home.charity.children": "Помощь детям из малообеспеченных семей",
"home.charity.ecology": "Экологические инициативы",
"home.charity.sports": "Поддержка спортивных мероприятий",
"home.charity.learnMore": "Подробнее о фонде",
"home.cta.title": "Присоединяйтесь к нам",
"home.cta.description": "Станьте частью нашей сети. Получайте специальные предложения, бонусы и скидки.",
"certificates.title": "Наши сертификаты",
"certificates.description": "GasNetwork придерживается высоких стандартов качества и безопасности. Наши сертификаты подтверждают соответствие нашей продукции и услуг международным и национальным стандартам.",
"certificates.requestInfo": "Запросить дополнительную информацию",
"certificates.requestInfoText": "Если вам требуется дополнительная информация о наших сертификатах или вы хотите получить копии документов, пожалуйста, свяжитесь с нашим отделом качества.",
"certificates.issueDate": "Дата выдачи",
"certificates.expiryDate": "Действителен до",
"certificates.faq": "Часто задаваемые вопросы",
"auth.title": "Вход в личный кабинет",
"auth.description": "Войдите в личный кабинет, чтобы получить доступ к информации о ваших бонусах, истории операций и другим возможностям.",
"auth.bonusClient": "Бонусный клиент",
"auth.corporateClient": "Корпоративный клиент",
"auth.bonusLogin.title": "Вход для бонусных клиентов",
"auth.bonusLogin.description": "Введите номер телефона и номер бонусной карты для входа в личный кабинет.",
"auth.corporateLogin.title": "Вход для корпоративных клиентов",
"auth.corporateLogin.description": "Введите номер телефона и номер корпоративной карты для входа в личный кабинет.",
"auth.phoneNumber": "Номер телефона",
"auth.cardNumber": "Номер карты",
"auth.loginIssues": "Возникли проблемы со входом?",
"map.filters": "Фильтры",
"map.stationsList": "Список заправок",
"map.noStations": "Нет заправок, соответствующих выбранным фильтрам",
"map.ourStations": "Наши заправки",
"map.totalStations": "Всего станций",
"map.services": "Услуги",
"map.cities": "Города",
"map.allCities": "Все города"
}

View File

@ -6,6 +6,7 @@ import { store } from '../store';
import { ThemeProvider } from '../theme/theme-provider'; import { ThemeProvider } from '../theme/theme-provider';
import { AosProvider } from './aos-provider'; import { AosProvider } from './aos-provider';
import { Toaster } from './toaster'; import { Toaster } from './toaster';
import { LanguageProvider } from '../language';
type ProvidersProps = { type ProvidersProps = {
children: React.ReactNode; children: React.ReactNode;
@ -14,17 +15,19 @@ type ProvidersProps = {
export const Providers = ({ children }: ProvidersProps) => { export const Providers = ({ children }: ProvidersProps) => {
return ( return (
<Provider store={store}> <Provider store={store}>
<ThemeProvider <LanguageProvider>
attribute='class' <ThemeProvider
defaultTheme='system' attribute='class'
enableSystem defaultTheme='system'
disableTransitionOnChange enableSystem
> disableTransitionOnChange
<AosProvider> >
{children} <AosProvider>
<Toaster /> {children}
</AosProvider> <Toaster />
</ThemeProvider> </AosProvider>
</ThemeProvider>
</LanguageProvider>
</Provider> </Provider>
); );
}; };

View File

@ -23,7 +23,8 @@
"@/entities/*": ["./src/entities/*"], "@/entities/*": ["./src/entities/*"],
"@/features/*": ["./src/features/*"], "@/features/*": ["./src/features/*"],
"@/shared/*": ["./src/shared/*"], "@/shared/*": ["./src/shared/*"],
"@/widgets/*": ["./src/widgets/*"] "@/widgets/*": ["./src/widgets/*"],
"@/pages-templates/*": ["./src/pages-templates/*"]
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],