feat: new layout, rooms row, fix weather+HA, fix BottomNav overflow
All checks were successful
Deploy to Coolify / deploy (push) Successful in 5s

- Remove TasksCard and SavingsCard from home tab
- New grid layout: lights+thermostat row 1, purifier+weather row 2
- Add RoomsRow component with room navigation
- Fix HA entity mapping: fan.zhimi_rmb1_9528_air_purifier → fan.air_purifier
- Add real entity aliases for HA route
- Fix weather route: add timeout, better error handling
- Fix BottomNav: use 100dvh + flex-shrink-0
- TopBar: accept isDemo prop, show Demo badge in header
- WeatherCard: compact prop, better loading/error states
- globals.css: add no-scrollbar utility
This commit is contained in:
Cosmo
2026-04-22 10:33:20 +00:00
parent ecf69400f6
commit 088cd35ea6
7 changed files with 375 additions and 152 deletions

View File

@@ -22,9 +22,10 @@ interface Props {
isDark: boolean;
onToggleTheme: () => void;
weather: any;
isDemo?: boolean;
}
export default function TopBar({ isDark, onToggleTheme, weather }: Props) {
export default function TopBar({ isDark, onToggleTheme, weather, isDemo }: Props) {
const [time, setTime] = useState("");
const [date, setDate] = useState("");
@@ -49,7 +50,7 @@ export default function TopBar({ isDark, onToggleTheme, weather }: Props) {
return (
<motion.div
className="glass-card px-6 py-3 flex items-center justify-between no-select"
className="glass-card px-6 py-3 flex items-center justify-between no-select flex-shrink-0"
style={{ borderRadius: "20px" }}
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
@@ -72,7 +73,7 @@ export default function TopBar({ isDark, onToggleTheme, weather }: Props) {
</div>
{/* Weather pill */}
{weather && (
{weather && weather.temp !== "—" ? (
<motion.div
className="flex items-center gap-3 px-5 py-2 rounded-2xl"
style={{
@@ -101,21 +102,30 @@ export default function TopBar({ isDark, onToggleTheme, weather }: Props) {
</div>
</div>
</motion.div>
)}
) : weather ? (
<div
className="text-sm px-4 py-2 rounded-2xl"
style={{ color: "var(--text-secondary)", background: "rgba(255,255,255,0.04)" }}
>
🌤 Загрузка...
</div>
) : null}
{/* Theme toggle */}
{/* Theme toggle + Demo badge */}
<div className="flex items-center gap-3">
{weather?.demo && (
<span
{isDemo && (
<motion.span
className="text-xs px-2.5 py-1 rounded-full font-semibold"
style={{
background: "rgba(245,158,11,0.15)",
color: "#f59e0b",
border: "1px solid rgba(245,158,11,0.3)",
}}
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
>
Demo
</span>
</motion.span>
)}
<ThemeToggle isDark={isDark} onToggle={onToggleTheme} />
</div>