Skip to content

Instantly share code, notes, and snippets.

View FrancisGregori's full-sized avatar

Francis Gregori Munis FrancisGregori

View GitHub Profile
'use client';
import { ReactNode } from 'react';
import { SessionProvider } from 'next-auth/react';
export default function Providers({ children }: { children: ReactNode }) {
return <SessionProvider>{children}</SessionProvider>;
}
import { ReactNode } from 'react';
import { Inter } from 'next/font/google';
import { notFound } from 'next/navigation';
import Providers from '@/app/providers';
import Navbar from '@/components/Navbar';
import { locales } from '@/navigation';
const inter = Inter({ subsets: ['latin'] });
import NextAuth from 'next-auth/next';
import GoogleProvider from 'next-auth/providers/google';
const useSecureCookies = !!process.env.VERCEL_URL;
const handler = NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID ?? '',
clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? '',
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
import React from 'react';
import Link from 'next/link';
import { useTranslations } from 'next-intl';
const Navbar = () => {
const t = useTranslations('components.navbar');
return (
<header className="w-full border-b border-gray-200 bg-white/75 p-4 py-4 shadow-md">
import React from 'react';
import Link from 'next/link';
import { getTranslations } from 'next-intl/server';
const Navbar = async ({ locale }: { locale: string }) => {
const t = await getTranslations({ locale, namespace: 'components.navbar' });
return (
<header className="w-full border-b border-gray-200 bg-white/75 p-4 py-4 shadow-md">
import { ReactNode } from 'react';
import './globals.css';
export default function RootLayout({ children }: { children: ReactNode }) {
return children;
}
import { ReactNode } from 'react';
import { Inter } from 'next/font/google';
import { notFound } from 'next/navigation';
import Providers from '@/app/providers';
import Navbar from '@/components/Navbar';
import { locales } from '@/navigation';
const inter = Inter({ subsets: ['latin'] });
import createMiddleware from 'next-intl/middleware';
import { locales } from './navigation';
export default createMiddleware({
locales,
defaultLocale: 'en',
localePrefix: 'never',
localeDetection: false,
domains: [
import { createSharedPathnamesNavigation } from 'next-intl/navigation';
export const locales = ['en', 'es', 'pt'] as const;
export const { Link, redirect, usePathname, useRouter } =
createSharedPathnamesNavigation({ locales });