Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions modalscope-home/components/FilterAndSortPanel/index.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
@border-radius-base: 2px;
@color-1: #f4f7fb;
@color-2: #624afb;
@color-3: #6149fa;
@color-4: #8082a0;
@color-5: #3b29b0;
@color-6: #ca632f;
@color-7: #27254a;
@color-8: #fdfdfd;
@font-size-base: 14px;
@font-size-sm: 12px;
@margin-xs: 8px;

.wrapper {
margin-top: 10px;
padding: 2px 20px 20px;
background-color: @color-8;
}

.containerSection {
display: flex;
flex-direction: column;
}

.contentWrapper {
display: flex;
align-items: center;
justify-content: space-between;
}

.optionsContainer {
display: flex;
align-items: center;
}

.allButton {
min-width: 64px;
height: 32px;
border-width: 1px;
border-color: @color-2;
background-color: @color-1;
color: @color-3;
}

.programmaticCreation {
margin-left: 20px;
white-space: nowrap;
color: @color-4;
font-size: @font-size-base;
}

.interactiveCreation {
margin-left: 40px;
white-space: nowrap;
color: @color-4;
font-size: @font-size-base;
}

.searchInput {
width: 378px;
}

.iconZoomOut {
color: @color-3;
font-size: @font-size-sm;
}

.tagSection {
display: flex;
align-items: center;
margin-top: 18px;
gap: 34px;
}

.fieldLabel {
white-space: nowrap;
color: @color-4;
font-size: @font-size-base;
}

.multiModalTag {
margin-left: 10px;
color: @color-5;
font-size: @font-size-base;
}

.naturalLanguageProcessingButton {
max-width: 104px;
height: 24px;
margin-left: @margin-xs;
border-radius: 7px;
background-color: @color-1;
color: @color-5;
}

.autoMLTag {
margin-left: @margin-xs;
color: @color-5;
font-size: @font-size-base;
}

.careerTag {
margin-left: 14px;
color: @color-6;
font-size: @font-size-base;
}

.educationTag {
margin-left: 10px;
color: @color-6;
font-size: @font-size-base;
}

.marketingTag {
margin-left: @margin-xs;
color: @color-6;
font-size: @font-size-base;
}

.iconDropdown {
color: @color-6;
font-size: 6px;
}

.gpuDeployButton {
height: 28px;
background-color: @color-1;
}

.buttonContent {
display: flex;
align-items: center;
justify-content: center;
}

.gpuImage {
flex-shrink: 0;
width: 6px;
height: 6px;
border-radius: @border-radius-base;
}

.buttonText {
margin-left: 2px;
font-size: @font-size-base;
}

.gpuLabel {
color: @color-3;
}

.deploymentSpace {
color: @color-7;
}

.spaceImage {
flex-shrink: 0;
width: 8px;
height: 8px;
margin-left: @margin-xs;
border-radius: @border-radius-base;
}
117 changes: 117 additions & 0 deletions modalscope-home/components/FilterAndSortPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import React, { useState } from 'react';
import { Button, Input, Tag } from 'antd';
import { ZoomOutOutlined, CaretDownFilled } from '@ant-design/icons';

import styles from './index.module.less';

const FilterAndSortPanel: React.FC = () => {
const [inputPlaceholderValue, setInputPlaceholderValue] = useState('');

const onAllItemsClick = () => {};

const onNlpTitleClick = () => {};

const onGpuDeploySpaceClick = () => {};

return (
<div className={styles.wrapper}>
<div className={styles.containerSection}>
<div className={styles.contentWrapper}>
<div className={styles.optionsContainer}>
<Button onClick={onAllItemsClick} className={styles.allButton}>
全部
</Button>
<span className={styles.programmaticCreation}>编程式创建</span>
<span className={styles.interactiveCreation}>交互式创建</span>
</div>
<div className={styles.optionsContainer}>
<Input
disabled
placeholder="请输入内容(共4043个)"
prefix={<ZoomOutOutlined className={styles.iconZoomOut} />}
value={inputPlaceholderValue}
onChange={e => {
setInputPlaceholderValue(e.target.value);
}}
className={styles.searchInput}
/>
<span className={styles.programmaticCreation}>综合排序化</span>
</div>
</div>
<div className={styles.tagSection}>
<div className={styles.optionsContainer}>
<span className={styles.fieldLabel}>领域:</span>
<Tag color="rgb(244,247,251)" className={styles.multiModalTag}>
多模态
</Tag>
<Tag color="rgb(244,247,251)" className={styles.multiModalTag}>
计算机视觉
</Tag>
<Button
size="small"
onClick={onNlpTitleClick}
className={styles.naturalLanguageProcessingButton}
>
自然语言处理
</Button>
<Tag color="rgb(244,247,251)" className={styles.multiModalTag}>
语音
</Tag>
<Tag color="rgb(244,247,251)" className={styles.autoMLTag}>
AutoML
</Tag>
</div>
<div className={styles.optionsContainer}>
<span className={styles.fieldLabel}>场景:</span>
<Tag color="rgb(244,247,251)" className={styles.careerTag}>
职场
</Tag>
<Tag color="rgb(243,245,249)" className={styles.educationTag}>
教育
</Tag>
<Tag color="rgb(244,247,251)" className={styles.marketingTag}>
营销
</Tag>
<Tag color="rgb(244,247,251)" className={styles.marketingTag}>
生活
</Tag>
<Tag color="rgb(244,247,251)" className={styles.marketingTag}>
情感
</Tag>
<Tag
color="rgb(244,247,251)"
icon={<CaretDownFilled className={styles.iconDropdown} />}
className={styles.marketingTag}
>
更多
</Tag>
</div>
<Button
shape="round"
onClick={onGpuDeploySpaceClick}
className={styles.gpuDeployButton}
>
<div className={styles.buttonContent}>
<img
alt=""
src="https://weavefox.alipay.com/assets/3812eb39-b1a4-43d3-96ad-49f149cc2a7e.png"
className={styles.gpuImage}
/>
<span className={styles.buttonText}>
<span className={styles.gpuLabel}>GPU</span>
<span className={styles.deploymentSpace}>部署创空间</span>
</span>
<img
alt=""
src="https://weavefox.alipay.com/assets/a1d8573b-90da-4a6e-9e97-515caa43b167.png"
className={styles.spaceImage}
/>
</div>
</Button>
</div>
</div>
</div>
);
};

export default FilterAndSortPanel;
Loading