mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
(search): modal triggers on ctrl k
This commit is contained in:
@@ -150,8 +150,8 @@ const Toolkit = styled.kbd`
|
|||||||
top: 4px;
|
top: 4px;
|
||||||
background-color: ${(props) => props.theme.primary.bg};
|
background-color: ${(props) => props.theme.primary.bg};
|
||||||
color: ${(props) => props.theme.secondary.text};
|
color: ${(props) => props.theme.secondary.text};
|
||||||
font-size: 9px;
|
font-size: 10px;
|
||||||
padding: 2px;
|
padding: 3px;
|
||||||
border: 1px solid ${(props) => props.theme.secondary.text};
|
border: 1px solid ${(props) => props.theme.secondary.text};
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
`
|
`
|
||||||
@@ -193,7 +193,8 @@ export const SearchBar = ({
|
|||||||
}, [input])
|
}, [input])
|
||||||
|
|
||||||
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (event.key === 'Enter') {
|
event.preventDefault();
|
||||||
|
if (event.ctrlKey && event.key === 'k'){
|
||||||
setIsWidgetOpen(true);
|
setIsWidgetOpen(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -231,7 +232,7 @@ export const SearchBar = ({
|
|||||||
</SearchResults>
|
</SearchResults>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<Toolkit title='Press Enter to Ask AI'>Enter</Toolkit>
|
<Toolkit title='Press Ctrl + K to Ask AI'>Ctrl K</Toolkit>
|
||||||
</Container>
|
</Container>
|
||||||
<WidgetCore
|
<WidgetCore
|
||||||
theme={theme}
|
theme={theme}
|
||||||
|
|||||||
Reference in New Issue
Block a user