fix(mobile): change mobile docs display config and prevent opening doc when close menu (#12903)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Improvements** - Updated document explorer to hide quick favorite and document icons, and display more detailed system properties for each document. - Enhanced link behavior in the workbench to prevent unintended clicks from triggering navigation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -15,8 +15,13 @@ import { AllDocsHeader } from '../../views';
|
|||||||
const AllDocs = () => {
|
const AllDocs = () => {
|
||||||
const [explorerContextValue] = useState(() =>
|
const [explorerContextValue] = useState(() =>
|
||||||
createDocExplorerContext({
|
createDocExplorerContext({
|
||||||
quickFavorite: true,
|
quickFavorite: false,
|
||||||
displayProperties: ['createdAt', 'updatedAt', 'tags'],
|
showDocIcon: false,
|
||||||
|
displayProperties: [
|
||||||
|
'system:createdAt',
|
||||||
|
'system:updatedAt',
|
||||||
|
'system:tags',
|
||||||
|
],
|
||||||
view: 'masonry',
|
view: 'masonry',
|
||||||
showDragHandle: false,
|
showDragHandle: false,
|
||||||
groupBy: undefined,
|
groupBy: undefined,
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ export const WorkbenchLink = forwardRef<HTMLAnchorElement, WorkbenchLinkProps>(
|
|||||||
const link = basename + stringTo;
|
const link = basename + stringTo;
|
||||||
const handleClick = useAsyncCallback(
|
const handleClick = useAsyncCallback(
|
||||||
async (event: React.MouseEvent<HTMLAnchorElement>) => {
|
async (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||||
|
// a trick to prevent click from modal overlay propagation
|
||||||
|
if (!event.currentTarget.contains(event.target as Node)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
onClick?.(event);
|
onClick?.(event);
|
||||||
if (event.defaultPrevented) {
|
if (event.defaultPrevented) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user