feat: Introduce configurable icon and card sizes for document views and desktop workspace.
This commit is contained in:
@@ -14,11 +14,11 @@ import DocumentEntry from './DocumentEntry';
|
||||
interface DocumentsGridCardProps extends DocumentsViewProps {
|
||||
entry: DocumentsListEntry;
|
||||
viewLogic: DocumentViewLogic;
|
||||
gridIconSize?: number;
|
||||
iconSize?: number;
|
||||
}
|
||||
|
||||
const DocumentsGridCard: React.FC<DocumentsGridCardProps> = (props) => {
|
||||
const { entry, gridIconSize } = props;
|
||||
const { entry, iconSize } = props;
|
||||
|
||||
if (entry.type === 'folder') {
|
||||
const folder = entry.folder;
|
||||
@@ -35,7 +35,7 @@ const DocumentsGridCard: React.FC<DocumentsGridCardProps> = (props) => {
|
||||
{(logic) => (
|
||||
<>
|
||||
<div className="folder-card__icon">
|
||||
<FolderIcon className="folder-card__icon-svg" size={gridIconSize} />
|
||||
<FolderIcon className="folder-card__icon-svg" size={iconSize} />
|
||||
</div>
|
||||
<div className="folder-card__meta">
|
||||
<div className="folder-card__label-row">
|
||||
@@ -82,7 +82,7 @@ const DocumentsGridCard: React.FC<DocumentsGridCardProps> = (props) => {
|
||||
ensureAssetUrl={props.ensureAssetUrl}
|
||||
getDocumentAsset={props.getDocumentAsset}
|
||||
alt={`Thumbnail for ${doc.title}`}
|
||||
maxSize={gridIconSize}
|
||||
maxSize={iconSize}
|
||||
scrollRootRef={props.scrollRef}
|
||||
/>
|
||||
<div className="document-card__meta">
|
||||
|
||||
@@ -3,14 +3,14 @@ import React from 'react';
|
||||
interface DocumentsGridContainerProps {
|
||||
children: React.ReactNode;
|
||||
clearSelection: () => void;
|
||||
gridIconSize?: number;
|
||||
iconSize?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const DocumentsGridContainer: React.FC<DocumentsGridContainerProps> = ({
|
||||
children,
|
||||
clearSelection,
|
||||
gridIconSize,
|
||||
iconSize,
|
||||
...props
|
||||
}) => {
|
||||
return (
|
||||
@@ -19,8 +19,8 @@ const DocumentsGridContainer: React.FC<DocumentsGridContainerProps> = ({
|
||||
role="list"
|
||||
{...props}
|
||||
style={
|
||||
gridIconSize
|
||||
? ({ '--documents-grid-icon-size': `${gridIconSize}px` } as React.CSSProperties)
|
||||
iconSize
|
||||
? ({ '--documents-grid-icon-size': `${iconSize}px` } as React.CSSProperties)
|
||||
: undefined
|
||||
}
|
||||
onClick={(event) => {
|
||||
|
||||
@@ -15,10 +15,11 @@ import DocumentEntry from './DocumentEntry';
|
||||
interface DocumentsListRowProps extends DocumentsViewProps {
|
||||
entry: DocumentsListEntry;
|
||||
viewLogic: DocumentViewLogic;
|
||||
iconSize?: number;
|
||||
}
|
||||
|
||||
const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
|
||||
const { entry } = props;
|
||||
const { entry, iconSize } = props;
|
||||
|
||||
if (entry.type === 'folder') {
|
||||
const folder = entry.folder;
|
||||
@@ -35,7 +36,7 @@ const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
|
||||
<>
|
||||
<td className="thumb-cell">
|
||||
<div className="thumb-icon">
|
||||
<FolderIcon className="thumb-icon__image" size={32} />
|
||||
<FolderIcon className="thumb-icon__image" size={iconSize || 32} />
|
||||
</div>
|
||||
</td>
|
||||
<td className="doc-list__name">
|
||||
@@ -92,6 +93,7 @@ const DocumentsListRow: React.FC<DocumentsListRowProps> = (props) => {
|
||||
getDocumentAsset={props.getDocumentAsset}
|
||||
alt={`Thumbnail for ${doc.title}`}
|
||||
scrollRootRef={props.scrollRef}
|
||||
maxSize={props.iconSize}
|
||||
/>
|
||||
</td>
|
||||
<td className="doc-list__name">
|
||||
|
||||
Reference in New Issue
Block a user