Spaces:
Sleeping
Sleeping
Commit
·
65aff80
1
Parent(s):
03b6c08
chore(embed): hide login/save/gallery/help globally on Space via NEXT_PUBLIC_EMBED_MODE=true; UI gating for banner and nav; minor cleanup
Browse files- Dockerfile +2 -0
- components/editor/ask-ai/index.tsx +1 -1
- components/editor/footer/index.tsx +25 -21
- components/public/navigation/index.tsx +2 -1
Dockerfile
CHANGED
|
@@ -28,5 +28,7 @@ ENV PORT=7860
|
|
| 28 |
# Disable telemetry and ensure production env
|
| 29 |
ENV NEXT_TELEMETRY_DISABLED=1
|
| 30 |
ENV NODE_ENV=production
|
|
|
|
|
|
|
| 31 |
# Start via script that logs and honors $PORT
|
| 32 |
ENTRYPOINT ["/usr/src/app/start.sh"]
|
|
|
|
| 28 |
# Disable telemetry and ensure production env
|
| 29 |
ENV NEXT_TELEMETRY_DISABLED=1
|
| 30 |
ENV NODE_ENV=production
|
| 31 |
+
# Enable embed/lite mode UI and auth disablement in the Space
|
| 32 |
+
ENV NEXT_PUBLIC_EMBED_MODE=true
|
| 33 |
# Start via script that logs and honors $PORT
|
| 34 |
ENTRYPOINT ["/usr/src/app/start.sh"]
|
components/editor/ask-ai/index.tsx
CHANGED
|
@@ -472,7 +472,7 @@ export function AskAI({
|
|
| 472 |
open={openProModal}
|
| 473 |
onClose={() => setOpenProModal(false)}
|
| 474 |
/>
|
| 475 |
-
{pages.length === 1 && (
|
| 476 |
<div className="border border-sky-500/20 bg-sky-500/40 hover:bg-sky-600 transition-all duration-200 text-sky-500 pl-2 pr-4 py-1.5 text-xs rounded-full absolute top-0 -translate-y-[calc(100%+8px)] left-0 max-w-max flex items-center justify-start gap-2">
|
| 477 |
<span className="rounded-full text-[10px] font-semibold bg-white text-neutral-900 px-1.5 py-0.5">
|
| 478 |
NEW
|
|
|
|
| 472 |
open={openProModal}
|
| 473 |
onClose={() => setOpenProModal(false)}
|
| 474 |
/>
|
| 475 |
+
{pages.length === 1 && !EMBED_MODE && (
|
| 476 |
<div className="border border-sky-500/20 bg-sky-500/40 hover:bg-sky-600 transition-all duration-200 text-sky-500 pl-2 pr-4 py-1.5 text-xs rounded-full absolute top-0 -translate-y-[calc(100%+8px)] left-0 max-w-max flex items-center justify-start gap-2">
|
| 477 |
<span className="rounded-full text-[10px] font-semibold bg-white text-neutral-900 px-1.5 py-0.5">
|
| 478 |
NEW
|
components/editor/footer/index.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";
|
|
| 7 |
import { MdAdd } from "react-icons/md";
|
| 8 |
import { History } from "@/components/editor/history";
|
| 9 |
import { UserMenu } from "@/components/user-menu";
|
| 10 |
-
import { HIDE_DEPLOY, HIDE_LOGIN } from "@/lib/flags";
|
| 11 |
import { useUser } from "@/hooks/useUser";
|
| 12 |
import Link from "next/link";
|
| 13 |
import { useLocalStorage } from "react-use";
|
|
@@ -98,26 +98,30 @@ export function Footer({
|
|
| 98 |
)}
|
| 99 |
</div>
|
| 100 |
<div className="flex justify-end items-center gap-2.5">
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
<Button size="sm" variant="outline" onClick={handleRefreshIframe}>
|
| 122 |
<RefreshCcw className="size-3.5" />
|
| 123 |
<span className="max-lg:hidden">Refresh Preview</span>
|
|
|
|
| 7 |
import { MdAdd } from "react-icons/md";
|
| 8 |
import { History } from "@/components/editor/history";
|
| 9 |
import { UserMenu } from "@/components/user-menu";
|
| 10 |
+
import { EMBED_MODE, HIDE_DEPLOY, HIDE_LOGIN } from "@/lib/flags";
|
| 11 |
import { useUser } from "@/hooks/useUser";
|
| 12 |
import Link from "next/link";
|
| 13 |
import { useLocalStorage } from "react-use";
|
|
|
|
| 98 |
)}
|
| 99 |
</div>
|
| 100 |
<div className="flex justify-end items-center gap-2.5">
|
| 101 |
+
{!EMBED_MODE && (
|
| 102 |
+
<>
|
| 103 |
+
<a
|
| 104 |
+
href="https://huggingface.co/spaces/victor/deepsite-gallery"
|
| 105 |
+
target="_blank"
|
| 106 |
+
rel="noopener noreferrer"
|
| 107 |
+
>
|
| 108 |
+
<Button size="sm" variant="ghost">
|
| 109 |
+
<SparkleIcon className="size-3.5" />
|
| 110 |
+
<span className="max-lg:hidden">DeepSite Gallery</span>
|
| 111 |
+
</Button>
|
| 112 |
+
</a>
|
| 113 |
+
<a
|
| 114 |
+
target="_blank"
|
| 115 |
+
href="https://huggingface.co/spaces/enzostvs/deepsite/discussions/157"
|
| 116 |
+
rel="noopener noreferrer"
|
| 117 |
+
>
|
| 118 |
+
<Button size="sm" variant="outline">
|
| 119 |
+
<HelpCircle className="size-3.5" />
|
| 120 |
+
<span className="max-lg:hidden">Help</span>
|
| 121 |
+
</Button>
|
| 122 |
+
</a>
|
| 123 |
+
</>
|
| 124 |
+
)}
|
| 125 |
<Button size="sm" variant="outline" onClick={handleRefreshIframe}>
|
| 126 |
<RefreshCcw className="size-3.5" />
|
| 127 |
<span className="max-lg:hidden">Refresh Preview</span>
|
components/public/navigation/index.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import classNames from "classnames";
|
|
| 9 |
import { Button } from "@/components/ui/button";
|
| 10 |
import Logo from "@/assets/logo.svg";
|
| 11 |
import { useUser } from "@/hooks/useUser";
|
|
|
|
| 12 |
import { UserMenu } from "@/components/user-menu";
|
| 13 |
|
| 14 |
const navigationLinks = [
|
|
@@ -141,7 +142,7 @@ export default function Navigation() {
|
|
| 141 |
</li>
|
| 142 |
</ul>
|
| 143 |
<div className="flex items-center justify-end gap-2">
|
| 144 |
-
{user ? (
|
| 145 |
<UserMenu className="!pl-3 !pr-4 !py-2 !h-auto !rounded-lg" />
|
| 146 |
) : (
|
| 147 |
<>
|
|
|
|
| 9 |
import { Button } from "@/components/ui/button";
|
| 10 |
import Logo from "@/assets/logo.svg";
|
| 11 |
import { useUser } from "@/hooks/useUser";
|
| 12 |
+
import { HIDE_LOGIN } from "@/lib/flags";
|
| 13 |
import { UserMenu } from "@/components/user-menu";
|
| 14 |
|
| 15 |
const navigationLinks = [
|
|
|
|
| 142 |
</li>
|
| 143 |
</ul>
|
| 144 |
<div className="flex items-center justify-end gap-2">
|
| 145 |
+
{HIDE_LOGIN ? null : user ? (
|
| 146 |
<UserMenu className="!pl-3 !pr-4 !py-2 !h-auto !rounded-lg" />
|
| 147 |
) : (
|
| 148 |
<>
|