feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等
This commit is contained in:
@@ -17,9 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Code2 as ActionCode2,
|
||||
ChevronDown as ActionChevronDown,
|
||||
Copy as ActionCopy,
|
||||
KeyRound as ActionKeyRound,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useContext, useMemo, useState } from 'react';
|
||||
import { Button } from '@/components/ui';
|
||||
import { ChevronDown, Code2, Copy, KeyRound } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { StatusContext } from '../../../context/Status';
|
||||
@@ -84,15 +89,15 @@ const ApiCodePanel = ({ task }) => {
|
||||
<section className='wf-api'>
|
||||
<button
|
||||
type='button'
|
||||
className='wf-api-toggle'
|
||||
className='app-action-button wf-api-toggle'
|
||||
aria-expanded={open}
|
||||
aria-controls={panelId}
|
||||
onClick={toggle}
|
||||
>
|
||||
<Code2 size={14} aria-hidden='true' />
|
||||
<ActionCode2 size={14} aria-hidden='true' />
|
||||
<span className='wf-api-title'>{t('获取 API 代码')}</span>
|
||||
<span className='wf-api-badge'>{t('API 同价')}</span>
|
||||
<ChevronDown
|
||||
<ActionChevronDown
|
||||
size={14}
|
||||
aria-hidden='true'
|
||||
className={`wf-api-caret${open ? ' is-open' : ''}`}
|
||||
@@ -125,7 +130,7 @@ const ApiCodePanel = ({ task }) => {
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<Copy size={12} aria-hidden='true' />}
|
||||
icon={<ActionCopy size={12} aria-hidden='true' />}
|
||||
onClick={async () => {
|
||||
if (await copy(code)) showSuccess(t('已复制'));
|
||||
}}
|
||||
@@ -155,7 +160,7 @@ const ApiCodePanel = ({ task }) => {
|
||||
<Button
|
||||
size='small'
|
||||
theme='solid'
|
||||
icon={<KeyRound size={12} aria-hidden='true' />}
|
||||
icon={<ActionKeyRound size={12} aria-hidden='true' />}
|
||||
onClick={() => navigate(KEY_MANAGEMENT_FROM_STUDIO)}
|
||||
>
|
||||
{t('创建密钥')}
|
||||
|
||||
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { GitCompare as ActionGitCompare } from '@/components/common/icons/ActionIcons';
|
||||
import {
|
||||
Star as ActionStar,
|
||||
Filter as ActionFilter,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, {
|
||||
useEffect,
|
||||
useMemo,
|
||||
@@ -31,7 +36,7 @@ import {
|
||||
Select,
|
||||
SideSheet,
|
||||
} from '@/components/ui';
|
||||
import { Filter, GitCompare, Search, Star } from 'lucide-react';
|
||||
import { Search } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
||||
import {
|
||||
@@ -149,7 +154,7 @@ const Controls = ({ kind, api, facets, vertical, input, setInput }) => {
|
||||
<Button
|
||||
theme={filters.favoritesOnly ? 'solid' : 'light'}
|
||||
type={filters.favoritesOnly ? 'warning' : 'tertiary'}
|
||||
icon={<Star size={14} aria-hidden='true' />}
|
||||
icon={<ActionStar size={14} aria-hidden='true' />}
|
||||
aria-pressed={filters.favoritesOnly}
|
||||
onClick={() => setFilters({ favoritesOnly: !filters.favoritesOnly })}
|
||||
>
|
||||
@@ -182,7 +187,7 @@ const FilterBar = ({ kind, api, selecting, onToggleSelecting }) => {
|
||||
<Button
|
||||
theme={selecting ? 'solid' : 'light'}
|
||||
type={selecting ? 'primary' : 'tertiary'}
|
||||
icon={<GitCompare size={14} aria-hidden='true' />}
|
||||
icon={<ActionGitCompare size={14} aria-hidden='true' />}
|
||||
aria-pressed={selecting}
|
||||
aria-label={t('多选对比')}
|
||||
title={t('多选对比')}
|
||||
@@ -240,7 +245,7 @@ const FilterBar = ({ kind, api, selecting, onToggleSelecting }) => {
|
||||
<Button
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
icon={<Filter size={16} aria-hidden='true' />}
|
||||
icon={<ActionFilter size={16} aria-hidden='true' />}
|
||||
aria-label={t('筛选')}
|
||||
aria-expanded={open}
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
|
||||
@@ -17,17 +17,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
RefreshCw as ActionRefreshCw,
|
||||
Check as ActionCheck,
|
||||
Star as ActionStar,
|
||||
MoreHorizontal as ActionMoreHorizontal,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { memo, useEffect, useRef, useState } from 'react';
|
||||
import { Button, Dropdown } from '@/components/ui';
|
||||
import {
|
||||
AlertCircle,
|
||||
Check,
|
||||
Clapperboard,
|
||||
Image as ImageIcon,
|
||||
LayoutGrid,
|
||||
MoreHorizontal,
|
||||
RefreshCw,
|
||||
Star,
|
||||
} from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { renderQuota } from '../../../helpers';
|
||||
@@ -98,7 +100,7 @@ export const ResultImage = ({ task, index, onRefresh, className, alt }) => {
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<RefreshCw size={12} aria-hidden='true' />}
|
||||
icon={<ActionRefreshCw size={12} aria-hidden='true' />}
|
||||
loading={busy}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
@@ -372,7 +374,7 @@ const WorkCard = ({
|
||||
>
|
||||
<button
|
||||
type='button'
|
||||
className='wf-media'
|
||||
className='app-action-button wf-media'
|
||||
style={{ aspectRatio: String(ratio) }}
|
||||
onClick={handleMediaClick}
|
||||
aria-label={mediaLabel}
|
||||
@@ -402,7 +404,7 @@ const WorkCard = ({
|
||||
) : null}
|
||||
{selecting && selectable ? (
|
||||
<span className='wf-check' aria-hidden='true'>
|
||||
{selected ? <Check size={14} /> : null}
|
||||
{selected ? <ActionCheck size={14} /> : null}
|
||||
</span>
|
||||
) : null}
|
||||
</button>
|
||||
@@ -422,13 +424,18 @@ const WorkCard = ({
|
||||
{!active ? (
|
||||
<button
|
||||
type='button'
|
||||
className={`wf-icon-btn${task.favorited ? ' is-on' : ''}`}
|
||||
className={[
|
||||
'app-action-button',
|
||||
`wf-icon-btn${task.favorited ? ' is-on' : ''}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')}
|
||||
aria-pressed={task.favorited}
|
||||
aria-label={task.favorited ? t('取消收藏') : t('收藏')}
|
||||
title={task.favorited ? t('取消收藏') : t('收藏')}
|
||||
onClick={() => onFavorite?.(task)}
|
||||
>
|
||||
<Star
|
||||
<ActionStar
|
||||
size={15}
|
||||
aria-hidden='true'
|
||||
fill={task.favorited ? 'currentColor' : 'none'}
|
||||
@@ -456,11 +463,11 @@ const WorkCard = ({
|
||||
>
|
||||
<button
|
||||
type='button'
|
||||
className='wf-icon-btn'
|
||||
className='app-action-button wf-icon-btn'
|
||||
aria-label={t('更多操作')}
|
||||
title={t('更多操作')}
|
||||
>
|
||||
<MoreHorizontal size={15} aria-hidden='true' />
|
||||
<ActionMoreHorizontal size={15} aria-hidden='true' />
|
||||
</button>
|
||||
</Dropdown>
|
||||
) : null}
|
||||
|
||||
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
Star as ActionStar,
|
||||
Copy as ActionCopy,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { Button, SideSheet, Spin } from '@/components/ui';
|
||||
import { Copy, Star } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { ERROR_ACTIONS } from '../../../helpers/creationError';
|
||||
@@ -292,7 +295,7 @@ const WorkDetailDrawer = ({
|
||||
{!active ? (
|
||||
<Button
|
||||
icon={
|
||||
<Star
|
||||
<ActionStar
|
||||
size={14}
|
||||
aria-hidden='true'
|
||||
fill={task.favorited ? 'currentColor' : 'none'}
|
||||
@@ -329,7 +332,7 @@ const WorkDetailDrawer = ({
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
icon={<Copy size={12} aria-hidden='true' />}
|
||||
icon={<ActionCopy size={12} aria-hidden='true' />}
|
||||
onClick={async () => {
|
||||
if (await copy(task.prompt)) showSuccess(t('已复制'));
|
||||
}}
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons';
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
@@ -31,7 +32,6 @@ import {
|
||||
Dices,
|
||||
Download,
|
||||
Film,
|
||||
ImageIcon,
|
||||
ImagePlus,
|
||||
PenLine,
|
||||
RotateCcw,
|
||||
@@ -144,7 +144,7 @@ const useNow = (enabled) => {
|
||||
const TemplateWall = ({ kind, onApply, onStart }) => {
|
||||
const { t } = useTranslation();
|
||||
const groups = useMemo(() => templateGroupsOf(kind), [kind]);
|
||||
const Icon = kind === 'video' ? Clapperboard : ImageIcon;
|
||||
const Icon = kind === 'video' ? Clapperboard : TemplateImageIcon;
|
||||
return (
|
||||
<div className='wf-wall'>
|
||||
<div className='wf-wall-head'>
|
||||
|
||||
Reference in New Issue
Block a user