Skip to content

Commit 1f09b0e

Browse files
authored
fix: When a mode like "Content" is selected in share links, it's odd that clone and copy are checked and blue (#4526)
## Description ref #3994 ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent b47f179 commit 1f09b0e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

apps/builder/app/shared/share-project/share-project.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,17 @@ const Menu = ({ name, hasProPlan, value, onChange, onDelete }: MenuProps) => {
194194
}}
195195
>
196196
<Checkbox
197-
disabled={hasProPlan !== true}
197+
disabled={hasProPlan !== true || value.relation !== "viewers"}
198198
checked={value.canClone}
199199
onCheckedChange={(canClone) => {
200200
onChange({ ...value, canClone: Boolean(canClone) });
201201
}}
202202
id={ids.canClone}
203203
/>
204-
<Label htmlFor={ids.canClone} disabled={hasProPlan !== true}>
204+
<Label
205+
htmlFor={ids.canClone}
206+
disabled={hasProPlan !== true || value.relation !== "viewers"}
207+
>
205208
Can clone
206209
</Label>
207210
</Grid>
@@ -214,14 +217,17 @@ const Menu = ({ name, hasProPlan, value, onChange, onDelete }: MenuProps) => {
214217
}}
215218
>
216219
<Checkbox
217-
disabled={hasProPlan !== true}
220+
disabled={hasProPlan !== true || value.relation !== "viewers"}
218221
checked={value.canCopy}
219222
onCheckedChange={(canCopy) => {
220223
onChange({ ...value, canCopy: Boolean(canCopy) });
221224
}}
222225
id={ids.canCopy}
223226
/>
224-
<Label htmlFor={ids.canCopy} disabled={hasProPlan !== true}>
227+
<Label
228+
htmlFor={ids.canCopy}
229+
disabled={hasProPlan !== true || value.relation !== "viewers"}
230+
>
225231
Can copy
226232
</Label>
227233
</Grid>

0 commit comments

Comments
 (0)