Ezmary commited on
Commit
fba4fcd
·
verified ·
1 Parent(s): 275fd75

Update src/App.tsx

Browse files
Files changed (1) hide show
  1. src/App.tsx +8 -25
src/App.tsx CHANGED
@@ -1,15 +1,4 @@
1
- /**
2
- Copyright 2024 Google LLC
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
 
14
  import React, { useEffect, useRef, useState } from "react";
15
  import './App.scss'; // استایل‌های اصلی
@@ -19,7 +8,7 @@ import { IOSModal } from "./components/ios-modal/IOSModal";
19
  import { isIOS } from "./lib/platform";
20
  import cn from "classnames";
21
  import { LiveConfig } from "./multimodal-live-types";
22
- import LogoAnimation from "./components/logo-animation/LogoAnimation";
23
  import BackButton from "./components/back-button/BackButton";
24
 
25
  const myCustomInstruction = `
@@ -47,12 +36,7 @@ const initialAppConfig: LiveConfig = {
47
  },
48
  };
49
 
50
- const SvgReferenceMicrophoneIcon = () => (
51
- <svg className="reference-mic-svg" viewBox="0 0 69 68" fill="none" xmlns="http://www.w3.org/2000/svg">
52
- <path opacity="0.4" d="M49.9479 27.1824C49.0803 27.1824 48.3907 27.872 48.3907 28.7396V32.2544C48.3907 40.1293 41.984 46.5361 34.109 46.5361C26.234 46.5361 19.8273 40.1293 19.8273 32.2544V28.7173C19.8273 27.8497 19.1377 27.1601 18.2701 27.1601C17.4025 27.1601 16.7129 27.8497 16.7129 28.7173V32.2321C16.7129 41.2861 23.6758 48.7384 32.5518 49.5393V54.2776C32.5518 55.1452 33.2414 55.8348 34.109 55.8348C34.9766 55.8348 35.6662 55.1452 35.6662 54.2776V49.5393C44.52 48.7607 51.5051 41.2861 51.5051 32.2321V28.7173C51.4829 27.872 50.7933 27.1824 49.9479 27.1824Z" fill="#BE123C"/>
53
- <path d="M34.1099 11.3434C28.682 11.3434 24.2773 15.7481 24.2773 21.176V32.5658C24.2773 37.9938 28.682 42.3984 34.1099 42.3984C39.5379 42.3984 43.9425 37.9938 43.9425 32.5658V21.176C43.9425 15.7481 39.5379 11.3434 34.1099 11.3434ZM37.0241 26.8042C36.8684 27.3826 36.3567 27.7608 35.7784 27.7608C35.6671 27.7608 35.5559 27.7385 35.4447 27.7163C34.5771 27.4716 33.665 27.4716 32.7974 27.7163C32.0856 27.9165 31.396 27.4938 31.218 26.8042C31.0178 26.1146 31.4404 25.4027 32.1301 25.2247C33.4426 24.8688 34.8218 24.8688 36.1343 25.2247C36.8017 25.4027 37.2021 26.1146 37.0241 26.8042ZM38.2031 22.4885C38.0029 23.0224 37.5135 23.3339 36.9796 23.3339C36.8239 23.3339 36.6904 23.3116 36.5347 23.2671C34.9775 22.6887 33.2423 22.6887 31.6852 23.2671C31.0178 23.5118 30.2614 23.1559 30.0167 22.4885C29.772 21.8212 30.128 21.0648 30.7953 20.8423C32.9309 20.0637 35.289 20.0637 37.4245 20.8423C38.0919 21.087 38.4478 21.8212 38.2031 22.4885Z" fill="#BE123C"/>
54
- </svg>
55
- );
56
 
57
  interface AppInternalLogicProps {
58
  isMicActive: boolean;
@@ -126,7 +110,6 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
126
  </div>
127
  </div>
128
 
129
- {/* The .media-area should ideally take up the desired space for the video */}
130
  <div className="media-area w-full flex flex-col items-center justify-center flex-grow relative">
131
  <video
132
  id="video-feed"
@@ -134,7 +117,7 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
134
  autoPlay
135
  playsInline
