Parcourir la source

✨ feat(classroom): 开放视频显示控制功能给所有角色

- 移除仅教师可见的视频显示按钮限制,所有角色均可控制视频显示
- 修改视频默认显示状态为关闭,优化初始加载体验
yourname il y a 6 mois
Parent
commit
bcb0f34d49
1 fichiers modifiés avec 13 ajouts et 13 suppressions
  1. 13 13
      src/client/mobile/components/Classroom/ClassroomLayout.tsx

+ 13 - 13
src/client/mobile/components/Classroom/ClassroomLayout.tsx

@@ -33,7 +33,7 @@ interface ClassroomLayoutProps {
 }
 
 export const ClassroomLayout = ({ children, role }: ClassroomLayoutProps) => {
-  const [showVideo, setShowVideo] = React.useState(role !== Role.Teacher);
+  const [showVideo, setShowVideo] = React.useState(false);
   const [showShareLink, setShowShareLink] = React.useState(false);
   const [isLandscape, setIsLandscape] = React.useState(false);
   const {
@@ -184,18 +184,18 @@ export const ClassroomLayout = ({ children, role }: ClassroomLayoutProps) => {
           {/* 控制面板 */}
           <div className="p-2 flex flex-col gap-3 mb-1 border-b border-gray-200">
             <div className="flex flex-wrap gap-2">
-              {role === Role.Teacher && (
-                <Button
-                  type="button"
-                  onClick={() => setShowVideo(!showVideo)}
-                  className={`p-2 rounded-full ${showVideo ? 'bg-gray-500' : 'bg-gray-300'} text-white`}
-                  title={showVideo ? '隐藏视频' : '显示视频'}
-                  size="icon"
-                  variant="ghost"
-                >
-                  <VideoCameraIcon className="w-4 h-4" />
-                </Button>
-              )}
+              {/* {role === Role.Teacher && (
+              )} */}
+              <Button
+                type="button"
+                onClick={() => setShowVideo(!showVideo)}
+                className={`p-2 rounded-full ${showVideo ? 'bg-gray-500' : 'bg-gray-300'} text-white`}
+                title={showVideo ? '隐藏视频' : '显示视频'}
+                size="icon"
+                variant="ghost"
+              >
+                <VideoCameraIcon className="w-4 h-4" />
+              </Button>
               <Button
                 type="button"
                 onClick={toggleCamera}