Răsfoiți Sursa

add document.title

visuddhinanda 2 ani în urmă
părinte
comite
8f21706ba1

+ 1 - 0
dashboard/src/pages/studio/channel/show.tsx

@@ -26,6 +26,7 @@ const Widget = () => {
   useEffect(() => {
   useEffect(() => {
     get<IApiResponseChannel>(`/v2/channel/${channelId}`).then((json) => {
     get<IApiResponseChannel>(`/v2/channel/${channelId}`).then((json) => {
       setTitle(json.data.name);
       setTitle(json.data.name);
+      document.title = `${json.data.name}`;
     });
     });
   }, [channelId]);
   }, [channelId]);
   return (
   return (

+ 1 - 0
dashboard/src/pages/studio/course/edit.tsx

@@ -31,6 +31,7 @@ const Widget = () => {
                   courseId={courseId}
                   courseId={courseId}
                   onTitleChange={(title: string) => {
                   onTitleChange={(title: string) => {
                     setTitle(title);
                     setTitle(title);
+                    document.title = `${title}`;
                   }}
                   }}
                 />
                 />
               ),
               ),

+ 1 - 1
dashboard/src/pages/studio/group/edit.tsx

@@ -41,7 +41,7 @@ const Widget = () => {
         request={async () => {
         request={async () => {
           const res = await get<IGroupResponse>(`/v2/group/${groupId}`);
           const res = await get<IGroupResponse>(`/v2/group/${groupId}`);
           setTitle(res.data.name);
           setTitle(res.data.name);
-          console.log(res.data);
+          document.title = `${res.data.name}`;
           return {
           return {
             id: res.data.uid,
             id: res.data.uid,
             name: res.data.name,
             name: res.data.name,

+ 1 - 0
dashboard/src/pages/studio/group/show.tsx

@@ -17,6 +17,7 @@ const Widget = () => {
   useEffect(() => {
   useEffect(() => {
     get<IGroupResponse>(`/v2/group/${groupId}`).then((json) => {
     get<IGroupResponse>(`/v2/group/${groupId}`).then((json) => {
       setTitle(json.data.name);
       setTitle(json.data.name);
+      document.title = `${json.data.name}`;
     });
     });
   }, [groupId]);
   }, [groupId]);
   return (
   return (