Removed manus and small ui tweak
This commit is contained in:
@@ -78,7 +78,6 @@
|
|||||||
"tw-animate-css": "^1.4.0",
|
"tw-animate-css": "^1.4.0",
|
||||||
"typescript": "5.6.3",
|
"typescript": "5.6.3",
|
||||||
"vite": "^7.1.7",
|
"vite": "^7.1.7",
|
||||||
"vite-plugin-manus-runtime": "^0.0.57",
|
|
||||||
"vitest": "^2.1.4"
|
"vitest": "^2.1.4"
|
||||||
},
|
},
|
||||||
"packageManager": "[email protected]"
|
"packageManager": "[email protected]"
|
||||||
|
|||||||
@@ -1,85 +0,0 @@
|
|||||||
import { useEffect, useState } from "react";
|
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogFooter,
|
|
||||||
DialogTitle,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
|
|
||||||
interface ManusDialogProps {
|
|
||||||
title?: string;
|
|
||||||
logo?: string;
|
|
||||||
open?: boolean;
|
|
||||||
onLogin: () => void;
|
|
||||||
onOpenChange?: (open: boolean) => void;
|
|
||||||
onClose?: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function ManusDialog({
|
|
||||||
title,
|
|
||||||
logo,
|
|
||||||
open = false,
|
|
||||||
onLogin,
|
|
||||||
onOpenChange,
|
|
||||||
onClose,
|
|
||||||
}: ManusDialogProps) {
|
|
||||||
const [internalOpen, setInternalOpen] = useState(open);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!onOpenChange) {
|
|
||||||
setInternalOpen(open);
|
|
||||||
}
|
|
||||||
}, [open, onOpenChange]);
|
|
||||||
|
|
||||||
const handleOpenChange = (nextOpen: boolean) => {
|
|
||||||
if (onOpenChange) {
|
|
||||||
onOpenChange(nextOpen);
|
|
||||||
} else {
|
|
||||||
setInternalOpen(nextOpen);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nextOpen) {
|
|
||||||
onClose?.();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
open={onOpenChange ? open : internalOpen}
|
|
||||||
onOpenChange={handleOpenChange}
|
|
||||||
>
|
|
||||||
<DialogContent className="py-5 bg-[#f8f8f7] rounded-[20px] w-[400px] shadow-[0px_4px_11px_0px_rgba(0,0,0,0.08)] border border-[rgba(0,0,0,0.08)] backdrop-blur-2xl p-0 gap-0 text-center">
|
|
||||||
<div className="flex flex-col items-center gap-2 p-5 pt-12">
|
|
||||||
{logo ? (
|
|
||||||
<div className="w-16 h-16 bg-white rounded-xl border border-[rgba(0,0,0,0.08)] flex items-center justify-center">
|
|
||||||
<img src={logo} alt="Dialog graphic" className="w-10 h-10 rounded-md" />
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
{/* Title and subtitle */}
|
|
||||||
{title ? (
|
|
||||||
<DialogTitle className="text-xl font-semibold text-[#34322d] leading-[26px] tracking-[-0.44px]">
|
|
||||||
{title}
|
|
||||||
</DialogTitle>
|
|
||||||
) : null}
|
|
||||||
<DialogDescription className="text-sm text-[#858481] leading-5 tracking-[-0.154px]">
|
|
||||||
Please login with Manus to continue
|
|
||||||
</DialogDescription>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<DialogFooter className="px-5 py-5">
|
|
||||||
{/* Login button */}
|
|
||||||
<Button
|
|
||||||
onClick={onLogin}
|
|
||||||
className="w-full h-10 bg-[#1a1a19] hover:bg-[#1a1a19]/90 text-white rounded-[10px] text-sm font-medium leading-5 tracking-[-0.154px]"
|
|
||||||
>
|
|
||||||
Login with Manus
|
|
||||||
</Button>
|
|
||||||
</DialogFooter>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
/**
|
|
||||||
* GOOGLE MAPS FRONTEND INTEGRATION - ESSENTIAL GUIDE
|
|
||||||
*
|
|
||||||
* USAGE FROM PARENT COMPONENT:
|
|
||||||
* ======
|
|
||||||
*
|
|
||||||
* const mapRef = useRef<google.maps.Map | null>(null);
|
|
||||||
*
|
|
||||||
* <MapView
|
|
||||||
* initialCenter={{ lat: 40.7128, lng: -74.0060 }}
|
|
||||||
* initialZoom={15}
|
|
||||||
* onMapReady={(map) => {
|
|
||||||
* mapRef.current = map; // Store to control map from parent anytime, google map itself is in charge of the re-rendering, not react state.
|
|
||||||
* </MapView>
|
|
||||||
*
|
|
||||||
* ======
|
|
||||||
* Available Libraries and Core Features:
|
|
||||||
* -------------------------------
|
|
||||||
* 📍 MARKER (from `marker` library)
|
|
||||||
* - Attaches to map using { map, position }
|
|
||||||
* new google.maps.marker.AdvancedMarkerElement({
|
|
||||||
* map,
|
|
||||||
* position: { lat: 37.7749, lng: -122.4194 },
|
|
||||||
* title: "San Francisco",
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* -------------------------------
|
|
||||||
* 🏢 PLACES (from `places` library)
|
|
||||||
* - Does not attach directly to map; use data with your map manually.
|
|
||||||
* const place = new google.maps.places.Place({ id: PLACE_ID });
|
|
||||||
* await place.fetchFields({ fields: ["displayName", "location"] });
|
|
||||||
* map.setCenter(place.location);
|
|
||||||
* new google.maps.marker.AdvancedMarkerElement({ map, position: place.location });
|
|
||||||
*
|
|
||||||
* -------------------------------
|
|
||||||
* 🧭 GEOCODER (from `geocoding` library)
|
|
||||||
* - Standalone service; manually apply results to map.
|
|
||||||
* const geocoder = new google.maps.Geocoder();
|
|
||||||
* geocoder.geocode({ address: "New York" }, (results, status) => {
|
|
||||||
* if (status === "OK" && results[0]) {
|
|
||||||
* map.setCenter(results[0].geometry.location);
|
|
||||||
* new google.maps.marker.AdvancedMarkerElement({
|
|
||||||
* map,
|
|
||||||
* position: results[0].geometry.location,
|
|
||||||
* });
|
|
||||||
* }
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* -------------------------------
|
|
||||||
* 📐 GEOMETRY (from `geometry` library)
|
|
||||||
* - Pure utility functions; not attached to map.
|
|
||||||
* const dist = google.maps.geometry.spherical.computeDistanceBetween(p1, p2);
|
|
||||||
*
|
|
||||||
* -------------------------------
|
|
||||||
* 🛣️ ROUTES (from `routes` library)
|
|
||||||
* - Combines DirectionsService (standalone) + DirectionsRenderer (map-attached)
|
|
||||||
* const directionsService = new google.maps.DirectionsService();
|
|
||||||
* const directionsRenderer = new google.maps.DirectionsRenderer({ map });
|
|
||||||
* directionsService.route(
|
|
||||||
* { origin, destination, travelMode: "DRIVING" },
|
|
||||||
* (res, status) => status === "OK" && directionsRenderer.setDirections(res)
|
|
||||||
* );
|
|
||||||
*
|
|
||||||
* -------------------------------
|
|
||||||
* 🌦️ MAP LAYERS (attach directly to map)
|
|
||||||
* - new google.maps.TrafficLayer().setMap(map);
|
|
||||||
* - new google.maps.TransitLayer().setMap(map);
|
|
||||||
* - new google.maps.BicyclingLayer().setMap(map);
|
|
||||||
*
|
|
||||||
* -------------------------------
|
|
||||||
* ✅ SUMMARY
|
|
||||||
* - “map-attached” → AdvancedMarkerElement, DirectionsRenderer, Layers.
|
|
||||||
* - “standalone” → Geocoder, DirectionsService, DistanceMatrixService, ElevationService.
|
|
||||||
* - “data-only” → Place, Geometry utilities.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/// <reference types="@types/google.maps" />
|
|
||||||
|
|
||||||
import { useEffect, useRef } from "react";
|
|
||||||
import { usePersistFn } from "@/hooks/usePersistFn";
|
|
||||||
import { cn } from "@/lib/utils";
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
google?: typeof google;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const API_KEY = import.meta.env.VITE_FRONTEND_FORGE_API_KEY;
|
|
||||||
const FORGE_BASE_URL =
|
|
||||||
import.meta.env.VITE_FRONTEND_FORGE_API_URL ||
|
|
||||||
"https://forge.butterfly-effect.dev";
|
|
||||||
const MAPS_PROXY_URL = `${FORGE_BASE_URL}/v1/maps/proxy`;
|
|
||||||
|
|
||||||
function loadMapScript() {
|
|
||||||
return new Promise(resolve => {
|
|
||||||
const script = document.createElement("script");
|
|
||||||
script.src = `${MAPS_PROXY_URL}/maps/api/js?key=${API_KEY}&v=weekly&libraries=marker,places,geocoding,geometry`;
|
|
||||||
script.async = true;
|
|
||||||
script.crossOrigin = "anonymous";
|
|
||||||
script.onload = () => {
|
|
||||||
resolve(null);
|
|
||||||
script.remove(); // Clean up immediately
|
|
||||||
};
|
|
||||||
script.onerror = () => {
|
|
||||||
console.error("Failed to load Google Maps script");
|
|
||||||
};
|
|
||||||
document.head.appendChild(script);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MapViewProps {
|
|
||||||
className?: string;
|
|
||||||
initialCenter?: google.maps.LatLngLiteral;
|
|
||||||
initialZoom?: number;
|
|
||||||
onMapReady?: (map: google.maps.Map) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function MapView({
|
|
||||||
className,
|
|
||||||
initialCenter = { lat: 37.7749, lng: -122.4194 },
|
|
||||||
initialZoom = 12,
|
|
||||||
onMapReady,
|
|
||||||
}: MapViewProps) {
|
|
||||||
const mapContainer = useRef<HTMLDivElement>(null);
|
|
||||||
const map = useRef<google.maps.Map | null>(null);
|
|
||||||
|
|
||||||
const init = usePersistFn(async () => {
|
|
||||||
await loadMapScript();
|
|
||||||
if (!mapContainer.current) {
|
|
||||||
console.error("Map container not found");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
map.current = new window.google.maps.Map(mapContainer.current, {
|
|
||||||
zoom: initialZoom,
|
|
||||||
center: initialCenter,
|
|
||||||
mapTypeControl: true,
|
|
||||||
fullscreenControl: true,
|
|
||||||
zoomControl: true,
|
|
||||||
streetViewControl: true,
|
|
||||||
mapId: "DEMO_MAP_ID",
|
|
||||||
});
|
|
||||||
if (onMapReady) {
|
|
||||||
onMapReady(map.current);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
init();
|
|
||||||
}, [init]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div ref={mapContainer} className={cn("w-full h-[500px]", className)} />
|
|
||||||
);
|
|
||||||
}
|
|
||||||
+10
-15
@@ -6,38 +6,33 @@ import { useLocation } from "wouter";
|
|||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
const [, setLocation] = useLocation();
|
const [, setLocation] = useLocation();
|
||||||
|
|
||||||
const handleGoHome = () => {
|
const handleGoHome = () => setLocation("/");
|
||||||
setLocation("/");
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen w-full flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100">
|
<div className="min-h-screen w-full flex items-center justify-center bg-background">
|
||||||
<Card className="w-full max-w-lg mx-4 shadow-lg border-0 bg-white/80 backdrop-blur-sm">
|
<Card className="w-full max-w-lg mx-4 shadow-lg border-none">
|
||||||
<CardContent className="pt-8 pb-8 text-center">
|
<CardContent className="pt-8 pb-8 text-center">
|
||||||
<div className="flex justify-center mb-6">
|
<div className="flex justify-center mb-6">
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<div className="absolute inset-0 bg-red-100 rounded-full animate-pulse" />
|
<div className="absolute inset-0 rounded-full animate-pulse bg-destructive/20" />
|
||||||
<AlertCircle className="relative h-16 w-16 text-red-500" />
|
<AlertCircle className="relative h-16 w-16 text-destructive" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 className="text-4xl font-bold text-slate-900 mb-2">404</h1>
|
<h1 className="text-4xl font-bold text-foreground mb-2">404</h1>
|
||||||
|
|
||||||
<h2 className="text-xl font-semibold text-slate-700 mb-4">
|
<h2 className="text-xl font-semibold text-muted-foreground mb-4">
|
||||||
Page Not Found
|
Page Not Found
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<p className="text-slate-600 mb-8 leading-relaxed">
|
<p className="text-muted-foreground mb-8 leading-relaxed">
|
||||||
Sorry, the page you are looking for doesn't exist.
|
Sorry, the page you are looking for doesn't exist.
|
||||||
<br />
|
<br />
|
||||||
It may have been moved or deleted.
|
It may have been moved or deleted.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="flex flex-col sm:flex-row gap-3 justify-center">
|
<div className="flex flex-col sm:flex-row gap-3 justify-center">
|
||||||
<Button
|
<Button variant="default" size="lg" onClick={handleGoHome}>
|
||||||
onClick={handleGoHome}
|
|
||||||
className="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2.5 rounded-lg transition-all duration-200 shadow-md hover:shadow-lg"
|
|
||||||
>
|
|
||||||
<Home className="w-4 h-4 mr-2" />
|
<Home className="w-4 h-4 mr-2" />
|
||||||
Go Home
|
Go Home
|
||||||
</Button>
|
</Button>
|
||||||
@@ -46,4 +41,4 @@ export default function NotFound() {
|
|||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user