Skip to content

Commit 2fb1eb9

Browse files
committed
removed generation count blocker (image)
1 parent 9b4ffa7 commit 2fb1eb9

File tree

4 files changed

+18
-61
lines changed

4 files changed

+18
-61
lines changed

frontend/libs/components/promptbox/src/lib/PromptBox2D.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { twMerge } from "tailwind-merge";
2525
import { GenerationProvider } from "@storyteller/api-enums";
2626
import { GenerationCountPicker } from "./common/GenerationCountPicker";
2727
import { StoreApi, UseBoundStore } from "zustand";
28-
import { useSubscriptionState } from "@storyteller/subscription";
2928

3029
export type AspectRatio = "wide" | "tall" | "square";
3130

@@ -68,10 +67,6 @@ export const PromptBox2D = ({
6867
}: PromptBox2DProps) => {
6968
useSignals();
7069

71-
// Check subscription status to determine if user is on free plan
72-
const hasPaidPlan = useSubscriptionState((s) => s.hasPaidPlan);
73-
const isFreeUser = !hasPaidPlan();
74-
7570
const [isModalOpen, setIsModalOpen] = useState(false);
7671
const [content, setContent] = useState<React.ReactNode>("");
7772

@@ -493,7 +488,6 @@ export const PromptBox2D = ({
493488
handleCountChange={(count) => {
494489
onGenerationCountChange?.(count);
495490
}}
496-
isFreeUser={isFreeUser}
497491
/>
498492
<GenerateButton
499493
className="flex items-center border-none bg-primary px-3 text-sm text-white disabled:cursor-not-allowed disabled:opacity-50"

frontend/libs/components/promptbox/src/lib/PromptBoxEdit.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { RefImage, usePromptEditStore } from "./promptStore";
2929
import { GenerationProvider } from "@storyteller/api-enums";
3030
import { AspectRatioPicker } from "./common/AspectRatioPicker";
3131
import { GenerationCountPicker } from "./common/GenerationCountPicker";
32-
import { useSubscriptionState } from "@storyteller/subscription";
3332

3433
export interface PromptBoxEditProps {
3534
onModeChange?: (mode: string) => void;
@@ -80,10 +79,6 @@ export const PromptBoxEdit = ({
8079
onRedo,
8180
credits,
8281
}: PromptBoxEditProps) => {
83-
// Check subscription status to determine if user is on free plan
84-
const hasPaidPlan = useSubscriptionState((s) => s.hasPaidPlan);
85-
const isFreeUser = !hasPaidPlan();
86-
8782
const [prompt, setPrompt] = useState("");
8883
const [useSystemPrompt, setUseSystemPrompt] = useState(true);
8984
const [isFocused, setIsFocused] = useState(false);
@@ -509,7 +504,6 @@ export const PromptBoxEdit = ({
509504
handleCountChange={(count) => {
510505
onGenerationCountChange?.(count);
511506
}}
512-
isFreeUser={isFreeUser}
513507
/>
514508
<GenerateButton
515509
className="flex items-center border-none bg-primary px-3 text-sm text-white disabled:cursor-not-allowed disabled:opacity-50"

frontend/libs/components/promptbox/src/lib/PromptBoxImage.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { AspectRatioIcon } from "./common/AspectRatioIcon";
2929
import { GenerationCountPicker } from "./common/GenerationCountPicker";
3030
import { ResolutionPicker } from "./common/ResolutionPicker";
3131
import { CommonResolution } from "@storyteller/model-list";
32-
import { useSubscriptionState } from "@storyteller/subscription";
3332

3433
interface PromptBoxImageProps {
3534
useJobContext: () => JobContextType;
@@ -68,10 +67,6 @@ export const PromptBoxImage = ({
6867
}: PromptBoxImageProps) => {
6968
useSignals();
7069

71-
// Check subscription status to determine if user is on free plan
72-
const hasPaidPlan = useSubscriptionState((s) => s.hasPaidPlan);
73-
const isFreeUser = !hasPaidPlan();
74-
7570
console.debug("Selected model:", selectedModel);
7671

7772
useEffect(() => {
@@ -535,7 +530,6 @@ export const PromptBoxImage = ({
535530
handleCountChange={(count) => {
536531
setGenerationCount(count);
537532
}}
538-
isFreeUser={isFreeUser}
539533
/>
540534
<GenerateButton
541535
className="flex items-center border-none bg-primary px-3 text-sm text-white disabled:cursor-not-allowed disabled:opacity-50"

frontend/libs/components/promptbox/src/lib/common/GenerationCountPicker.tsx

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { faCopy, faCrown } from "@fortawesome/pro-solid-svg-icons";
1+
import { faCopy } from "@fortawesome/pro-solid-svg-icons";
22
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
33
import { PopoverMenu, PopoverItem } from "@storyteller/ui-popover";
44
import { Tooltip } from "@storyteller/ui-tooltip";
@@ -10,27 +10,20 @@ interface GenerationCountPickerProps {
1010
currentModel?: ImageModel;
1111
currentCount: number;
1212
handleCountChange: (count: number) => void;
13-
isFreeUser?: boolean;
1413
}
1514

1615
export const GenerationCountPicker = ({
1716
currentModel,
1817
currentCount,
1918
handleCountChange,
20-
isFreeUser = false,
2119
}: GenerationCountPickerProps) => {
2220
const maxGenerationCount =
2321
currentModel?.maxGenerationCount || DEFAULT_GENERATION_COUNT;
2422
const hasPredefinedOptions = !!currentModel?.predefinedGenerationCounts;
25-
const isNanoBananaPro = currentModel?.id === "nano_banana_pro";
26-
const shouldLimitGenerations = isFreeUser && isNanoBananaPro;
2723

2824
let generationCountOptions: PopoverItem[];
2925

30-
// Free users on Nano Banana Pro are limited to 1 generation at a time
31-
if (shouldLimitGenerations) {
32-
generationCountOptions = [{ label: "1", selected: true }];
33-
} else if (hasPredefinedOptions) {
26+
if (hasPredefinedOptions) {
3427
// Count pickers either have a "[1,2, ... max]" set of options, or a pre-defined list of options.
3528
generationCountOptions = buildPredefinedCountOptions(
3629
currentModel?.predefinedGenerationCounts || [],
@@ -49,46 +42,28 @@ export const GenerationCountPicker = ({
4942
return;
5043
}
5144
if (count < 1 || count > maxGenerationCount) {
52-
// Clamp to valid range
5345
count = Math.min(Math.max(1, count), maxGenerationCount);
5446
}
5547
handleCountChange(count);
5648
};
5749

58-
// Tooltip content changes based on subscription status (only for Nano Banana Pro)
59-
const tooltipContent = shouldLimitGenerations ? (
60-
<div className="flex flex-col gap-1 max-w-[200px]">
61-
<div className="flex items-center gap-1.5 font-medium">
62-
<FontAwesomeIcon icon={faCrown} className="h-3 w-3 text-yellow-400" />
63-
<span>Generate more images</span>
64-
</div>
65-
<p className="text-xs text-base-fg/70">
66-
Subscribe to ArtCraft to generate multiple images at once.
67-
</p>
68-
</div>
69-
) : (
70-
"Number of generations"
71-
);
72-
7350
return (
74-
<>
75-
<Tooltip
76-
content={tooltipContent}
77-
position="top"
78-
className="z-50"
79-
closeOnClick={true}
80-
delay={0}
81-
>
82-
<PopoverMenu
83-
items={generationCountOptions}
84-
onSelect={onSelect}
85-
mode="toggle"
86-
panelTitle="No. of images"
87-
triggerIcon={<FontAwesomeIcon icon={faCopy} className="h-4 w-4" />}
88-
buttonClassName="h-9"
89-
/>
90-
</Tooltip>
91-
</>
51+
<Tooltip
52+
content="Number of generations"
53+
position="top"
54+
className="z-50"
55+
closeOnClick={true}
56+
delay={0}
57+
>
58+
<PopoverMenu
59+
items={generationCountOptions}
60+
onSelect={onSelect}
61+
mode="toggle"
62+
panelTitle="No. of images"
63+
triggerIcon={<FontAwesomeIcon icon={faCopy} className="h-4 w-4" />}
64+
buttonClassName="h-9"
65+
/>
66+
</Tooltip>
9267
);
9368
};
9469

0 commit comments

Comments
 (0)