Skip to content

Commit 411d0c8

Browse files
committed
fix views layout
1 parent 19a642d commit 411d0c8

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

src/cloud/components/Views/EditableDocItemContainer.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { prepareDocPropsForAPI } from '../../lib/props'
2222
import { GetDocResponseBody } from '../../api/teams/docs'
2323
import { getDocContent } from '../../lib/utils/patterns'
2424
import { BulkApiActionRes } from '../../../design/lib/hooks/useBulkApi'
25+
import { usePage } from '../../lib/stores/pageStore'
2526

2627
interface ItemProps {
2728
doc: SerializedDocWithSupplemental
@@ -33,6 +34,7 @@ const EditableDocItemContainer = ({ doc, children }: ItemProps) => {
3334
const [showingContextMenuActions, setShowingContextMenuActions] =
3435
useState<boolean>(false)
3536

37+
const { currentUserIsCoreMember } = usePage()
3638
const { createDoc, updateDoc, deleteDocApi, getUpdatedDocApi, sendingMap } =
3739
useCloudApi()
3840
const { translate } = useI18n()
@@ -117,6 +119,10 @@ const EditableDocItemContainer = ({ doc, children }: ItemProps) => {
117119
[deleteDocApi, popup, translate, onDocDuplicate]
118120
)
119121

122+
if (!currentUserIsCoreMember) {
123+
return <ItemContainer className='item__container'>{children}</ItemContainer>
124+
}
125+
120126
const showInput = !sendingMap.has(doc.id) && editingItemTitle
121127
return (
122128
<ItemContainer

src/cloud/components/Views/List/ListViewItem.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const ListViewItem: AppComponent<FolderListItemProps> = ({
114114
}
115115
}}
116116
>
117-
{showCheckbox && (
117+
{showCheckbox ? (
118118
<Checkbox
119119
className={cc([
120120
'list-view-item__checkbox',
@@ -123,6 +123,8 @@ const ListViewItem: AppComponent<FolderListItemProps> = ({
123123
checked={checked}
124124
toggle={() => onSelect(!checked)}
125125
/>
126+
) : (
127+
<div className='list-view-item__checkbox--placeholder' />
126128
)}
127129
{!hideOrderingHandle && (
128130
<div className='list-view-item__ordering-handle' {...listeners}>
@@ -222,6 +224,12 @@ const StyledContainer = styled.div`
222224
${overflowEllipsis()}
223225
}
224226
227+
.list-view-item__checkbox--placeholder {
228+
height: 1px;
229+
width: ${({ theme }) => theme.sizes.spaces.md - 2}px;
230+
margin-right: ${({ theme }) => theme.sizes.spaces.df}px;
231+
}
232+
225233
.list-view-item__checkbox {
226234
opacity: 0;
227235
margin-right: ${({ theme }) => theme.sizes.spaces.df}px;

src/design/components/organisms/Table/molecules/TableRow.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const TableRow = ({
2121
}: InternalTableRowProps) => {
2222
return (
2323
<Container div className='table-row'>
24-
<div className='table-row__checkbox__wrapper'>
25-
{showCheckbox && onCheckboxToggle != null && (
24+
{showCheckbox && onCheckboxToggle != null && (
25+
<div className='table-row__checkbox__wrapper'>
2626
<Checkbox
2727
className={cc([
2828
'table-row__checkbox',
@@ -31,8 +31,8 @@ const TableRow = ({
3131
checked={checked}
3232
toggle={() => onCheckboxToggle(!checked)}
3333
/>
34-
)}
35-
</div>
34+
</div>
35+
)}
3636
{cells.map((cell, i) => (
3737
<TableCell {...cell} width={widths[i]} key={`table-cell-${i}`} />
3838
))}

0 commit comments

Comments
 (0)