Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: width of cmd-item button on quick-search modal (#2273)

Fangdun Tsaicba329332670
diff --git a/apps/web/src/components/pure/quick-search-modal/index.tsx b/apps/web/src/components/pure/quick-search-modal/index.tsx
index 5c4e50d30c..b6744ccb92 100644
--- a/apps/web/src/components/pure/quick-search-modal/index.tsx
+++ b/apps/web/src/components/pure/quick-search-modal/index.tsx
@@ -159,15 +159,7 @@ export const QuickSearchModal: React.FC<QuickSearchModalProps> = ({
<StyledContent
style={{ display: isPublicAndNoQuery() ? 'none' : '' }}
>
- {!isPublicWorkspace ? (
- <Results
- query={query}
- onClose={handleClose}
- router={router}
- blockSuiteWorkspace={blockSuiteWorkspace}
- setShowCreatePage={setShowCreatePage}
- />
- ) : (
+ {isPublicWorkspace ? (
<PublishedResults
blockSuiteWorkspace={blockSuiteWorkspace}
query={query}
@@ -176,22 +168,28 @@ export const QuickSearchModal: React.FC<QuickSearchModalProps> = ({
setPublishWorkspaceName={setPublishWorkspaceName}
data-testid="published-search-results"
/>
+ ) : (
+ <Results
+ query={query}
+ onClose={handleClose}
+ router={router}
+ blockSuiteWorkspace={blockSuiteWorkspace}
+ setShowCreatePage={setShowCreatePage}
+ />
)}
</StyledContent>
- {!isPublicWorkspace ? (
- showCreatePage ? (
- <>
- <StyledModalDivider />
- <StyledModalFooter>
- <Footer
- query={query}
- onClose={handleClose}
- blockSuiteWorkspace={blockSuiteWorkspace}
- router={router}
- />
- </StyledModalFooter>
- </>
- ) : null
+ {isPublicWorkspace ? null : showCreatePage ? (
+ <>
+ <StyledModalDivider />
+ <StyledModalFooter>
+ <Footer
+ query={query}
+ onClose={handleClose}
+ blockSuiteWorkspace={blockSuiteWorkspace}
+ router={router}
+ />
+ </StyledModalFooter>
+ </>
) : null}
</Command.List>
</Command>
diff --git a/apps/web/src/components/pure/quick-search-modal/style.ts b/apps/web/src/components/pure/quick-search-modal/style.ts
index df65132826..4005419c4b 100644
--- a/apps/web/src/components/pure/quick-search-modal/style.ts
+++ b/apps/web/src/components/pure/quick-search-modal/style.ts
@@ -161,7 +161,7 @@ export const StyledModalFooterContent = styled('button')(() => {
});
export const StyledListItem = styled('button')(() => {
return {
- // width: '612px',
+ width: '100%',
height: '32px',
fontSize: 'inherit',
color: 'inherit',