import React from "react";
import { SirenInbox, SirenProvider } from "@sirenapp/react-inbox";
// Custom theme
const customTheme = {
light: {
colors: {
primaryColor: "#4f46e5",
textColor: "#1f2937",
neutralColor: "#9ca3af",
borderColor: "#e5e7eb",
highlightedCardColor: "#f3f4f6",
},
windowHeader: {
background: "#ffffff",
titleColor: "#111827",
},
},
dark: {
colors: {
primaryColor: "#6366f1",
textColor: "#f9fafb",
neutralColor: "#9ca3af",
borderColor: "#374151",
highlightedCardColor: "#1f2937",
},
windowHeader: {
background: "#111827",
titleColor: "#f9fafb",
},
},
};
// Custom styles
const customStyles = {
window: {
width: 400,
borderRadius: 12,
},
windowHeader: {
height: 60,
titleSize: 18,
titleFontWeight: "600",
},
customCard: {
padding: 16,
borderWidth: 1,
avatarSize: 40,
titleSize: 16,
subtitleSize: 14,
descriptionSize: 14,
dateSize: 12,
},
};
function App() {
const config = {
userToken: "your_user_token",
recipientId: "your_recipient_id",
};
return (
<SirenProvider config={config}>
<div className="app">
<h1>My Application</h1>
<NotificationCenter />
</div>
</SirenProvider>
);
}
function NotificationCenter() {
return (
<div className="notification-center">
<SirenInbox
theme={customTheme}
customStyles={customStyles}
darkMode={false}
headerProps={{
title: "Notifications",
hideHeader: false,
hideClearAll: false,
}}
cardProps={{
hideDelete: false,
hideAvatar: false,
disableAutoMarkAsRead: false,
onAvatarClick: (notification) => {
console.log("Avatar clicked:", notification);
},
}}
onCardClick={(notification) => {
console.log("Notification clicked:", notification);
}}
onError={(error) => {
console.error("Siren Error:", error);
}}
/>
</div>
);
}
export default App;