mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-04 10:30:00 -06:00
fix "other" option, add Ids for posthog
This commit is contained in:
@@ -25,7 +25,7 @@ export default function TemplateList({ environmentId, onTemplateClick }: Templat
|
||||
|
||||
const { product, isLoadingProduct, isErrorProduct } = useProduct(environmentId);
|
||||
const { profile, isLoadingProfile, isErrorProfile } = useProfile();
|
||||
const [selectedFilter, setSelectedFilter] = useState(ALL_CATEGORY_NAME);
|
||||
const [selectedFilter, setSelectedFilter] = useState(RECOMMENDED_CATEGORY_NAME);
|
||||
|
||||
const [categories, setCategories] = useState<Array<string>>([]);
|
||||
|
||||
@@ -41,13 +41,15 @@ export default function TemplateList({ environmentId, onTemplateClick }: Templat
|
||||
...(Array.from(new Set(templates.map((template) => template.category))) as string[]),
|
||||
];
|
||||
|
||||
const fullCategories = !!profile?.objective
|
||||
? [RECOMMENDED_CATEGORY_NAME, ...defaultCategories]
|
||||
: defaultCategories;
|
||||
const fullCategories =
|
||||
!!profile?.objective && profile.objective !== "other"
|
||||
? [RECOMMENDED_CATEGORY_NAME, ...defaultCategories]
|
||||
: [ALL_CATEGORY_NAME, ...defaultCategories];
|
||||
|
||||
setCategories(fullCategories);
|
||||
|
||||
const activeFilter = !!profile?.objective ? RECOMMENDED_CATEGORY_NAME : ALL_CATEGORY_NAME;
|
||||
const activeFilter =
|
||||
!!profile?.objective && profile.objective !== "other" ? RECOMMENDED_CATEGORY_NAME : ALL_CATEGORY_NAME;
|
||||
setSelectedFilter(activeFilter);
|
||||
}, [profile]);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ const Objective: React.FC<ObjectiveProps> = ({ next, skip }) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-24 flex justify-between">
|
||||
<Button size="lg" className="text-slate-400" variant="minimal" onClick={skip}>
|
||||
<Button size="lg" className="text-slate-400" variant="minimal" onClick={skip} id="objective-skip">
|
||||
Skip
|
||||
</Button>
|
||||
<Button
|
||||
@@ -103,7 +103,8 @@ const Objective: React.FC<ObjectiveProps> = ({ next, skip }) => {
|
||||
variant="darkCTA"
|
||||
loading={isMutatingProfile}
|
||||
disabled={!selectedChoice}
|
||||
onClick={handleNextClick}>
|
||||
onClick={handleNextClick}
|
||||
id="objective-next">
|
||||
Next
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@ const Role: React.FC<Role> = ({ next, skip }) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-24 flex justify-between">
|
||||
<Button size="lg" className="text-slate-400" variant="minimal" onClick={skip}>
|
||||
<Button size="lg" className="text-slate-400" variant="minimal" onClick={skip} id="role-skip">
|
||||
Skip
|
||||
</Button>
|
||||
<Button
|
||||
@@ -98,7 +98,8 @@ const Role: React.FC<Role> = ({ next, skip }) => {
|
||||
variant="darkCTA"
|
||||
loading={isMutatingProfile}
|
||||
disabled={!selectedChoice}
|
||||
onClick={handleNextClick}>
|
||||
onClick={handleNextClick}
|
||||
id="role-next">
|
||||
Next
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user