enzostvs HF staff commited on
Commit
8e92e61
·
1 Parent(s): 8de4798
Files changed (2) hide show
  1. server.js +1 -1
  2. src/components/preview/preview.tsx +10 -7
server.js CHANGED
@@ -38,7 +38,7 @@ app.use(bodyParser.json());
38
  app.use(express.static(path.join(__dirname, "dist")));
39
 
40
  const getPTag = (repoId) => {
41
- return `<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=${repoId}" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p>`;
42
  };
43
 
44
  app.get("/api/login", (_req, res) => {
 
38
  app.use(express.static(path.join(__dirname, "dist")));
39
 
40
  const getPTag = (repoId) => {
41
+ return `<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=${repoId}" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p>`;
42
  };
43
 
44
  app.get("/api/login", (_req, res) => {
src/components/preview/preview.tsx CHANGED
@@ -3,6 +3,7 @@ import { useRef } from "react";
3
  import { TbReload } from "react-icons/tb";
4
  import { toast } from "react-toastify";
5
  import { FaLaptopCode } from "react-icons/fa6";
 
6
 
7
  function Preview({
8
  html,
@@ -59,13 +60,15 @@ function Preview({
59
  <FaLaptopCode />
60
  Back to Editor
61
  </button>
62
- <a
63
- href="https://huggingface.co/spaces/victor/deepsite-gallery"
64
- target="_blank"
65
- className="bg-gray-200 text-gray-950 text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-200 hover:bg-gray-300 transition-all duration-100 cursor-pointer"
66
- >
67
- 🖼️ <span>DeepSite Gallery</span>
68
- </a>
 
 
69
  <button
70
  className="bg-white lg:bg-gray-950 shadow-md text-gray-950 lg:text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 lg:border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
71
  onClick={handleRefreshIframe}
 
3
  import { TbReload } from "react-icons/tb";
4
  import { toast } from "react-toastify";
5
  import { FaLaptopCode } from "react-icons/fa6";
6
+ import { defaultHTML } from "../../../utils/consts";
7
 
8
  function Preview({
9
  html,
 
60
  <FaLaptopCode />
61
  Back to Editor
62
  </button>
63
+ {html === defaultHTML && (
64
+ <a
65
+ href="https://huggingface.co/spaces/victor/deepsite-gallery"
66
+ target="_blank"
67
+ className="bg-gray-200 text-gray-950 text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-200 hover:bg-gray-300 transition-all duration-100 cursor-pointer"
68
+ >
69
+ 🖼️ <span>DeepSite Gallery</span>
70
+ </a>
71
+ )}
72
  <button
73
  className="bg-white lg:bg-gray-950 shadow-md text-gray-950 lg:text-white text-xs lg:text-sm font-medium py-2 px-3 lg:px-4 rounded-lg flex items-center gap-2 border border-gray-100 lg:border-gray-900 hover:brightness-150 transition-all duration-100 cursor-pointer"
74
  onClick={handleRefreshIframe}