diff --git a/apps/web/src/app/main/layout/MainHeader.tsx b/apps/web/src/app/main/layout/MainHeader.tsx index d6d288f..22e6bcd 100755 --- a/apps/web/src/app/main/layout/MainHeader.tsx +++ b/apps/web/src/app/main/layout/MainHeader.tsx @@ -10,7 +10,6 @@ import { useNavigate, useParams, useSearchParams } from "react-router-dom"; import { UserMenu } from "./UserMenu/UserMenu"; import { NavigationMenu } from "./NavigationMenu"; import { useMainContext } from "./MainProvider"; -import { Header } from "antd/es/layout/layout"; export function MainHeader() { const { isAuthenticated, user } = useAuth(); @@ -19,77 +18,79 @@ export function MainHeader() { const { searchValue, setSearchValue } = useMainContext(); return ( -
-
-
-
navigate("/")} - className="text-2xl font-bold bg-gradient-to-r from-primary-600 via-primary-500 to-primary-400 bg-clip-text text-transparent hover:scale-105 transition-transform cursor-pointer"> - 烽火慕课 -
+
+
+
navigate("/")} + className="text-2xl font-bold bg-gradient-to-r from-primary-600 via-primary-500 to-primary-400 bg-clip-text text-transparent hover:scale-105 transition-transform cursor-pointer"> + 烽火慕课 +
+
+
-
- + + } + placeholder="搜索课程" + className="w-96 rounded-full" + value={searchValue} + onChange={(e) => setSearchValue(e.target.value)} + onPressEnter={(e) => { + if ( + !window.location.pathname.startsWith("/courses/") && + !window.location.pathname.startsWith("my") + ) { + navigate(`/courses/`); + window.scrollTo({ + top: 0, + behavior: "smooth", + }); } - placeholder="搜索课程" - className="w-96 rounded-full" - value={searchValue} - onChange={(e) => setSearchValue(e.target.value)} - onPressEnter={(e) => { - if ( - !window.location.pathname.startsWith("/courses/") && - !window.location.pathname.startsWith("my") - ) { - navigate(`/courses/`); - window.scrollTo({ - top: 0, - behavior: "smooth", - }); - } - }} - /> -
- {isAuthenticated && ( - <> - - - )} - {isAuthenticated && ( + }} + /> +
+ {isAuthenticated && ( + <> - )} - {isAuthenticated ? ( - - ) : ( - - )} -
+ + )} + {isAuthenticated && ( + + )} + {isAuthenticated ? ( + + ) : ( + + )}
+ ); } diff --git a/apps/web/src/index.css b/apps/web/src/index.css index f65bd8b..34de7f4 100755 --- a/apps/web/src/index.css +++ b/apps/web/src/index.css @@ -161,7 +161,3 @@ /* 去除最后一行的底部边框 */ } -.mind-editor { - height: calc(100vh - 285px); - width: 100%; -} \ No newline at end of file