Merge branch 'main' of http://113.45.157.195:3003/insiinc/re-mooc
This commit is contained in:
commit
1a0d001d91
|
@ -0,0 +1,7 @@
|
||||||
|
export function coursePreviewAllmsg() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen">
|
||||||
|
helloword
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
export function CoursePreview(){
|
||||||
|
return(
|
||||||
|
<div className="min-h-screen">
|
||||||
|
helloword
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
import { Checkbox, Divider, Radio, Space } from "antd";
|
import { Checkbox, Divider, Radio, Space , Spin} from 'antd';
|
||||||
import { categories, levels } from "../mockData";
|
import { categories, levels } from '../mockData';
|
||||||
import { api } from "@nice/client";
|
import { TaxonomySlug, TermDto } from '@nice/common';
|
||||||
import { TaxonomySlug } from "@nice/common";
|
import { GetTaxonomyProps, useGetTaxonomy } from '@web/src/hooks/useGetTaxonomy';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
interface FilterSectionProps {
|
interface FilterSectionProps {
|
||||||
selectedCategory: string;
|
selectedCategory: string;
|
||||||
|
@ -16,14 +17,12 @@ export default function FilterSection({
|
||||||
onCategoryChange,
|
onCategoryChange,
|
||||||
onLevelChange,
|
onLevelChange,
|
||||||
}: FilterSectionProps) {
|
}: FilterSectionProps) {
|
||||||
const { data: levels, isLoading } = api.term.findMany.useQuery({
|
const gateGory : GetTaxonomyProps = useGetTaxonomy({
|
||||||
where: {
|
type: TaxonomySlug.CATEGORY,
|
||||||
taxonomy: {
|
})
|
||||||
slug: TaxonomySlug.LEVEL,
|
const levels : GetTaxonomyProps = useGetTaxonomy({
|
||||||
},
|
type: TaxonomySlug.LEVEL,
|
||||||
},
|
})
|
||||||
});
|
|
||||||
// const { data } = api.term;
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white p-6 rounded-lg shadow-sm space-y-6">
|
<div className="bg-white p-6 rounded-lg shadow-sm space-y-6">
|
||||||
<div>
|
<div>
|
||||||
|
@ -31,13 +30,23 @@ export default function FilterSection({
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
value={selectedCategory}
|
value={selectedCategory}
|
||||||
onChange={(e) => onCategoryChange(e.target.value)}
|
onChange={(e) => onCategoryChange(e.target.value)}
|
||||||
className="flex flex-col space-y-3">
|
className="flex flex-col space-y-3"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
gateGory.isLoading?
|
||||||
|
(<Spin/>)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<>
|
||||||
<Radio value="">全部课程</Radio>
|
<Radio value="">全部课程</Radio>
|
||||||
{categories.map((category) => (
|
{gateGory.categories.map(category => (
|
||||||
<Radio key={category} value={category}>
|
<Radio key={category} value={category}>
|
||||||
{category}
|
{category}
|
||||||
</Radio>
|
</Radio>
|
||||||
))}
|
))}
|
||||||
|
</>)
|
||||||
|
}
|
||||||
|
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -48,13 +57,23 @@ export default function FilterSection({
|
||||||
<Radio.Group
|
<Radio.Group
|
||||||
value={selectedLevel}
|
value={selectedLevel}
|
||||||
onChange={(e) => onLevelChange(e.target.value)}
|
onChange={(e) => onLevelChange(e.target.value)}
|
||||||
className="flex flex-col space-y-3">
|
className="flex flex-col space-y-3"
|
||||||
|
>
|
||||||
|
{
|
||||||
|
levels.isLoading ?
|
||||||
|
(<Spin/>)
|
||||||
|
:
|
||||||
|
(
|
||||||
|
<>
|
||||||
<Radio value="">全部难度</Radio>
|
<Radio value="">全部难度</Radio>
|
||||||
{levels?.map((level) => (
|
{levels.categories.map(level => (
|
||||||
<Radio key={level.id} value={level.id}>
|
<Radio key={level} value={level}>
|
||||||
{level.name}
|
{level}
|
||||||
</Radio>
|
</Radio>
|
||||||
))}
|
))}
|
||||||
|
</>)
|
||||||
|
}
|
||||||
|
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue