Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	add gallery button to victor's space
Browse files- server.js +5 -1
 - src/components/preview/preview.tsx +7 -0
 - utils/consts.ts +0 -5
 
    	
        server.js
    CHANGED
    
    | 
         @@ -106,7 +106,11 @@ app.get("/api/@me", checkUser, async (req, res) => { 
     | 
|
| 106 | 
         
             
                const user = await request_user.json();
         
     | 
| 107 | 
         
             
                res.send(user);
         
     | 
| 108 | 
         
             
              } catch (err) {
         
     | 
| 109 | 
         
            -
                res.clearCookie("hf_token" 
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 110 | 
         
             
                res.status(401).send({
         
     | 
| 111 | 
         
             
                  ok: false,
         
     | 
| 112 | 
         
             
                  message: err.message,
         
     | 
| 
         | 
|
| 106 | 
         
             
                const user = await request_user.json();
         
     | 
| 107 | 
         
             
                res.send(user);
         
     | 
| 108 | 
         
             
              } catch (err) {
         
     | 
| 109 | 
         
            +
                res.clearCookie("hf_token", {
         
     | 
| 110 | 
         
            +
                  httpOnly: false,
         
     | 
| 111 | 
         
            +
                  secure: true,
         
     | 
| 112 | 
         
            +
                  sameSite: "none",
         
     | 
| 113 | 
         
            +
                });
         
     | 
| 114 | 
         
             
                res.status(401).send({
         
     | 
| 115 | 
         
             
                  ok: false,
         
     | 
| 116 | 
         
             
                  message: err.message,
         
     | 
    	
        src/components/preview/preview.tsx
    CHANGED
    
    | 
         @@ -58,6 +58,13 @@ function Preview({ 
     | 
|
| 58 | 
         
             
                      <FaLaptopCode />
         
     | 
| 59 | 
         
             
                      Back to Editor
         
     | 
| 60 | 
         
             
                    </button>
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 61 | 
         
             
                    <button
         
     | 
| 62 | 
         
             
                      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"
         
     | 
| 63 | 
         
             
                      onClick={handleRefreshIframe}
         
     | 
| 
         | 
|
| 58 | 
         
             
                      <FaLaptopCode />
         
     | 
| 59 | 
         
             
                      Back to Editor
         
     | 
| 60 | 
         
             
                    </button>
         
     | 
| 61 | 
         
            +
                    <a
         
     | 
| 62 | 
         
            +
                      href="https://huggingface.co/spaces/victor/deepsite-gallery"
         
     | 
| 63 | 
         
            +
                      target="_blank"
         
     | 
| 64 | 
         
            +
                      className="bg-indigo-500 shadow-md 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-indigo-500 hover:brightness-150 transition-all duration-100 cursor-pointer"
         
     | 
| 65 | 
         
            +
                    >
         
     | 
| 66 | 
         
            +
                      🖼️ <span>Deepsite Gallery</span>
         
     | 
| 67 | 
         
            +
                    </a>
         
     | 
| 68 | 
         
             
                    <button
         
     | 
| 69 | 
         
             
                      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"
         
     | 
| 70 | 
         
             
                      onClick={handleRefreshIframe}
         
     | 
    	
        utils/consts.ts
    CHANGED
    
    | 
         @@ -28,11 +28,6 @@ export const defaultHTML = `<!DOCTYPE html> 
     | 
|
| 28 | 
         
             
                    color: #acacac;
         
     | 
| 29 | 
         
             
                    font-size: 32px;
         
     | 
| 30 | 
         
             
                  }
         
     | 
| 31 | 
         
            -
                  @media screen and (max-width: 640px) {
         
     | 
| 32 | 
         
            -
                    .arrow {
         
     | 
| 33 | 
         
            -
                      display: none;
         
     | 
| 34 | 
         
            -
                    }
         
     | 
| 35 | 
         
            -
                  }
         
     | 
| 36 | 
         
             
                </style>
         
     | 
| 37 | 
         
             
              </head>
         
     | 
| 38 | 
         
             
              <body>
         
     | 
| 
         | 
|
| 28 | 
         
             
                    color: #acacac;
         
     | 
| 29 | 
         
             
                    font-size: 32px;
         
     | 
| 30 | 
         
             
                  }
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 31 | 
         
             
                </style>
         
     | 
| 32 | 
         
             
              </head>
         
     | 
| 33 | 
         
             
              <body>
         
     |