Spaces:
Running
Running
Update src/App.tsx
Browse files- src/App.tsx +7 -21
src/App.tsx
CHANGED
@@ -17,7 +17,7 @@ import { LiveAPIProvider, useLiveAPIContext } from "./contexts/LiveAPIContext";
|
|
17 |
// SidePanel and Altair are part of the original Gemini UI.
|
18 |
// You need to decide if/how they fit into the new UI.
|
19 |
// For now, we'll include them but they might need styling or to be conditionally rendered.
|
20 |
-
import SidePanel from "./components/side-panel/SidePanel";
|
21 |
import { Altair } from "./components/altair/Altair";
|
22 |
import ControlTray from "./components/control-tray/ControlTray"; // This will be our new footer
|
23 |
import { IOSModal } from "./components/ios-modal/IOSModal";
|
@@ -154,7 +154,7 @@ function AppContent() {
|
|
154 |
const [videoStream, setVideoStream] = useState<MediaStream | null>(null);
|
155 |
const [showIOSModal, setShowIOSModal] = useState(false);
|
156 |
const [isAllowedOrigin, setIsAllowedOrigin] = useState<boolean | null>(null);
|
157 |
-
const [isNotificationOpen, setIsNotificationOpen] useState(false);
|
158 |
const notificationPopoverRef = useRef<HTMLDivElement>(null);
|
159 |
const notificationButtonRef = useRef<HTMLButtonElement>(null);
|
160 |
|
@@ -225,19 +225,11 @@ function AppContent() {
|
|
225 |
}
|
226 |
}, []);
|
227 |
|
228 |
-
// Update CSS --volume variable for mic pulse animation
|
229 |
useEffect(() => {
|
230 |
-
//
|
231 |
-
//
|
232 |
-
//
|
233 |
-
//
|
234 |
-
// If we want the pulse on the App's mic button, we need the input volume here.
|
235 |
-
// The original ControlTray uses 'inVolume' from AudioRecorder.
|
236 |
-
// Let's pass the 'volume' (output volume) from context to ControlTray for now.
|
237 |
-
// Or better, ControlTray should get inVolume itself if it renders the mic button.
|
238 |
-
// Let's assume `volume` from `useLiveAPIContext` is for the *output* visualization.
|
239 |
-
// The mic button pulse in new design is different (CSS based on active state and --volume from recorder)
|
240 |
-
// `ControlTray` will manage its own input volume for the pulse.
|
241 |
}, [volume]);
|
242 |
|
243 |
|
@@ -249,15 +241,9 @@ function AppContent() {
|
|
249 |
return <div style={{ padding: '20px', textAlign: 'center', color: 'red' }}>دسترسی غیرمجاز! اگر چت صوتی و تصویری برای شما باز نمیشود این لینک رو با مرورگر کروم باز کنید و همچنین مرورگر کروم رو به عنوان مرورگر پیشفرض گوشی خود قرار دهید تا هر بار زدن روی دکمه شروع داخل برنامه لینک با مرورگر کروم باز بشه، برای پیشفرض قرار دادن مرورگر کروم وارد تنظیمات گوشی خود شوید قسمت برنامه ها ، مدیریت برنامه ها رو کلیک کنید بالای صفحه روی سه نقطه بزنید و تنظیمات بیشتر رو انتخاب کنید بعدا وارد قسمت برنامه های پیش فرض شوید و مرورگر کروم رو به عنوان مرورگر پیشفرض خود قرار دهید، اگر مشکلی بود حتماً به پشتیبانی برنامه پیام بفرستید</div>;
|
250 |
}
|
251 |
|
252 |
-
// If you keep SidePanel and Altair, they need to be integrated into the new layout.
|
253 |
-
// For this example, I'm wrapping the new UI structure.
|
254 |
-
// The original structure was <SidePanel /> <main> <Altair /> <video /> <ControlTray /> </main>
|
255 |
-
// This might need careful restyling if SidePanel and Altair are to be used with the new fullscreen-like UI.
|
256 |
-
// For simplicity, I'll focus on the new UI elements and keep Altair for chat display.
|
257 |
-
|
258 |
return (
|
259 |
<div className="App"> {/* Main container from original Gemini App */}
|
260 |
-
{/* <SidePanel /> //
|
261 |
<main> {/* Original main, Altair will go here */}
|
262 |
<div className="main-app-area"> {/* For Altair and video */}
|
263 |
{/* Altair is the chat bubbles. Position it as needed. */}
|
|
|
17 |
// SidePanel and Altair are part of the original Gemini UI.
|
18 |
// You need to decide if/how they fit into the new UI.
|
19 |
// For now, we'll include them but they might need styling or to be conditionally rendered.
|
20 |
+
// import SidePanel from "./components/side-panel/SidePanel"; // اگر استفاده نمیکنید کامنت کنید
|
21 |
import { Altair } from "./components/altair/Altair";
|
22 |
import ControlTray from "./components/control-tray/ControlTray"; // This will be our new footer
|
23 |
import { IOSModal } from "./components/ios-modal/IOSModal";
|
|
|
154 |
const [videoStream, setVideoStream] = useState<MediaStream | null>(null);
|
155 |
const [showIOSModal, setShowIOSModal] = useState(false);
|
156 |
const [isAllowedOrigin, setIsAllowedOrigin] = useState<boolean | null>(null);
|
157 |
+
const [isNotificationOpen, setIsNotificationOpen] = useState(false); // <--- اصلاح در این خط
|
158 |
const notificationPopoverRef = useRef<HTMLDivElement>(null);
|
159 |
const notificationButtonRef = useRef<HTMLButtonElement>(null);
|
160 |
|
|
|
225 |
}
|
226 |
}, []);
|
227 |
|
|
|
228 |
useEffect(() => {
|
229 |
+
// This useEffect was intended for CSS --volume for mic pulse,
|
230 |
+
// but ControlTray.tsx now handles its own inVolume for that.
|
231 |
+
// This 'volume' from useLiveAPIContext is usually output volume.
|
232 |
+
// If you need to visualize output volume elsewhere, you can use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}, [volume]);
|
234 |
|
235 |
|
|
|
241 |
return <div style={{ padding: '20px', textAlign: 'center', color: 'red' }}>دسترسی غیرمجاز! اگر چت صوتی و تصویری برای شما باز نمیشود این لینک رو با مرورگر کروم باز کنید و همچنین مرورگر کروم رو به عنوان مرورگر پیشفرض گوشی خود قرار دهید تا هر بار زدن روی دکمه شروع داخل برنامه لینک با مرورگر کروم باز بشه، برای پیشفرض قرار دادن مرورگر کروم وارد تنظیمات گوشی خود شوید قسمت برنامه ها ، مدیریت برنامه ها رو کلیک کنید بالای صفحه روی سه نقطه بزنید و تنظیمات بیشتر رو انتخاب کنید بعدا وارد قسمت برنامه های پیش فرض شوید و مرورگر کروم رو به عنوان مرورگر پیشفرض خود قرار دهید، اگر مشکلی بود حتماً به پشتیبانی برنامه پیام بفرستید</div>;
|
242 |
}
|
243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
return (
|
245 |
<div className="App"> {/* Main container from original Gemini App */}
|
246 |
+
{/* <SidePanel /> // اگر استفاده نمیکنید کامنت کنید یا حذف کنید */}
|
247 |
<main> {/* Original main, Altair will go here */}
|
248 |
<div className="main-app-area"> {/* For Altair and video */}
|
249 |
{/* Altair is the chat bubbles. Position it as needed. */}
|