only show bounce filter on overview
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (push) Has been cancelled

This commit is contained in:
Francis Cao 2026-02-04 10:21:44 -08:00
parent f232ce2643
commit f84b9f041d

View file

@ -14,8 +14,9 @@ export function WebsiteFilterButton({
alignment?: 'end' | 'center' | 'start';
}) {
const { formatMessage, labels } = useMessages();
const { updateParams, router, query } = useNavigation();
const { updateParams, pathname, router, query } = useNavigation();
const [excludeBounce, setExcludeBounce] = useState(!!query.excludeBounce);
const isOverview = /^\/teams\/[^/]+\/websites\/[^/]+$/.test(pathname);
const handleChange = ({ filters, segment, cohort }: any) => {
const params = filtersArrayToObject(filters);
@ -35,13 +36,17 @@ export function WebsiteFilterButton({
{({ close }) => {
return (
<>
<Row position="absolute" top="30px" right="30px">
<Row alignItems="center" gap>
<Checkbox value={excludeBounce ? 'true' : ''} onChange={setExcludeBounce}>
{isOverview && (
<Row position="absolute" top="30px" right="30px">
<Checkbox
value={excludeBounce ? 'true' : ''}
onChange={setExcludeBounce}
style={{ marginTop: '3px' }}
>
{formatMessage(labels.excludeBounce)}
</Checkbox>
</Row>
</Row>
)}
<FilterEditForm websiteId={websiteId} onChange={handleChange} onClose={close} />
</>
);