Skip to content

Commit d477554

Browse files
committed
hide creation prop for non viewers
1 parent 44e962d commit d477554

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

src/cloud/components/DocProperties.tsx

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -140,33 +140,35 @@ const DocProperties = ({
140140
</div>
141141
)
142142
})}
143-
<Button
144-
variant='transparent'
145-
iconPath={mdiPlus}
146-
className='doc-props__property'
147-
size='sm'
148-
onClick={(event) => {
149-
openContextModal(
150-
event,
151-
<DocPagePropsAddContext
152-
doc={doc}
153-
disallowedNames={existingPropNames}
154-
addProp={(propName, propData) => {
155-
updateProp(propName, propData)
156-
closeLastModal()
157-
}}
158-
/>,
159-
{
160-
width: 200,
161-
alignment: 'right',
162-
removePadding: true,
163-
keepAll: true,
164-
}
165-
)
166-
}}
167-
>
168-
Add a property
169-
</Button>
143+
{currentUserIsCoreMember && (
144+
<Button
145+
variant='transparent'
146+
iconPath={mdiPlus}
147+
className='doc-props__property'
148+
size='sm'
149+
onClick={(event) => {
150+
openContextModal(
151+
event,
152+
<DocPagePropsAddContext
153+
doc={doc}
154+
disallowedNames={existingPropNames}
155+
addProp={(propName, propData) => {
156+
updateProp(propName, propData)
157+
closeLastModal()
158+
}}
159+
/>,
160+
{
161+
width: 200,
162+
alignment: 'right',
163+
removePadding: true,
164+
keepAll: true,
165+
}
166+
)
167+
}}
168+
>
169+
Add a property
170+
</Button>
171+
)}
170172
<Button
171173
id='properties-hide'
172174
variant='transparent'

0 commit comments

Comments
 (0)