diff --git a/packages/lobe-commit/src/commands/Commit/InputIssues.tsx b/packages/lobe-commit/src/commands/Commit/InputIssues.tsx index 96cc4a9..52a1824 100644 --- a/packages/lobe-commit/src/commands/Commit/InputIssues.tsx +++ b/packages/lobe-commit/src/commands/Commit/InputIssues.tsx @@ -10,7 +10,7 @@ import { useCommitStore } from '@/store/commitStore'; import Header from './Header'; -const InputIssues = memo<{ show: boolean }>(({ show }) => { +const InputIssues = memo(() => { const { message, setIssues, setStep, issues, fetchIssuesList, isGithubRepo, issuesLoading } = useCommitStore( (st) => ({ @@ -80,7 +80,6 @@ const InputIssues = memo<{ show: boolean }>(({ show }) => { {message}} header={
} - show={show} > {isGithubRepo ? ( issuesLoading ? ( diff --git a/packages/lobe-commit/src/commands/Commit/InputScope.tsx b/packages/lobe-commit/src/commands/Commit/InputScope.tsx index d76506d..218dfaf 100644 --- a/packages/lobe-commit/src/commands/Commit/InputScope.tsx +++ b/packages/lobe-commit/src/commands/Commit/InputScope.tsx @@ -9,7 +9,7 @@ import { useCommitStore } from '@/store/commitStore'; import Header from './Header'; -const InputScope = memo<{ show: boolean }>(({ show }) => { +const InputScope = memo(() => { const { message, setScope, setStep, scope } = useCommitStore( (st) => ({ message: st.message, @@ -19,13 +19,12 @@ const InputScope = memo<{ show: boolean }>(({ show }) => { }), shallow, ); - useInput(useCallback((_, key) => key.tab && setStep('feat'), [])); + useInput(useCallback((_, key) => key.tab && setStep('type'), [])); return ( {message}} header={
} - show={show} > (({ show }) => { +const InputScope = memo(() => { const { message, setSubject, setStep, subject } = useCommitStore( (st) => ({ message: st.message, @@ -25,12 +25,11 @@ const InputScope = memo<{ show: boolean }>(({ show }) => { {message}} header={
} - show={show} > setStep('issues')} + onSubmit={() => subject && setStep('issues')} placeholder="Input commit ..." /> diff --git a/packages/lobe-commit/src/commands/Commit/InputType.tsx b/packages/lobe-commit/src/commands/Commit/InputType.tsx index 33b22c3..0953cb5 100644 --- a/packages/lobe-commit/src/commands/Commit/InputType.tsx +++ b/packages/lobe-commit/src/commands/Commit/InputType.tsx @@ -27,7 +27,7 @@ const aiItem: SelectInputItem = { value: 'ai', }; -const InputType = memo<{ show: boolean }>(({ show }) => { +const InputType = memo(() => { const { setType, setStep, setEmoji, type } = useCommitStore( (st) => ({ setEmoji: st.setEmoji, @@ -74,7 +74,6 @@ const InputType = memo<{ show: boolean }>(({ show }) => { } header={
} reverse - show={show} > label} diff --git a/packages/lobe-commit/src/commands/Commit/index.tsx b/packages/lobe-commit/src/commands/Commit/index.tsx index 5a543f6..d5700ca 100644 --- a/packages/lobe-commit/src/commands/Commit/index.tsx +++ b/packages/lobe-commit/src/commands/Commit/index.tsx @@ -36,14 +36,11 @@ const Commit = memo(({ hook }) => { if (step === 'commit') return ; if (step === 'ai') return ; - return ( - <> - - - - - - ); + if (step === 'type') return ; + if (step === 'scope') return ; + if (step === 'subject') return ; + if (step === 'issues') return ; + return; }); export default Commit; diff --git a/packages/lobe-commit/src/store/commitStore.ts b/packages/lobe-commit/src/store/commitStore.ts index 63e9871..b2cb7b0 100644 --- a/packages/lobe-commit/src/store/commitStore.ts +++ b/packages/lobe-commit/src/store/commitStore.ts @@ -5,7 +5,7 @@ import genCommitMessage from '@/utils/genCommitMessage'; import getIssuesList from '@/utils/getIssuesList'; import getRepo from '@/utils/getRepo'; -export type Step = 'feat' | 'scope' | 'subject' | 'issues' | 'ai' | 'commit' | 'done'; +export type Step = 'type' | 'scope' | 'subject' | 'issues' | 'ai' | 'commit'; export interface CommitStore { emoji: string; fetchIssuesList: () => void; @@ -80,7 +80,7 @@ export const useCommitStore = create((set, get) => ({ set({ type }); get().refreshMessage(); }, - step: 'feat', + step: 'type', subject: '', type: '', }));