Browse Source

feat: git hash всегда отображается в правом нижнем углу

neyrogovnarik 1 month ago
parent
commit
87f136765b
3 changed files with 6 additions and 1 deletions
  1. 1 0
      deploy/env.prod.example
  2. 1 0
      docker-compose.yml
  3. 4 1
      frontend/src/app/layout.tsx

+ 1 - 0
deploy/env.prod.example

@@ -31,6 +31,7 @@ CLOUDPAYMENTS_API_SECRET=
 # ----- Frontend -----
 NEXT_PUBLIC_API_URL=https://api.photoplaces.ru/api/v1
 NEXT_PUBLIC_MAP_PROVIDER=yandex
+NEXT_PUBLIC_GIT_HASH=
 YANDEX_MAPS_API_KEY=
 
 # ----- CORS (comma-separated domains) -----

+ 1 - 0
docker-compose.yml

@@ -103,6 +103,7 @@ services:
       NEXT_PUBLIC_API_URL: http://localhost:8080/api/v1
       NEXT_PUBLIC_MAP_PROVIDER: yandex
       NEXT_PUBLIC_YANDEX_MAPS_API_KEY: ""
+      NEXT_PUBLIC_GIT_HASH: ${NEXT_PUBLIC_GIT_HASH:-dev}
     depends_on:
       backend:
         condition: service_healthy

+ 4 - 1
frontend/src/app/layout.tsx

@@ -29,7 +29,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
           <div className="flex items-center justify-center">
             <p className="text-xs text-white/20">&copy; {year} PhotoPlaces</p>
           </div>
-          <p className="absolute right-4 bottom-3 text-xs text-white/20">{version}</p>
+          <p className="absolute right-4 bottom-3 text-xs text-white/30 hover:text-white/60 transition cursor-default"
+             title={version === 'dev' ? 'Локальная сборка' : `Коммит: ${version}`}>
+            {version === 'dev' ? 'dev' : version.slice(0, 7)}
+          </p>
         </div>
       </body>
     </html>