Skip to content

Commit

Permalink
fix(dashboard): navigation from inbox cta
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Dec 24, 2024
1 parent f0d20c3 commit 7c7af1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/auth/inbox-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const defaultFormValues: InboxPlaygroundFormData = {
label: 'Add to your app',
redirect: {
target: '_self',
url: '/',
url: '/onboarding/inbox/embed',
},
},
secondaryAction: null,
Expand Down Expand Up @@ -270,14 +270,14 @@ async function createDemoWorkflow({ environment }: { environment: IEnvironment }
label: '{{payload.primaryActionLabel}}',
redirect: {
target: '_self',
url: '',
url: '/onboarding/inbox/embed',
},
},
secondaryAction: {
label: '{{payload.secondaryActionLabel}}',
redirect: {
target: '_self',
url: '',
url: '/onboarding/inbox/embed',
},
},
},
Expand Down
11 changes: 10 additions & 1 deletion apps/dashboard/src/components/auth/inbox-preview-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useFetchEnvironments } from '../../context/environment/hooks';
import { useUser } from '@clerk/clerk-react';
import { useAuth } from '../../context/auth/hooks';
import { API_HOSTNAME, WEBSOCKET_HOSTNAME } from '../../config';
import { useNavigate } from 'react-router-dom';

interface InboxPreviewContentProps {
selectedStyle: string;
Expand All @@ -19,6 +20,7 @@ export function InboxPreviewContent({
primaryColor,
foregroundColor,
}: InboxPreviewContentProps) {
const navigate = useNavigate();
const auth = useAuth();
const { user } = useUser();
const { environments } = useFetchEnvironments({ organizationId: auth?.currentOrganization?._id });
Expand Down Expand Up @@ -66,7 +68,14 @@ export function InboxPreviewContent({
{selectedStyle === 'popover' && (
<div className="relative flex h-full w-full flex-col items-center">
<div className="mt-10 flex w-full max-w-[440px] items-center justify-end">
<Inbox {...configuration} placement="bottom-end" open />
<Inbox
{...configuration}
routerPush={(path: string) => {
return navigate(path);
}}
placement="bottom-end"
open
/>
</div>
<div className="absolute bottom-[-10px] left-2 flex flex-col items-start">
<SendNotificationArrow className="mt-2 h-[73px] w-[86px]" />
Expand Down

0 comments on commit 7c7af1d

Please sign in to comment.