add
This commit is contained in:
parent
a2d196b7d7
commit
f22e55a85e
|
@ -19,11 +19,11 @@ const CategorySection = () => {
|
||||||
taxonomy: {
|
taxonomy: {
|
||||||
slug: TaxonomySlug.CATEGORY,
|
slug: TaxonomySlug.CATEGORY,
|
||||||
},
|
},
|
||||||
parentId : null
|
parentId: null,
|
||||||
},
|
},
|
||||||
take: 8,
|
take: 8,
|
||||||
});
|
});
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handleMouseEnter = useCallback((index: number) => {
|
const handleMouseEnter = useCallback((index: number) => {
|
||||||
setHoveredIndex(index);
|
setHoveredIndex(index);
|
||||||
|
@ -33,13 +33,13 @@ const CategorySection = () => {
|
||||||
setHoveredIndex(null);
|
setHoveredIndex(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleMouseClick = useCallback((categoryId:string) => {
|
const handleMouseClick = useCallback((categoryId: string) => {
|
||||||
setSelectedTerms({
|
setSelectedTerms({
|
||||||
[TaxonomySlug.CATEGORY] : [categoryId]
|
[TaxonomySlug.CATEGORY]: [categoryId],
|
||||||
})
|
});
|
||||||
navigate('/courses')
|
navigate("/courses");
|
||||||
window.scrollTo({top: 0,behavior: "smooth",})
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
},[]);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<section className="py-8 relative overflow-hidden">
|
<section className="py-8 relative overflow-hidden">
|
||||||
<div className="max-w-screen-2xl mx-auto px-4 relative">
|
<div className="max-w-screen-2xl mx-auto px-4 relative">
|
||||||
|
@ -57,7 +57,7 @@ const CategorySection = () => {
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<Skeleton paragraph={{ rows: 4 }}></Skeleton>
|
<Skeleton paragraph={{ rows: 4 }}></Skeleton>
|
||||||
) : (
|
) : (
|
||||||
courseCategoriesData.map((category, index) => {
|
courseCategoriesData?.map((category, index) => {
|
||||||
const categoryColor = stringToColor(category.name);
|
const categoryColor = stringToColor(category.name);
|
||||||
const isHovered = hoveredIndex === index;
|
const isHovered = hoveredIndex === index;
|
||||||
|
|
||||||
|
|
|
@ -90,14 +90,14 @@ export function UserMenu() {
|
||||||
icon: <UserOutlined className="text-lg" />,
|
icon: <UserOutlined className="text-lg" />,
|
||||||
label: "我创建的课程",
|
label: "我创建的课程",
|
||||||
action: () => {
|
action: () => {
|
||||||
navigate("/my/duty");
|
navigate("/my-duty");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: <UserOutlined className="text-lg" />,
|
icon: <UserOutlined className="text-lg" />,
|
||||||
label: "我学习的课程",
|
label: "我学习的课程",
|
||||||
action: () => {
|
action: () => {
|
||||||
navigate("/my/learning");
|
navigate("/my-learning");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
canManageAnyStaff && {
|
canManageAnyStaff && {
|
||||||
|
|
Loading…
Reference in New Issue