Skip to content

Commit

Permalink
Merge pull request #59 from seemorg/dev
Browse files Browse the repository at this point in the history
Production deployment
  • Loading branch information
ahmedriad1 authored Jan 5, 2025
2 parents 1e8bf51 + d3d1dc0 commit 99acad3
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 20 deletions.
1 change: 1 addition & 0 deletions locales/ar/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "قريبًا",
"message": "هذه الميزة غير متوفرة بعد."
},
"not-available": "غير متاح",
"copy": "نسخ",
"share": "مشاركة",
"select": "اختر",
Expand Down
1 change: 1 addition & 0 deletions locales/bn/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "শীঘ্রই আসছে",
"message": "এই বৈশিষ্ট্যটি এখনও উপলব্ধ নয়।"
},
"not-available": "প্রাপ্য নয়",
"copy": "কপি",
"share": "শেয়ার",
"select": "নির্বাচন করুন",
Expand Down
1 change: 1 addition & 0 deletions locales/en/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Coming Soon",
"message": "This feature is not available yet."
},
"not-available": "Not available",
"copy": "Copy",
"share": "Share",
"select": "Select",
Expand Down
1 change: 1 addition & 0 deletions locales/es/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Próximamente",
"message": "Esta función aún no está disponible."
},
"not-available": "No disponible",
"copy": "Copiar",
"share": "Compartir",
"select": "Seleccionar",
Expand Down
1 change: 1 addition & 0 deletions locales/fa/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "به زودی",
"message": "این قابلیت هنوز در دسترس نیست."
},
"not-available": "در دسترس نیست",
"copy": "کپی",
"share": "اشتراک گذاری",
"select": "انتخاب",
Expand Down
1 change: 1 addition & 0 deletions locales/fr/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Prochainement",
"message": "Cette fonctionnalité n'est pas encore disponible."
},
"not-available": "Non disponible",
"copy": "Copier",
"share": "Partager",
"select": "Sélectionner",
Expand Down
1 change: 1 addition & 0 deletions locales/ha/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Da zuwa",
"message": "Wannan fasalin ba ya samuwa tukuna."
},
"not-available": "Babu samuwa",
"copy": "Kwafi",
"share": "Raba",
"select": "Zaɓi",
Expand Down
1 change: 1 addition & 0 deletions locales/hi/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "जल्द आ रहा है",
"message": "यह सुविधा अभी उपलब्ध नहीं है।"
},
"not-available": "उपलब्ध नहीं",
"copy": "प्रतिलिपि",
"share": "साझा करें",
"select": "चुनें",
Expand Down
1 change: 1 addition & 0 deletions locales/ms/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Akan Datang",
"message": "Ciri ini belum tersedia."
},
"not-available": "Tidak tersedia",
"copy": "Salin",
"share": "Kongsi",
"select": "Pilih",
Expand Down
1 change: 1 addition & 0 deletions locales/ps/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "ژر به راشي",
"message": "دا بڼه اوس مهال شتون نلري."
},
"not-available": "شته نه دی",
"copy": "کاپي",
"share": "شریک کړئ",
"select": "وټاکئ",
Expand Down
1 change: 1 addition & 0 deletions locales/ru/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Скоро будет",
"message": "Эта функция пока недоступна."
},
"not-available": "Недоступно",
"copy": "Копировать",
"share": "Поделиться",
"select": "Выбрать",
Expand Down
1 change: 1 addition & 0 deletions locales/so/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Dhawaan Imaanaysa",
"message": "Astaantan hadda lama heli karo."
},
"not-available": "Ma jiro",
"copy": "Nuqul",
"share": "La wadaag",
"select": "Xulo",
Expand Down
1 change: 1 addition & 0 deletions locales/tr/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "Yakında",
"message": "Bu özellik henüz kullanılamıyor."
},
"not-available": "Mevcut değil",
"copy": "Kopyala",
"share": "Paylaş",
"select": "Seç",
Expand Down
1 change: 1 addition & 0 deletions locales/ur/reader.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"title": "جلد آ رہا ہے",
"message": "یہ خصوصیت ابھی دستیاب نہیں ہے۔"
},
"not-available": "دستیاب نہیں",
"copy": "کاپی",
"share": "اشتراک",
"select": "منتخب کریں",
Expand Down
20 changes: 18 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.js");
const env = await import("./src/env.js");

