Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "@/styles/global.css";
import AdminLink from "@/components/ui/admin-link";
import { TailwindIndicator } from "@/components/ui/tailwind-indicator";
import { ThemeSelector } from "@/components/ui/theme-selector";
import settings from "@/content/settings/config.json";
import client from "@/tina/__generated__/client";
import { ThemeProvider } from "next-themes";
import { Inter, Roboto_Flex } from "next/font/google";

import { Footer } from "@/components/docs/footer";
import { TabsLayout } from "@/components/docs/layout/tab-layout";
import type React from "react";
import { TinaClient } from "./tina-client";
Expand All @@ -19,7 +19,7 @@ const heading = Roboto_Flex({
variable: "--heading-font",
});

const isThemeSelectorEnabled =
export const isThemeSelectorEnabled =
process.env.NODE_ENV === "development" ||
process.env.NEXT_PUBLIC_ENABLE_THEME_SELECTION === "true";

Expand All @@ -44,7 +44,6 @@ export default function RootLayout({
enableSystem={true}
disableTransitionOnChange={false}
>
{isThemeSelectorEnabled && <ThemeSelector />}
<Content>
<DocsMenu>{children}</DocsMenu>
</Content>
Expand All @@ -60,6 +59,7 @@ const Content = ({ children }: { children?: React.ReactNode }) => (
<TailwindIndicator />
<div className="font-sans flex min-h-screen flex-col bg-background-color">
<div className="flex flex-1 flex-col items-center">{children}</div>
<Footer />
</div>
</>
);
Expand Down
33 changes: 33 additions & 0 deletions src/components/docs/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { isThemeSelectorEnabled } from "@/app/layout";
import { ThemeSelector } from "@/components/ui/theme-selector";
import Image from "next/image";
import Link from "next/link";

export const Footer = () => {
return (
<footer className="w-full py-8 mt-16 border-t border-gray-200 dark:border-gray-700">
<div className="max-w-[2560px] mx-auto px-4 flex items-center justify-center relative">
<Link
href="https://tina.io/"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-3 hover:opacity-80 transition-opacity"
>
<Image
src="/svg/tina-icon-orange.svg"
alt="Tina Logo"
width={48}
height={48}
className="w-12 h-12"
/>
<span className="text-base font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide">
Powered by TinaCMS
</span>
</Link>
<div className="absolute right-4">
{isThemeSelectorEnabled && <ThemeSelector />}
</div>
</div>
</footer>
);
};
2 changes: 1 addition & 1 deletion src/components/ui/theme-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const ThemeSelector = () => {
};

return (
<div className="fixed bottom-4 right-4 z-50 bg-neutral-surface p-1 rounded-lg shadow-lg">
<div className="bg-neutral-surface p-1 rounded-lg shadow-lg">
<div className="relative" ref={dropdownRef}>
<div className="flex items-center gap-2">
<div className="relative" ref={tooltipRef}>
Expand Down