Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/src/components/contribute/steps/GuideDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type PropTypes = {
onSaveDraft: () => void;
submitting?: boolean;
showBaseFields?: boolean;
showPrerequisiteFields?: boolean;
hideBackBtn?: boolean;
title?: string;
changeSummary?: string;
Expand All @@ -56,6 +57,7 @@ export const GuideDetails = ({
// Prerequisites and todos live on the guide base, so they're only
// authorable while the base is still a draft.
showBaseFields = true,
showPrerequisiteFields = showBaseFields,
hideBackBtn,
title = "Guide Details",
changeSummary,
Expand Down Expand Up @@ -348,7 +350,7 @@ export const GuideDetails = ({
</div>
)}

{showBaseFields && (
{showPrerequisiteFields && (
<>
<Field className="space-y-2">
<div className="space-y-1">
Expand Down Expand Up @@ -378,6 +380,7 @@ export const GuideDetails = ({
prereqs,
}))
}
disabled={!showBaseFields}
/>
</Field>

Expand Down Expand Up @@ -410,6 +413,7 @@ export const GuideDetails = ({
aria-describedby={
todoPrereqError ? "todo-prereq-error" : undefined
}
disabled={!showBaseFields}
/>

<Input
Expand All @@ -430,6 +434,7 @@ export const GuideDetails = ({
aria-describedby={
todoPrereqError ? "todo-prereq-error" : undefined
}
disabled={!showBaseFields}
/>
<Button
type="button"
Expand Down Expand Up @@ -473,6 +478,7 @@ export const GuideDetails = ({
setTodoPrereq({ title: "", summary: "" });
setTodoPrereqError(null);
}}
disabled={!showBaseFields}
>
Add Todo
</Button>
Expand Down Expand Up @@ -513,6 +519,7 @@ export const GuideDetails = ({
),
}))
}
disabled={!showBaseFields}
>
<X className="size-3" />
</button>
Expand Down
1 change: 1 addition & 0 deletions app/src/components/ui/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export function Combobox({
<button
type="button"
aria-label={`Remove ${item.label}`}
disabled={disabled}
className="text-muted-foreground hover:text-foreground"
onClick={() => toggle(item.value)}
>
Expand Down
1 change: 1 addition & 0 deletions app/src/routes/guides/$slug/$variantSlug/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ function RouteComponent() {
onSaveDraft={saveDraft}
submitting={submitting}
showBaseFields={false}
showPrerequisiteFields
hideBackBtn
title="Edit Details"
changeSummary={changeSummary}
Expand Down
Loading