diff --git a/src/components/Cards/EventCards/EventCardWrapper.tsx b/src/components/Cards/EventCards/EventCardWrapper.tsx index 9e42e0d..ddc8ccd 100644 --- a/src/components/Cards/EventCards/EventCardWrapper.tsx +++ b/src/components/Cards/EventCards/EventCardWrapper.tsx @@ -15,24 +15,14 @@ interface Props { link?: string; linkState?: any; onHandleViewEvent?: any; - onHandleViewTx?: any; } -export const EventCardWrapper = ({ - event, - onHandleViewEvent, - onHandleViewTx, - link, -}: Props) => { +export const EventCardWrapper = ({ event, onHandleViewEvent, link }: Props) => { const { t } = useTranslation(); return ( onHandleViewTx(event.transaction) - : () => onHandleViewEvent(event) - } + onClick={() => onHandleViewEvent(event)} title={ event.transaction ? t(FF_TX_CATEGORY_MAP[event.transaction?.type]?.nicename) diff --git a/src/components/Cards/FireFlyCard.tsx b/src/components/Cards/FireFlyCard.tsx index 29154d3..7b54372 100644 --- a/src/components/Cards/FireFlyCard.tsx +++ b/src/components/Cards/FireFlyCard.tsx @@ -1,6 +1,6 @@ import { Box, Grid, Typography } from '@mui/material'; import { IFireFlyCard } from '../../interfaces'; -import { DEFAULT_BORDER_RADIUS } from '../../theme'; +import { altScrollbarStyle, DEFAULT_BORDER_RADIUS } from '../../theme'; import { FFArrowButton } from '../Buttons/FFArrowButton'; type Props = { @@ -19,6 +19,7 @@ export const FireFlyCard: React.FC = ({ cardData, size }) => { item md={12} lg={size === 'medium' ? 4 : 6} + sx={altScrollbarStyle} > JSX.Element = () => { item: ( { - setViewEvent(event); - setSlideSearchParam(event?.id); - }} - onHandleViewTx={(tx: ITransaction) => { - setViewTx(tx); - setSlideSearchParam(tx?.id); + if (event.transaction) { + setViewTx(event.transaction); + setSlideSearchParam(event?.tx ?? null); + } else { + setViewEvent(event); + setSlideSearchParam(event?.id); + } }} link={ - event.tx - ? FF_NAV_PATHS.activityTxDetailPath(selectedNamespace, event.tx) - : FF_NAV_PATHS.activityEventsPath(selectedNamespace, event.id) + event.transaction + ? FF_NAV_PATHS.activityTxDetailPath( + selectedNamespace, + event.transaction.id + ) + : FF_NAV_PATHS.activityTxDetailPathWithSlide( + selectedNamespace, + event.tx ?? '', + event.id + ) } {...{ event }} /> @@ -175,6 +183,7 @@ export const ActivityTimeline: () => JSX.Element = () => { direction="column" item pt={DEFAULT_PADDING} + sx={altScrollbarStyle} > JSX.Element = () => { recentEventTxs.map((event) => ( { - setViewTx(tx); - setSlideSearchParam(tx.id); + onHandleViewEvent={(event: IEvent) => { + setViewTx(event.transaction); + setSlideSearchParam(event?.tx ?? null); }} link={ event.tx diff --git a/src/theme.tsx b/src/theme.tsx index fe52805..ceeb5b3 100644 --- a/src/theme.tsx +++ b/src/theme.tsx @@ -87,3 +87,17 @@ export const themeOptions: ThemeOptions = { }, }, }; + +export const altScrollbarStyle = { + overflow: 'overlay', + scrollbarColor: '#1e242a', + '&::-webkit-scrollbar, & *::-webkit-scrollbar': { + cursor: 'pointer', + backgroundColor: '#1e242a', + }, + '&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb': { + borderRadius: 8, + backgroundColor: '#12171d', + border: '3px solid #1e242a', + }, +};