@@ -5,7 +5,6 @@ import { createEffect, createSignal, For, Match, Show, Switch } from "solid-js";
55import shuffle from "~/assets/icons/shuffle.svg" ;
66import {
77 ActivityDetailsModal ,
8- ActivityItem ,
98 Card ,
109 HackActivityType ,
1110 NiceP
@@ -44,11 +43,16 @@ export function UnifiedActivityItem(props: {
4443 return props . item . contacts [ 0 ] ;
4544 } ;
4645
46+ // TODO: figure out what other shit we should filter out
4747 const message = ( ) => {
48- if ( props . item . labels . length === 0 ) {
48+ const filtered = props . item . labels . filter (
49+ ( l ) => l !== "SWAP" && ! l . startsWith ( "LN Channel:" )
50+ ) ;
51+ if ( filtered . length === 0 ) {
4952 return undefined ;
5053 }
51- return props . item . labels [ 0 ] ;
54+
55+ return filtered [ 0 ] ;
5256 } ;
5357
5458 const shouldShowShuffle = ( ) => {
@@ -69,6 +73,13 @@ export function UnifiedActivityItem(props: {
6973 if ( props . item . labels . length > 0 && props . item . labels [ 0 ] === "SWAP" ) {
7074 return "swapped to" ;
7175 }
76+ if (
77+ props . item . labels . length > 0 &&
78+ props . item . labels [ 0 ] === "Swept Force Close"
79+ ) {
80+ return undefined ;
81+ }
82+
7283 return "sent" ;
7384 } ;
7485
@@ -104,29 +115,34 @@ export function UnifiedActivityItem(props: {
104115
105116 return (
106117 < >
107- < GenericItem
108- primaryAvatarUrl = {
109- shouldShowShuffle ( )
110- ? shuffle
111- : primaryContact ( ) ?. image_url || ""
112- }
113- primaryName = {
114- props . item . inbound
115- ? primaryContact ( ) ?. name || "Unknown"
116- : "You"
117- }
118- genericAvatar = { shouldShowGeneric ( ) }
119- verb = { verb ( ) }
120- message = { message ( ) }
121- secondaryName = { secondaryName ( ) }
122- amount = {
123- props . item . amount_sats
124- ? BigInt ( props . item . amount_sats || 0 )
125- : undefined
126- }
127- date = { timeAgo ( props . item . last_updated ) }
128- accent = { props . item . inbound ? "green" : undefined }
129- />
118+ < button class = "pt-3 first-of-type:pt-0" onClick = { ( ) => click ( ) } >
119+ < GenericItem
120+ primaryAvatarUrl = {
121+ shouldShowShuffle ( )
122+ ? shuffle
123+ : primaryContact ( ) ?. image_url || ""
124+ }
125+ primaryName = {
126+ props . item . inbound
127+ ? primaryContact ( ) ?. name || "Unknown"
128+ : "You"
129+ }
130+ genericAvatar = { shouldShowGeneric ( ) }
131+ verb = { verb ( ) }
132+ message = { message ( ) }
133+ secondaryName = { secondaryName ( ) }
134+ amount = {
135+ props . item . amount_sats
136+ ? BigInt ( props . item . amount_sats || 0 )
137+ : undefined
138+ }
139+ date = { timeAgo ( props . item . last_updated ) }
140+ accent = { props . item . inbound ? "green" : undefined }
141+ visibility = {
142+ props . item . kind === "Lightning" ? "private" : undefined
143+ }
144+ />
145+ </ button >
130146 { /* <pre>{JSON.stringify(props.item, null, 2)}</pre> */ }
131147 </ >
132148 // <ActivityItem
@@ -143,7 +159,7 @@ export function UnifiedActivityItem(props: {
143159 ) ;
144160}
145161
146- export function CombinedActivity ( props : { limit ?: number } ) {
162+ export function CombinedActivity ( ) {
147163 const [ state , _actions ] = useMegaStore ( ) ;
148164 const i18n = useI18n ( ) ;
149165
@@ -219,18 +235,6 @@ export function CombinedActivity(props: { limit?: number }) {
219235 < NiceP > Don't forget to back up your seed words!</ NiceP >
220236 </ Card >
221237 </ Match >
222- < Match when = { props . limit && activity ( ) . length > props . limit } >
223- < div class = "flex w-full flex-col divide-y divide-m-grey-800 overflow-x-clip" >
224- < For each = { activity ( ) . slice ( 0 , props . limit ) } >
225- { ( activityItem ) => (
226- < UnifiedActivityItem
227- item = { activityItem }
228- onClick = { openDetailsModal }
229- />
230- ) }
231- </ For >
232- </ div >
233- </ Match >
234238 < Match when = { activity ( ) . length >= 0 } >
235239 < div class = "flex w-full flex-col divide-y divide-m-grey-800 overflow-x-clip" >
236240 < For each = { activity ( ) } >
@@ -244,15 +248,6 @@ export function CombinedActivity(props: { limit?: number }) {
244248 </ div >
245249 </ Match >
246250 </ Switch >
247- { /* Only show on the home screen */ }
248- < Show when = { props . limit } >
249- < A
250- href = "/activity"
251- class = "self-center font-semibold text-m-red no-underline active:text-m-red/80"
252- >
253- { i18n . t ( "activity.view_all" ) }
254- </ A >
255- </ Show >
256251 </ >
257252 ) ;
258253}
0 commit comments