feat: add certificate gallery and certifications section components
- Implemented CertificateGallery component to display certification images in a gallery format. - Created CertificationsSection component to showcase certifications with titles and descriptions. - Enhanced Gallery component to support animations and keyboard navigation. - Introduced Select component for dropdown selection with images. - Added utility functions for API responses and pagination handling. - Implemented localization functions for text and content. - Created a custom hook for detecting clicks outside of a component.
This commit is contained in:
@@ -24,11 +24,17 @@ export default function ModalLanguageSelector() {
|
||||
const t = useTranslations();
|
||||
useEffect(() => {
|
||||
const selected = localStorage.getItem('selectedLocale');
|
||||
if (!selected) setShow(true);
|
||||
const cookieLocale = document.cookie
|
||||
.split('; ')
|
||||
.find((item) => item.startsWith('locale='))
|
||||
?.split('=')[1];
|
||||
|
||||
if (!selected && !cookieLocale) setShow(true);
|
||||
}, []);
|
||||
|
||||
const changeLocale = (locale: TLocales) => {
|
||||
localStorage.setItem('selectedLocale', locale);
|
||||
document.cookie = `locale=${locale}; path=/; max-age=31536000; samesite=lax`;
|
||||
const path = window.location.pathname.replace(/^\/(en|fa)/, '');
|
||||
window.location.pathname = `/${locale}${path}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user