-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
723 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/primitives/popover'; | ||
import { APP_ID } from '@/config'; | ||
import { useUser } from '@clerk/clerk-react'; | ||
import { Bell, Inbox, InboxContent } from '@novu/react'; | ||
import { PopoverPortal } from '@radix-ui/react-popover'; | ||
|
||
export const InboxButton = () => { | ||
const { user } = useUser(); | ||
|
||
if (!user) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Inbox subscriberId={user.id} applicationIdentifier={APP_ID}> | ||
<Popover> | ||
<PopoverTrigger> | ||
<Bell /> | ||
</PopoverTrigger> | ||
<PopoverPortal> | ||
<PopoverContent className="h-[500px] w-[350px] p-0"> | ||
<InboxContent /> | ||
</PopoverContent> | ||
</PopoverPortal> | ||
</Popover> | ||
</Inbox> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as React from 'react'; | ||
import * as PopoverPrimitive from '@radix-ui/react-popover'; | ||
|
||
import { cn } from '@/utils/ui'; | ||
|
||
const Popover = PopoverPrimitive.Root; | ||
|
||
const PopoverTrigger = PopoverPrimitive.Trigger; | ||
|
||
const PopoverAnchor = PopoverPrimitive.Anchor; | ||
|
||
const PopoverContent = React.forwardRef< | ||
React.ElementRef<typeof PopoverPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> | ||
>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => ( | ||
<PopoverPrimitive.Portal> | ||
<PopoverPrimitive.Content | ||
ref={ref} | ||
align={align} | ||
sideOffset={sideOffset} | ||
className={cn( | ||
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none', | ||
className | ||
)} | ||
{...props} | ||
/> | ||
</PopoverPrimitive.Portal> | ||
)); | ||
PopoverContent.displayName = PopoverPrimitive.Content.displayName; | ||
|
||
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
export const SENTRY_DSN = import.meta.env.REACT_APP_SENTRY_DSN; | ||
export const SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN; | ||
|
||
export const LAUNCH_DARKLY_CLIENT_SIDE_ID = import.meta.env | ||
.REACT_APP_LAUNCH_DARKLY_CLIENT_SIDE_ID; | ||
export const LAUNCH_DARKLY_CLIENT_SIDE_ID = import.meta.env.VITE_LAUNCH_DARKLY_CLIENT_SIDE_ID; | ||
|
||
export const HUBSPOT_PORTAL_ID = import.meta.env.REACT_APP_HUBSPOT_EMBED; | ||
export const HUBSPOT_PORTAL_ID = import.meta.env.VITE_HUBSPOT_EMBED; | ||
|
||
export const IS_EE_AUTH_ENABLED = | ||
import.meta.env.REACT_APP_IS_EE_AUTH_ENABLED === "true"; | ||
export const IS_EE_AUTH_ENABLED = import.meta.env.VITE_IS_EE_AUTH_ENABLED === 'true'; | ||
|
||
export const CLERK_PUBLISHABLE_KEY = | ||
import.meta.env.REACT_APP_CLERK_PUBLISHABLE_KEY || ""; | ||
export const CLERK_PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY || ''; | ||
|
||
export const APP_ID = import.meta.env.VITE_NOVU_APP_ID || ''; | ||
|
||
if (IS_EE_AUTH_ENABLED && !CLERK_PUBLISHABLE_KEY) { | ||
throw new Error("Missing Clerk Publishable Key"); | ||
throw new Error('Missing Clerk Publishable Key'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.