Files
evidencija-rezija/web-app/app/[locale]/page.tsx
Knee Cola 57dcebd640 refactor: convert repository to monorepo with npm workspaces
Restructured the repository into a monorepo to better organize application code
and maintenance scripts.

## Workspace Structure
- web-app: Next.js application (all app code moved from root)
- housekeeping: Database backup and maintenance scripts

## Key Changes
- Moved all application code to web-app/ using git mv
- Moved database scripts to housekeeping/ workspace
- Updated Dockerfile for monorepo build process
- Updated docker-compose files (volume paths: ./web-app/etc/hosts/)
- Updated .gitignore for workspace-level node_modules
- Updated documentation (README.md, CLAUDE.md, CHANGELOG.md)

## Migration Impact
- Root package.json now manages workspaces
- Build commands delegate to web-app workspace
- All file history preserved via git mv
- Docker build process updated for workspace structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 12:13:04 +01:00

67 lines
2.5 KiB
TypeScript

import { FC } from 'react';
import { Main } from '@/app/ui/Main';
import { myAuth } from "@/app/lib/auth";
import Image from 'next/image';
import { getTranslations, getLocale } from "next-intl/server";
import isWebview from "is-ua-webview";
import { headers } from 'next/headers';
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
import { paragraphFormatFactory } from '../lib/paragraphFormatFactory';
import { getAuthProviders } from '../lib/getProviders';
import { EnterOrSignInButton } from '../ui/EnterOrSignInButton';
const h1ClassName = "text-3xl font-bold max-w-[38rem] mx-auto text-neutral-50";
const h2ClassName = h1ClassName + " mt-8";
const Page: FC = async () => {
const locale = await getLocale();
const paragraphFormat = paragraphFormatFactory(locale);
const t = await getTranslations("login-page");
const session = await myAuth();
const providers = getAuthProviders();
// get userAgent from NextJS
const headersList = headers();
const userAgent = headersList.get("user-agent") as string;
const insideWebeview = isWebview(userAgent);
return (
<Main>
<h1 className={h1ClassName}>
{t.rich("main-card.title", paragraphFormat)}
</h1>
{t.rich("main-card.text", paragraphFormat)}
<Image src={t("main-card.image-url")} alt={t("main-card.image-alt")} className="m-auto mt-0" width={400} height={300} />
<EnterOrSignInButton session={session} locale={locale} providers={providers} />
{
// Google will refuse OAuth signin if it's inside a webview (i.e. Facebook)
insideWebeview &&
<div className="card card-side bg-base-100 shadow-xl max-w-[30em] mx-auto mb-4">
<figure className='pl-4 pr-1 pt-[2rem] min-w-[100px] max-w-[100px] self-start'>
<ExclamationTriangleIcon className="text-red-600 self-start" />
</figure>
<div className="card-body pl-2">
{t.rich("main-card.in-app-browser-warning", paragraphFormat)}
</div>
</div>
}
<h2 className={`${h2ClassName} text-xl`}>{t.rich("card-1.title", paragraphFormat)}</h2>
{t.rich("card-1.text", paragraphFormat)}
<Image src={t("card-1.image-url")} alt={t("card-1.image-alt")} className="m-auto mt-4" width={400} height={300} />
<h2 className={`${h2ClassName} text-xl`}>{t.rich("card-2.title", paragraphFormat)}</h2>
{t.rich("card-2.text", paragraphFormat)}
<EnterOrSignInButton session={session} locale={locale} providers={providers} />
</Main>
);
}
export default Page;