Merge branch 'feat/filesystem_and_search' of github.com:toeverything/AFFiNE into feat/filesystem_and_search

This commit is contained in:
DiamondThree
2022-12-23 17:07:54 +08:00
15 changed files with 53 additions and 45 deletions
@@ -73,7 +73,7 @@ type TransitionsModalProps = {
export const ContactModal = ({ open, onClose }: TransitionsModalProps) => {
return (
<Modal open={open} onClose={onClose}>
<Modal open={open} onClose={onClose} data-testid="contact-us-modal-content">
<ModalWrapper
width={860}
height={540}
@@ -70,7 +70,10 @@ export const HelpIsland = ({
</Grow>
<div style={{ position: 'relative' }}>
<StyledIconWrapper isEdgelessDark={isEdgelessDark}>
<StyledIconWrapper
isEdgelessDark={isEdgelessDark}
data-testid="faq-icon"
>
<HelpIcon />
</StyledIconWrapper>
<StyledTransformIcon in={showContent}>
@@ -1,12 +1,17 @@
import React from 'react';
export const Empty = () => {
import { Empty } from '@/ui/empty';
export const PageListEmpty = () => {
return (
<div style={{ textAlign: 'center' }}>
<Empty
width={800}
height={300}
sx={{ marginTop: '100px', marginBottom: '30px' }}
/>
<p>Tips: Click Add to Favourites/Trash and the page will appear here.</p>
<p>(Designer is grappling with designing)</p>
</div>
);
};
export default Empty;
export default PageListEmpty;
@@ -2,7 +2,7 @@ import React from 'react';
import { AddIcon } from '@blocksuite/icons';
import { StyledModalFooterContent } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { useAppState } from '@/providers/app-state-provider/context';
import { useAppState } from '@/providers/app-state-provider';
import { Command } from 'cmdk';
import { usePageHelper } from '@/hooks/use-page-helper';
@@ -13,7 +13,7 @@ import { Command } from 'cmdk';
import { useEffect, useState } from 'react';
import { useModal } from '@/providers/global-modal-provider';
import { getUaHelper } from '@/utils';
import { useAppState } from '@/providers/app-state-provider/context';
import { useAppState } from '@/providers/app-state-provider';
type TransitionsModalProps = {
open: boolean;
onClose: () => void;
@@ -8,6 +8,7 @@ import React, {
import { SearchIcon } from '@blocksuite/icons';
import { StyledInputContent, StyledLabel } from './style';
import { Command } from 'cmdk';
import { useAppState } from '@/providers/app-state-provider';
export const Input = (props: {
query: string;
setQuery: Dispatch<SetStateAction<string>>;
@@ -16,6 +17,11 @@ export const Input = (props: {
const [isComposition, setIsComposition] = useState(false);
const [inputValue, setInputValue] = useState('');
const inputRef = useRef<HTMLInputElement>(null);
const { currentWorkspaceId, workspacesMeta, currentWorkspace } =
useAppState();
const isPublic = workspacesMeta.find(
meta => String(meta.id) === String(currentWorkspaceId)
)?.public;
useEffect(() => {
inputRef.current?.addEventListener(
'blur',
@@ -73,7 +79,7 @@ export const Input = (props: {
}
}
}}
placeholder="Quick Search..."
placeholder={isPublic ? currentWorkspace?.meta.name : 'Quick Search...'}
/>
</StyledInputContent>
);
@@ -3,7 +3,7 @@ import { StyledListItem, StyledNotFound } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { PaperIcon, EdgelessIcon } from '@blocksuite/icons';
import { Dispatch, SetStateAction, useEffect, useState } from 'react';
import { useAppState } from '@/providers/app-state-provider/context';
import { useAppState } from '@/providers/app-state-provider';
import { useRouter } from 'next/router';
import { config } from './config';
import { NoResultSVG } from './noResultSVG';
@@ -8,7 +8,7 @@ import {
import { ModalCloseButton } from '@/ui/modal';
import { Button } from '@/ui/button';
import { leaveWorkspace } from '@pathfinder/data-services';
import { Router, useRouter } from 'next/router';
import { useRouter } from 'next/router';
import { useAppState } from '@/providers/app-state-provider';
interface WorkspaceDeleteProps {