This commit is contained in:
ditiqi 2025-02-26 23:55:44 +08:00
parent a2d196b7d7
commit f22e55a85e
2 changed files with 11 additions and 11 deletions

View File

@ -19,11 +19,11 @@ const CategorySection = () => {
taxonomy: {
slug: TaxonomySlug.CATEGORY,
},
parentId : null
parentId: null,
},
take: 8,
});
const navigate = useNavigate()
const navigate = useNavigate();
const handleMouseEnter = useCallback((index: number) => {
setHoveredIndex(index);
@ -33,13 +33,13 @@ const CategorySection = () => {
setHoveredIndex(null);
}, []);
const handleMouseClick = useCallback((categoryId:string) => {
const handleMouseClick = useCallback((categoryId: string) => {
setSelectedTerms({
[TaxonomySlug.CATEGORY] : [categoryId]
})
navigate('/courses')
window.scrollTo({top: 0,behavior: "smooth",})
},[]);
[TaxonomySlug.CATEGORY]: [categoryId],
});
navigate("/courses");
window.scrollTo({ top: 0, behavior: "smooth" });
}, []);
return (
<section className="py-8 relative overflow-hidden">
<div className="max-w-screen-2xl mx-auto px-4 relative">
@ -57,7 +57,7 @@ const CategorySection = () => {
{isLoading ? (
<Skeleton paragraph={{ rows: 4 }}></Skeleton>
) : (
courseCategoriesData.map((category, index) => {
courseCategoriesData?.map((category, index) => {
const categoryColor = stringToColor(category.name);
const isHovered = hoveredIndex === index;

View File

@ -90,14 +90,14 @@ export function UserMenu() {
icon: <UserOutlined className="text-lg" />,
label: "我创建的课程",
action: () => {
navigate("/my/duty");
navigate("/my-duty");
},
},
{
icon: <UserOutlined className="text-lg" />,
label: "我学习的课程",
action: () => {
navigate("/my/learning");
navigate("/my-learning");
},
},
canManageAnyStaff && {