-
-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update env vars * update notif provider * add secret key for server sdk * create feed component * make provider client --------- Co-authored-by: Jeff Everhart <jeffeverhart383@gmail.com>
- Loading branch information
1 parent
d6505da
commit 196fbe6
Showing
4 changed files
with
41 additions
and
6 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
30 changes: 30 additions & 0 deletions
30
packages/design-system/components/knock-notification-feed.tsx
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,30 @@ | ||
'use client'; | ||
|
||
import { useState, useRef } from "react"; | ||
import { | ||
NotificationIconButton, | ||
NotificationFeedPopover, | ||
} from "@knocklabs/react"; | ||
|
||
// Required CSS import, unless you're overriding the styling | ||
import "@knocklabs/react/dist/index.css"; | ||
|
||
export const KnockNotificationFeed = () => { | ||
const [isVisible, setIsVisible] = useState(false); | ||
const notifButtonRef = useRef(null); | ||
|
||
return ( | ||
|
||
<> | ||
<NotificationIconButton | ||
ref={notifButtonRef} | ||
onClick={(e) => setIsVisible(!isVisible)} | ||
/> | ||
<NotificationFeedPopover | ||
buttonRef={notifButtonRef} | ||
isVisible={isVisible} | ||
onClose={() => setIsVisible(false)} | ||
/> | ||
</> | ||
); | ||
}; |
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,9 +1,9 @@ | ||
import { Knock } from '@knocklabs/node'; | ||
|
||
const knockApiKey = process.env.KNOCK_API_KEY; | ||
const knockApiKey = process.env.KNOCK_SECRET_API_KEY; | ||
|
||
if (!knockApiKey) { | ||
throw new Error('KNOCK_API_KEY is not set'); | ||
throw new Error('KNOCK_SECRET_API_KEY is not set'); | ||
} | ||
|
||
export const knock = new Knock(knockApiKey); |
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