feat: update branding with official HiHala logo + 'Museums Data'

- Add official HiHala logo SVG (text portion from v1.5)
- Replace text-based nav brand with logo image + 'Museums Data'
- Update data source to default to NocoDB with Sheets fallback
- Move all credentials to environment variables (.env.local)
This commit is contained in:
fahed
2026-02-02 14:08:17 +03:00
parent c0c36c7904
commit 61187b8a2e
5 changed files with 61 additions and 16 deletions

View File

@@ -159,14 +159,22 @@ body {
}
.nav-brand {
font-size: 1.125rem;
display: flex;
align-items: center;
gap: 8px;
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
color: var(--text-secondary);
letter-spacing: -0.02em;
}
.nav-logo {
height: 24px;
width: auto;
}
.nav-brand span {
color: var(--gold);
color: var(--text-secondary);
}
.nav-links {
@@ -1011,7 +1019,11 @@ table tbody tr:hover {
}
.nav-brand {
font-size: 1.1rem;
font-size: 0.9rem;
}
.nav-logo {
height: 20px;
}
/* Mobile Bottom Navigation */

View File

@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { BrowserRouter as Router, Routes, Route, Link, useLocation } from 'react-router-dom';
import Dashboard from './components/Dashboard';
import Comparison from './components/Comparison';
import { fetchSheetData } from './services/dataService';
import { fetchData } from './services/dataService';
import './App.css';
function NavLink({ to, children }) {
@@ -25,7 +25,7 @@ function App() {
async function loadData() {
try {
setLoading(true);
const result = await fetchSheetData();
const result = await fetchData();
setData(result);
setError(null);
} catch (err) {
@@ -61,7 +61,10 @@ function App() {
<Router>
<div className="app">
<nav className="nav-bar">
<div className="nav-brand">Hi<span>Hala</span> Museums</div>
<div className="nav-brand">
<img src="/hihala-logo.svg" alt="HiHala" className="nav-logo" />
<span>Museums Data</span>
</div>
<div className="nav-links">
<NavLink to="/">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">

View File

@@ -1,13 +1,17 @@
// Google Sheets configuration
const SPREADSHEET_ID = '1rdK1e7jmfu-es4Ql0YwDYNBY2OvVihBjYaXTM-MHHqg';
const SHEET_NAME = 'Consolidated Data';
const SHEET_URL = `https://docs.google.com/spreadsheets/d/${SPREADSHEET_ID}/gviz/tq?tqx=out:csv&sheet=${encodeURIComponent(SHEET_NAME)}`;
// Data source configuration - all from environment variables
// Set these in .env.local (never commit .env.local to git)
// NocoDB configuration - uses environment variables for security
// Set REACT_APP_NOCODB_URL and REACT_APP_NOCODB_TOKEN in .env.local
// NocoDB (primary/default)
const NOCODB_URL = process.env.REACT_APP_NOCODB_URL || '';
const NOCODB_TOKEN = process.env.REACT_APP_NOCODB_TOKEN || '';
// Google Sheets (fallback)
const SPREADSHEET_ID = process.env.REACT_APP_SHEETS_ID || '';
const SHEET_NAME = process.env.REACT_APP_SHEETS_NAME || 'Consolidated Data';
const SHEET_URL = SPREADSHEET_ID
? `https://docs.google.com/spreadsheets/d/${SPREADSHEET_ID}/gviz/tq?tqx=out:csv&sheet=${encodeURIComponent(SHEET_NAME)}`
: '';
// Table IDs (not sensitive - just identifiers)
const NOCODB_TABLES = {
districts: 'm8cup7lesbet0sa',
@@ -168,8 +172,23 @@ export async function fetchNocoDBData() {
}
}
export async function fetchData(source = 'sheets') {
return source === 'nocodb' ? fetchNocoDBData() : fetchSheetData();
// Main data fetcher - tries NocoDB first, falls back to Sheets
export async function fetchData() {
// Try NocoDB if configured
if (NOCODB_URL && NOCODB_TOKEN) {
try {
return await fetchNocoDBData();
} catch (err) {
console.warn('NocoDB failed, trying Google Sheets fallback...', err.message);
}
}
// Fallback to Google Sheets if configured
if (SHEET_URL) {
return await fetchSheetData();
}
throw new Error('No data source configured. Set REACT_APP_NOCODB_URL + REACT_APP_NOCODB_TOKEN, or REACT_APP_SHEETS_ID in .env.local');
}
export function filterData(data, filters) {