136
  className={cn(
137
- "absolute top-0 left-0 w-full h-full object-cover", // <<-- بازگشت به object-cover
138
  { "hidden": !isCamActive },
139
  { "scale-x-[-1]": currentFacingMode === 'user' }
140
  )}
@@ -144,7 +127,8 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
144
  id="large-logo-container"
145
  className="absolute top-0 left-0 w-full h-full flex items-center justify-center pointer-events-none"
146
  >
147
- <LogoAnimation isMini={false} isActive={true} type="human" />
 
148
  </div>
149
  )}
150
  </div>
@@ -153,15 +137,15 @@ const AppInternalLogic: React.FC<AppInternalLogicProps> = ({
153
  videoRef={videoRef}
154
  supportsVideo={true}
155
  onVideoStreamChange={(stream) => {
156
- // Placeholder, actual logic might be in ControlTray
157
  }}
158
  isAppMicActive={isMicActive}
159
  onAppMicToggle={setIsMicActive}
160
  isAppCamActive={isCamActive}
161
  onAppCamToggle={setIsCamActive}
162
- ReferenceMicrophoneIcon={SvgReferenceMicrophoneIcon}
163
  currentFacingMode={currentFacingMode}
164
  onFacingModeChange={onFacingModeChange}
 
165
  />
166
  </div>
167
  </div>
@@ -181,7 +165,6 @@ function App() {
181
  const notificationButtonRef = useRef<HTMLButtonElement>(null);
182
  const notificationPopoverRef = useRef<HTMLDivElement>(null);
183
 
184
-
185
  useEffect(() => {
186
  if (isIOS()) {
187
  setShowIOSModal(true);
 
1
+ // src/App.tsx
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  import React, { useEffect, useRef, useState } from "react";
4
  import './App.scss'; // استایل‌های اصلی
 
8
  import { isIOS } from "./lib/platform";
9
  import cn from "classnames";
10
  import { LiveConfig } from "./multimodal-live-types";
11
+ import Logo from "./components/logo/Logo"; // <-- کامپوننت جدید Logo ایمپورت شد
12
  import BackButton from "./components/back-button/BackButton";
13
 
14
  const myCustomInstruction = `
 
36
  },
37
  };
38
 
39
+ // آیکون میکروفون از اینجا حذف شد چون به فایل icons.tsx منتقل شده است
 
 
 
 
 
40
 
41
  interface AppInternalLogicProps {
42
  isMicActive: boolean;
 
110
  </div>
111
  </div>
112
 
 
113
  <div className="media-area w-full flex flex-col items-center justify-center flex-grow relative">
114
  <video
115
  id="video-feed"
 
117
  autoPlay
118
  playsInline
119
  className={cn(
120
+ "absolute top-0 left-0 w-full h-full object-cover",
121
  { "hidden": !isCamActive },
122
  { "scale-x-[-1]": currentFacingMode === 'user' }
123
  )}
 
127
  id="large-logo-container"
128
  className="absolute top-0 left-0 w-full h-full flex items-center justify-center pointer-events-none"
129
  >
130
+ {/* کامپوننت Logo جدید جایگزین LogoAnimation شد */}
131
+ <Logo isMini={false} isActive={true} isAi={false} />
132
  </div>
133
  )}
134
  </div>
 
137
  videoRef={videoRef}
138
  supportsVideo={true}
139
  onVideoStreamChange={(stream) => {
140
+ // Placeholder
141
  }}
142
  isAppMicActive={isMicActive}
143
  onAppMicToggle={setIsMicActive}
144
  isAppCamActive={isCamActive}
145
  onAppCamToggle={setIsCamActive}
 
146
  currentFacingMode={currentFacingMode}
147
  onFacingModeChange={onFacingModeChange}
148
+ // پراپ ReferenceMicrophoneIcon حذف شد چون دیگر لازم نیست
149
  />
150
  </div>
151
  </div>
 
165
  const notificationButtonRef = useRef<HTMLButtonElement>(null);
166
  const notificationPopoverRef = useRef<HTMLDivElement>(null);
167
 
 
168
  useEffect(() => {
169
  if (isIOS()) {
170
  setShowIOSModal(true);