diff --git a/web/src/App.js b/web/src/App.js index 41ab040e..bab3707c 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -12,7 +12,6 @@ import PasswordResetForm from './components/auth/PasswordResetForm.js'; import PasswordResetConfirm from './components/auth/PasswordResetConfirm.js'; import Channel from './pages/Channel'; import Token from './pages/Token'; -import EditChannel from './pages/Channel/EditChannel'; import Redemption from './pages/Redemption'; import TopUp from './pages/TopUp'; import Log from './pages/Log'; @@ -61,22 +60,6 @@ function App() { } /> - } key={location.pathname}> - - - } - /> - } key={location.pathname}> - - - } - /> { const channelsData = useChannelsData(); @@ -24,7 +24,7 @@ const ChannelsPage = () => { handleClose={() => channelsData.setShowEditTag(false)} refresh={channelsData.refresh} /> - { +const EditChannelModal = (props) => { const { t } = useTranslation(); - const navigate = useNavigate(); const channelId = props.editingChannel.id; const isEdit = channelId !== undefined; const [loading, setLoading] = useState(isEdit); @@ -193,7 +191,7 @@ const EditChannel = (props) => { setInputs((inputs) => ({ ...inputs, models: localModels })); } setBasicModels(localModels); - + // 重置手动输入模式状态 setUseManualInput(false); } @@ -726,9 +724,9 @@ const EditChannel = (props) => { onClick, ...rest } = renderProps; - + const searchWords = channelSearchValue ? [channelSearchValue] : []; - + // 构建样式类名 const optionClassName = [ 'flex items-center gap-3 px-3 py-2 transition-all duration-200 rounded-lg mx-2 my-1', @@ -738,12 +736,12 @@ const EditChannel = (props) => { !disabled && 'hover:bg-gray-50 hover:shadow-md cursor-pointer', className ].filter(Boolean).join(' '); - + return ( -
!disabled && onClick()} + onClick={() => !disabled && onClick()} onMouseEnter={e => onMouseEnter()} >
@@ -751,8 +749,8 @@ const EditChannel = (props) => { {getChannelIcon(value)}
- @@ -760,7 +758,7 @@ const EditChannel = (props) => { {selected && (
- +
)} @@ -926,7 +924,7 @@ const EditChannel = (props) => {
)} - + {batch && ( { className='!rounded-lg mb-3' /> )} - + {useManualInput && !batch ? ( { ); }; -export default EditChannel; +export default EditChannelModal; \ No newline at end of file diff --git a/web/src/pages/Channel/EditTagModal.js b/web/src/components/table/channels/modals/EditTagModal.jsx similarity index 99% rename from web/src/pages/Channel/EditTagModal.js rename to web/src/components/table/channels/modals/EditTagModal.jsx index 433d4f09..9ebc8bd6 100644 --- a/web/src/pages/Channel/EditTagModal.js +++ b/web/src/components/table/channels/modals/EditTagModal.jsx @@ -6,7 +6,7 @@ import { showSuccess, showWarning, verifyJSON, -} from '../../helpers'; +} from '../../../../helpers'; import { SideSheet, Space, @@ -26,7 +26,7 @@ import { IconUser, IconCode, } from '@douyinfe/semi-icons'; -import { getChannelModels } from '../../helpers'; +import { getChannelModels } from '../../../../helpers'; import { useTranslation } from 'react-i18next'; const { Text, Title } = Typography; @@ -441,4 +441,4 @@ const EditTagModal = (props) => { ); }; -export default EditTagModal; +export default EditTagModal; \ No newline at end of file