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:
+6
-2
@@ -18,7 +18,11 @@ export function middleware(request: NextRequest) {
|
||||
(locale) => pathname.startsWith(`/${locale}/`) || pathname === `/${locale}`,
|
||||
);
|
||||
|
||||
const locale = matchedLocale || defaultLocale;
|
||||
const cookieLocale = request.cookies.get('locale')?.value;
|
||||
const preferredLocale = locales.includes(cookieLocale || '')
|
||||
? cookieLocale
|
||||
: defaultLocale;
|
||||
const locale = matchedLocale || preferredLocale;
|
||||
|
||||
let response: NextResponse;
|
||||
|
||||
@@ -26,7 +30,7 @@ export function middleware(request: NextRequest) {
|
||||
const pathnameIsMissingLocale = !matchedLocale;
|
||||
if (pathnameIsMissingLocale) {
|
||||
response = NextResponse.redirect(
|
||||
new URL(`/${defaultLocale}${pathname}`, request.url),
|
||||
new URL(`/${preferredLocale}${pathname}`, request.url),
|
||||
);
|
||||
} else {
|
||||
response = NextResponse.next();
|
||||
|
||||
Reference in New Issue
Block a user