diff --git a/components/notifications.js b/components/notifications.js
index e05f2014..b8f152a1 100644
--- a/components/notifications.js
+++ b/components/notifications.js
@@ -18,133 +18,54 @@ import BaldIcon from '../svgs/bald.svg'
import { RootProvider } from './root'
import { useMe } from './me'
-// TODO: oh man, this is a mess ... each notification type should just be a component ...
function Notification ({ n }) {
- const router = useRouter()
+ switch (n.__typename) {
+ case 'Earn': return
+ case 'Invitification': return
+ case 'InvoicePaid': return
+ case 'Referral': return
+ case 'Streak': return
+ case 'Votification': return
+ case 'Mention': return
+ case 'JobChanged': return
+ case 'Reply': return
+ }
+ console.error("__typename not supported:", n.__typename)
+ return null
+}
+
+function NotificationLayout({ children, onClick }) {
return (
-
- you stacked {n.earnedSats} sats in rewards{timeSince(new Date(n.sortTime))}
-
- {n.sources &&
-
- {n.sources.posts > 0 && {n.sources.posts} sats for top posts}
- {n.sources.comments > 0 && {n.sources.posts > 0 && ' \\ '}{n.sources.comments} sats for top comments}
- {n.sources.tips > 0 && {(n.sources.comments > 0 || n.sources.posts > 0) && ' \\ '}{n.sources.tips} sats for tipping top content early}
-
}
-
- SN distributes the sats it earns back to its best users daily. These sats come from jobs, boosts, posting fees, and donations. You can see the daily rewards pool and make a donation here.
-
-
-
- )
- : n.__typename === 'Referral'
- ? (
- <>
-
- someone joined via one of your referral links
- {timeSince(new Date(n.sortTime))}
-
- >
- )
- : n.__typename === 'InvoicePaid'
- ? (
-
- {n.earnedSats} sats were deposited in your account
- {timeSince(new Date(n.sortTime))}
-
)
- : n.__typename === 'Streak'
- ?
- : (
- <>
- {n.__typename === 'Votification' &&
-
- your {n.item.title ? 'post' : 'reply'} {n.item.fwdUser ? 'forwarded' : 'stacked'} {n.earnedSats} sats{n.item.fwdUser && ` to @${n.item.fwdUser.name}`}
- }
- {n.__typename === 'Mention' &&
-
- you were mentioned in
- }
- {n.__typename === 'JobChanged' &&
-
- {n.item.status === 'ACTIVE'
- ? 'your job is active again'
- : (n.item.status === 'NOSATS'
- ? 'your job promotion ran out of sats'
- : 'your job has been stopped')}
- }
-
+ you stacked {n.earnedSats} sats in rewards{timeSince(new Date(n.sortTime))}
+
+ {n.sources &&
+
+ {n.sources.posts > 0 && {n.sources.posts} sats for top posts}
+ {n.sources.comments > 0 && {n.sources.posts > 0 && ' \\ '}{n.sources.comments} sats for top comments}
+ {n.sources.tips > 0 && {(n.sources.comments > 0 || n.sources.posts > 0) && ' \\ '}{n.sources.tips} sats for tipping top content early}
+
}
+
+ SN distributes the sats it earns back to its best users daily. These sats come from jobs, boosts, posting fees, and donations. You can see the daily rewards pool and make a donation here.
+
+
+
+
+ );
+}
+
+function Invitification({ n }) {
+ const router = useRouter()
+ return (
+ router.push('/invites')}>
+
+ your invite has been redeemed by {n.invite.invitees.length} users
+
+