Files
StevenandGitHub 4466ba436b chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00

74 lines
1.9 KiB
JavaScript

import Link from "next/link";
import Trans from "next-translate/Trans";
import useTranslation from "next-translate/useTranslation";
export default function Home() {
const { t, lang } = useTranslation();
const isRTL = lang === "ar" || lang === "he";
const arrow = isRTL ? String.fromCharCode(8592) : String.fromCharCode(8594);
return (
<main dir={isRTL ? "rtl" : "ltr"}>
<Trans
i18nKey="home:title"
components={[
<h1 className="title" />,
<a href="https://nextjs.org">Next.js!</a>,
]}
/>
<p className="description">
{t("home:description")} <code>_pages/index.js</code>
</p>
<div className="grid">
<Link href="/en">
<div className="card">
<h3>{t("home:english")}</h3>
<p>
{t("home:change-to")} {t("home:english")}
</p>
</div>
</Link>
<Link href="/ca">
<div className="card">
<h3>{t("home:catalan")}</h3>
<p>
{t("home:change-to")} {t("home:catalan")}
</p>
</div>
</Link>
<Link href="/ar">
<div className="card">
<h3>{t("home:arabic")}</h3>
<p>
{t("home:change-to")} {t("home:arabic")}
</p>
</div>
</Link>
<Link href="/he">
<div className="card">
<h3>{t("home:hebrew")}</h3>
<p>
{t("home:change-to")} {t("home:hebrew")}
</p>
</div>
</Link>
<a href="https://nextjs.org/docs" className="card">
<h3>Next.{`js ${arrow}`}</h3>
<p>{t("home:next-docs")}</p>
</a>
<a href="https://github.com/vinissimus/next-translate" className="card">
<h3>{`Learn ${arrow}`}</h3>
<p>{t("home:plugin-docs")}</p>
</a>
</div>
</main>
);
}