import createNextIntlPlugin from "next-intl/plugin";
import { withAxiom } from "next-axiom";
Expand All @@ -13,7 +13,8 @@ import createBundleAnalyzer from "@next/bundle-analyzer";
const config = {
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
headers: async () => {
return [
/** @type {Awaited<ReturnType<NonNullable<import("next").NextConfig["headers"]>>>} */
const headers = [
{
// Cache sitemap
source: "/sitemap.xml",
Expand All @@ -26,6 +27,21 @@ const config = {
],
},
];

// disable indexing on non-production environments
if (env.env.VERCEL_ENV !== "production") {
headers.push({
source: "/:path*",
headers: [
{
key: "X-Robots-Tag",
value: "noindex, nofollow",
},
],
});
}

return headers;
},
redirects: async () => {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ReaderNavigationButton = forwardRef<HTMLButtonElement, ButtonProps>(
size="icon"
className={cn(
"inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
"size-9 rounded-lg bg-background shadow-none hover:bg-accent hover:text-accent-foreground focus:bg-accent md:border md:border-border [&_svg]:size-5",
"size-9 rounded-lg border-0 bg-background shadow-none hover:bg-accent hover:text-accent-foreground focus:bg-accent md:border md:border-border [&_svg]:size-5",
className,
)}
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ export default function ViewTabs({
<TabsList>
<TabsTrigger
value="ebook"
disabled={isPdfSource}
className="disabled:opacity-40"
disabled={isPdfSource}
tooltip={isPdfSource ? t("reader.not-available") : undefined}
tooltipProps={{ side: "bottom" }}
>
{t("common.e-book")}
</TabsTrigger>
Expand All @@ -33,6 +35,8 @@ export default function ViewTabs({
value="pdf"
disabled={!hasPdf}
className="disabled:opacity-40"
tooltip={!hasPdf ? t("reader.not-available") : undefined}
tooltipProps={{ side: "bottom" }}
>
{t("common.pdf")}
</TabsTrigger>
Expand Down
11 changes: 6 additions & 5 deletions src/app/_components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,12 @@ export default function Navbar({ layout, secondNav }: NavbarProps) {
{isSearchOpen && (
<MobileMenu className="z-[42] pt-10">
<div className="absolute top-4 flex items-center gap-2 ltr:left-2 rtl:right-2">
<Button size="icon" variant="ghost">
<ArrowLeftIcon
className="block h-5 w-5 rtl:rotate-180"
onClick={() => setIsSearchOpen(false)}
/>
<Button
size="icon"
variant="ghost"
onClick={() => setIsSearchOpen(false)}
>
<ArrowLeftIcon className="block h-5 w-5 rtl:rotate-180" />
</Button>

<h1 className="text-lg font-semibold">{t("common.search")}</h1>
Expand Down
50 changes: 39 additions & 11 deletions src/components/ui/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import * as React from "react";
import * as TabsPrimitive from "@radix-ui/react-tabs";

import { cn } from "@/lib/utils";
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip";
import { TooltipPortal } from "@radix-ui/react-tooltip";

const Tabs = TabsPrimitive.Root;

Expand All @@ -24,17 +26,43 @@ TabsList.displayName = TabsPrimitive.List.displayName;

const TabsTrigger = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex h-full items-center justify-center whitespace-nowrap rounded px-3 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
className,
)}
{...props}
/>
));
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {
tooltip?: string;
tooltipProps?: React.ComponentPropsWithoutRef<typeof TooltipContent>;
}
>(({ className, tooltip, tooltipProps, children, ...props }, ref) => {
const showTooltip = !!tooltip;

const trigger = (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex h-full items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
!showTooltip && "px-3 disabled:pointer-events-none",
className,
)}
{...props}
>
{showTooltip ? (
<Tooltip>
<TooltipTrigger
className="flex h-full w-full items-center justify-center px-3"
asChild
>
<span>{children}</span>
</TooltipTrigger>
<TooltipPortal>
<TooltipContent {...tooltipProps}>{tooltip}</TooltipContent>
</TooltipPortal>
</Tooltip>
) : (
children
)}
</TabsPrimitive.Trigger>
);

return trigger;
});
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;

const TabsContent = React.forwardRef<
Expand Down

0 comments on commit 99acad3

Please sign in to comment.