Ezmary commited on
Commit
27a5a57
·
verified ·
1 Parent(s): 25f8d86

Update src/App.tsx

Browse files
Files changed (1) hide show
  1. src/App.tsx +5 -10
src/App.tsx CHANGED
@@ -1,7 +1,7 @@
1
  // src/App.tsx
2
 
3
  import React, { useEffect, useRef, useState } from "react";
4
- import './App.scss'; // استایل‌های اصلی
5
  import { LiveAPIProvider, useLiveAPIContext } from "./contexts/LiveAPIContext";
6
  import ControlTray from "./components/control-tray/ControlTray";
7
  import { IOSModal } from "./components/ios-modal/IOSModal";
@@ -62,7 +62,7 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
62
  currentFacingMode,
63
  onFacingModeChange,
64
  }) => {
65
- const { connected, disconnect, volume } = useLiveAPIContext(); // <-- دریافت volume
66
 
67
  useEffect(() => {
68
  if (!isMicActive && !isCamActive && connected) {
@@ -74,7 +74,7 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
74
  <div className="w-full flex flex-col items-center justify-center min-h-screen text-foreground antialiased">
75
  <div className="main-wrapper max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
76
  <div className="header-controls">
77
- <div />
78
  <div id="notification-trigger-container">
79
  <button
80
  ref={notificationButtonRef}
@@ -122,11 +122,10 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
122
  id="large-logo-container"
123
  className="absolute top-0 left-0 w-full h-full flex items-center justify-center pointer-events-none"
124
  >
125
- {/* --- 👇 تغییر در اینجا: پاس دادن volume و تنظیم isAi 👇 --- */}
126
  <Logo
127
  isMini={false}
128
  isActive={true}
129
- isAi={true}
130
  speakingVolume={volume}
131
  />
132
  </div>
@@ -136,9 +135,7 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
136
  <ControlTray
137
  videoRef={videoRef}
138
  supportsVideo={true}
139
- onVideoStreamChange={(stream) => {
140
- // Placeholder
141
- }}
142
  isAppMicActive={isMicActive}
143
  onAppMicToggle={setIsMicActive}
144
  isAppCamActive={isCamActive}
@@ -155,12 +152,10 @@ function App() {
155
  const videoRef = useRef<HTMLVideoElement>(null);
156
  const [showIOSModal, setShowIOSModal] = useState(false);
157
  const [isAllowedOrigin, setIsAllowedOrigin] = useState<boolean | null>(null);
158
-
159
  const [isMicActive, setIsMicActive] = useState(false);
160
  const [isCamActive, setIsCamActive] = useState(false);
161
  const [isNotificationOpen, setIsNotificationOpen] = useState(false);
162
  const [currentFacingMode, setCurrentFacingMode] = useState<'user' | 'environment'>('user');
163
-
164
  const notificationButtonRef = useRef<HTMLButtonElement>(null);
165
  const notificationPopoverRef = useRef<HTMLDivElement>(null);
166
 
 
1
  // src/App.tsx
2
 
3
  import React, { useEffect, useRef, useState } from "react";
4
+ import './App.scss';
5
  import { LiveAPIProvider, useLiveAPIContext } from "./contexts/LiveAPIContext";
6
  import ControlTray from "./components/control-tray/ControlTray";
7
  import { IOSModal } from "./components/ios-modal/IOSModal";
 
62
  currentFacingMode,
63
  onFacingModeChange,
64
  }) => {
65
+ const { connected, disconnect, volume } = useLiveAPIContext();
66
 
67
  useEffect(() => {
68
  if (!isMicActive && !isCamActive && connected) {
 
74
  <div className="w-full flex flex-col items-center justify-center min-h-screen text-foreground antialiased">
75
  <div className="main-wrapper max-w-3xl w-full flex flex-col items-center justify-center h-full relative">
76
  <div className="header-controls">
77
+ <div />
78
  <div id="notification-trigger-container">
79
  <button
80
  ref={notificationButtonRef}
 
122
  id="large-logo-container"
123
  className="absolute top-0 left-0 w-full h-full flex items-center justify-center pointer-events-none"
124
  >
 
125
  <Logo
126
  isMini={false}
127
  isActive={true}
128
+ isAi={false}
129
  speakingVolume={volume}
130
  />
131
  </div>
 
135
  <ControlTray
136
  videoRef={videoRef}
137
  supportsVideo={true}
138
+ onVideoStreamChange={(stream) => {}}
 
 
139
  isAppMicActive={isMicActive}
140
  onAppMicToggle={setIsMicActive}
141
  isAppCamActive={isCamActive}
 
152
  const videoRef = useRef<HTMLVideoElement>(null);
153
  const [showIOSModal, setShowIOSModal] = useState(false);
154
  const [isAllowedOrigin, setIsAllowedOrigin] = useState<boolean | null>(null);
 
155
  const [isMicActive, setIsMicActive] = useState(false);
156
  const [isCamActive, setIsCamActive] = useState(false);
157
  const [isNotificationOpen, setIsNotificationOpen] = useState(false);
158
  const [currentFacingMode, setCurrentFacingMode] = useState<'user' | 'environment'>('user');
 
159
  const notificationButtonRef = useRef<HTMLButtonElement>(null);
160
  const notificationPopoverRef = useRef<HTMLDivElement>(null);
161