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: add public page search ui

JimmFlya54bc69d46f6
diff --git a/packages/app/src/components/quick-search/index.tsx b/packages/app/src/components/quick-search/index.tsx
index 7c24f0b970..88f1b7e125 100644
--- a/packages/app/src/components/quick-search/index.tsx
+++ b/packages/app/src/components/quick-search/index.tsx
@@ -72,7 +72,7 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
width={620}
style={{
maxHeight: '80vh',
- minHeight: '350px',
+ minHeight: isPublic && query.length === 0 ? '72px' : '350px',
top: '12vh',
}}
>
@@ -100,37 +100,41 @@ export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
/>
<StyledShortcut>{isMac() ? '⌘ + K' : 'Ctrl + K'}</StyledShortcut>
</StyledModalHeader>
- <StyledModalDivider />
- <Command.List>
- <StyledContent>
- {!isPublic ? (
- <Results
- query={query}
- loading={loading}
- setLoading={setLoading}
- setShowCreatePage={setShowCreatePage}
- />
- ) : (
- <PublishedResults
- query={query}
- loading={loading}
- setLoading={setLoading}
- onClose={onClose}
- setPublishWorkspaceName={setPublishWorkspaceName}
- />
- )}
- </StyledContent>
- {!isPublic ? (
- showCreatePage ? (
- <>
- <StyledModalDivider />
- <StyledModalFooter>
- <Footer query={query} />
- </StyledModalFooter>
- </>
- ) : null
- ) : null}
- </Command.List>
+ {isPublic && query.length === 0 ? null : (
+ <>
+ <StyledModalDivider />
+ <Command.List>
+ <StyledContent>
+ {!isPublic ? (
+ <Results
+ query={query}
+ loading={loading}
+ setLoading={setLoading}
+ setShowCreatePage={setShowCreatePage}
+ />
+ ) : (
+ <PublishedResults
+ query={query}
+ loading={loading}
+ setLoading={setLoading}
+ onClose={onClose}
+ setPublishWorkspaceName={setPublishWorkspaceName}
+ />
+ )}
+ </StyledContent>
+ {!isPublic ? (
+ showCreatePage ? (
+ <>
+ <StyledModalDivider />
+ <StyledModalFooter>
+ <Footer query={query} />
+ </StyledModalFooter>
+ </>
+ ) : null
+ ) : null}
+ </Command.List>
+ </>
+ )}
</Command>
</ModalWrapper>
</Modal>