Li_0225
This commit is contained in:
parent
287bf31d0e
commit
ead1d926c6
|
@ -2,8 +2,6 @@ import React, { useState, useCallback, useEffect, useMemo } from "react";
|
||||||
import { Typography, Button, Spin, Skeleton } from "antd";
|
import { Typography, Button, Spin, Skeleton } from "antd";
|
||||||
import { stringToColor, TaxonomySlug, TermDto } from "@nice/common";
|
import { stringToColor, TaxonomySlug, TermDto } from "@nice/common";
|
||||||
import { api } from "@nice/client";
|
import { api } from "@nice/client";
|
||||||
import { ControlOutlined } from "@ant-design/icons";
|
|
||||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
|
||||||
import LookForMore from "./LookForMore";
|
import LookForMore from "./LookForMore";
|
||||||
import CategorySectionCard from "./CategorySectionCard";
|
import CategorySectionCard from "./CategorySectionCard";
|
||||||
|
|
||||||
|
@ -50,8 +48,6 @@ const CategorySection = () => {
|
||||||
setHoveredIndex(null);
|
setHoveredIndex(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="py-32 relative overflow-hidden">
|
<section className="py-32 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">
|
||||||
|
@ -67,7 +63,7 @@ const CategorySection = () => {
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<Skeleton></Skeleton>
|
<Skeleton paragraph={{rows:4}}></Skeleton>
|
||||||
) : (
|
) : (
|
||||||
displayedCategories.map((category, index) => {
|
displayedCategories.map((category, index) => {
|
||||||
const categoryColor = stringToColor(category.name);
|
const categoryColor = stringToColor(category.name);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import React, { useState, useMemo } from "react";
|
import React, { useState, useMemo } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { Typography, Skeleton } from "antd";
|
||||||
import { Button, Typography, Skeleton } from "antd";
|
|
||||||
import { ArrowRightOutlined } from "@ant-design/icons";
|
|
||||||
import { TaxonomySlug, TermDto } from "@nice/common";
|
import { TaxonomySlug, TermDto } from "@nice/common";
|
||||||
import { api } from "@nice/client";
|
import { api } from "@nice/client";
|
||||||
import { CoursesSectionTag } from "./CoursesSectionTag";
|
import { CoursesSectionTag } from "./CoursesSectionTag";
|
||||||
|
@ -40,7 +38,6 @@ const CoursesSection: React.FC<CoursesSectionProps> = ({
|
||||||
description,
|
description,
|
||||||
initialVisibleCoursesCount = 8,
|
initialVisibleCoursesCount = 8,
|
||||||
}) => {
|
}) => {
|
||||||
const navigate = useNavigate();
|
|
||||||
const [selectedCategory, setSelectedCategory] = useState<string>("全部");
|
const [selectedCategory, setSelectedCategory] = useState<string>("全部");
|
||||||
const gateGory: GetTaxonomyProps = useGetTaxonomy({
|
const gateGory: GetTaxonomyProps = useGetTaxonomy({
|
||||||
type: TaxonomySlug.CATEGORY,
|
type: TaxonomySlug.CATEGORY,
|
||||||
|
|
Loading…
Reference in New Issue