We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aa24f7c + ca1a431 commit 091296cCopy full SHA for 091296c
1 file changed
apps/showcase/components/layout/sections/AppNews.tsx
@@ -18,7 +18,16 @@ const announcement = News as Announcement;
18
export default function AppNews() {
19
const app = useApp();
20
21
- const onClose = () => {};
+ const onClose = () => {
22
+ app.setNewsActive(false);
23
+ const item = {
24
+ hiddenNews: announcement.id
25
+ };
26
+
27
+ if (!app.storageKey) return;
28
29
+ localStorage.setItem(app.storageKey, JSON.stringify(item));
30
31
32
React.useEffect(() => {
33
const itemString = app.storageKey ? localStorage.getItem(app.storageKey) : null;
0 commit comments