Skip to content

Commit ca1a431

Browse files
committed
fix: implement onClose functionality to manage news visibility
1 parent 536f11f commit ca1a431

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

apps/showcase/components/layout/sections/AppNews.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ const announcement = News as Announcement;
1818
export default function AppNews() {
1919
const app = useApp();
2020

21-
const onClose = () => {};
21+
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+
};
2231

2332
React.useEffect(() => {
2433
const itemString = app.storageKey ? localStorage.getItem(app.storageKey) : null;

0 commit comments

Comments
 (0)