tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
disable poll edit on read view of pub polls
awarm.space
4 months ago
b019644e
29977585
+4
-3
1 changed file
expand all
collapse all
unified
split
components
Blocks
PublicationPollBlock.tsx
+4
-3
components/Blocks/PublicationPollBlock.tsx
···
102
102
/>
103
103
))}
104
104
105
105
-
{!props.isPublished && (
105
105
+
{!props.isPublished && permission_set.permissions.write && (
106
106
<button
107
107
className="pollAddOption w-fit flex gap-2 items-center justify-start text-sm text-accent-contrast"
108
108
onClick={async () => {
···
136
136
canDelete: boolean;
137
137
}) => {
138
138
let { rep } = useReplicache();
139
139
+
let { permissions } = useEntitySetContext();
139
140
let optionName = useEntity(props.entityID, "poll-option/name")?.data.value;
140
141
141
142
return (
···
145
146
type="text"
146
147
className="pollOptionInput w-full input-with-border"
147
148
placeholder="Option here..."
148
148
-
disabled={props.disabled}
149
149
+
disabled={props.disabled || !permissions.write}
149
150
value={optionName || ""}
150
151
onChange={async (e) => {
151
152
await rep?.mutate.assertFact([
···
168
169
}}
169
170
/>
170
171
171
171
-
{props.canDelete && (
172
172
+
{permissions.write && props.canDelete && (
172
173
<button
173
174
tabIndex={-1}
174
175
className="text-accent-contrast"