add
This commit is contained in:
parent
ed5949a06d
commit
73757c0ee9
|
@ -39,14 +39,19 @@ export function MainHeader() {
|
|||
placeholder="搜索课程"
|
||||
className="w-96 rounded-full"
|
||||
value={searchValue}
|
||||
onClick={(e) => {
|
||||
if (!window.location.pathname.startsWith("/search")) {
|
||||
navigate(`/search`);
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}
|
||||
}}
|
||||
onChange={(e) => setSearchValue(e.target.value)}
|
||||
onPressEnter={(e) => {
|
||||
if (
|
||||
!window.location.pathname.startsWith("/courses/") &&
|
||||
!window.location.pathname.startsWith("/my") &&
|
||||
!window.location.pathname.startsWith("/path")
|
||||
) {
|
||||
navigate(`/courses/`);
|
||||
if (!window.location.pathname.startsWith("/search")) {
|
||||
navigate(`/search`);
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
|
|
Loading…
Reference in New Issue