Skip to content

Commit

Permalink
Merge pull request #58 from push-protocol/commented-analytics
Browse files Browse the repository at this point in the history
Commented analytics
  • Loading branch information
rohitmalhotra1420 authored Dec 24, 2024
2 parents f3c753a + d5ab752 commit d920b91
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
16 changes: 8 additions & 8 deletions components/Dashboard/LineChartSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ export default function LineChartSet() {
}
};

const fallbackNotificationsNumber = 139000000;
const fallbackNotificationsNumber = 140902329;

const fallbackSubscriberCount = 300000;
const fallbackSubscriberCount = 296625;
return (
<>
<Grid
{/* <Grid
item
display="flex"
width="100%"
Expand Down Expand Up @@ -223,15 +223,15 @@ export default function LineChartSet() {
handleTimeFilter={handleTimeFilter}
channelDataLoading={isChannelDataLoading}
/>
</Grid>
</Grid> */}
{/* <Box
sx={{ display: 'flex', width: '100%', justifyContent: 'flex-start' }}
>
<Text size="18px" marginTop={5}>
Notifications Statistics
</Text>
</Box> */}
<Grid
{/* <Grid
container
spacing={isMobile ? 0 : 3}
justifyContent="flex-start"
Expand Down Expand Up @@ -261,15 +261,15 @@ export default function LineChartSet() {
value={subscriberValues}
isLoading={isChannelDataLoading}
/>
<HorizontalLine />
{/* <HorizontalBarChart
<HorizontalLine /> */}
{/* <HorizontalBarChart
title="Notifications By Channel"
label="Notifications"
category={notificationCategories}
value={notificationValues}
isLoading={isChannelDataLoading}
/> */}
</Grid>
{/* </Grid> */}
{/* <Box
sx={{ display: 'flex', width: '100%', justifyContent: 'flex-start' }}
>
Expand Down
6 changes: 4 additions & 2 deletions components/Dashboard/OverViewSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export default function OverViewSet() {
const { isDarkMode } = getTheme();
const isMobile = useMediaQuery('(max-width:480px)');

const fallbackNotificationNumber = 139000000;
const fallbackNotificationNumber = 140902329;

const fallbackChatNumber = 58834;
const overViewData = [
{
image: !isDarkMode ? IntegrationLightIcon : IntegrationDarkIcon,
Expand All @@ -50,7 +52,7 @@ export default function OverViewSet() {
{
image: !isDarkMode ? ChatSentLightIcon : ChatSentDarkIcon,
title: 'Chats Sent',
value: chatSent,
value: chatSent || fallbackChatNumber.toLocaleString(),
size: 51,
},
// {
Expand Down
46 changes: 42 additions & 4 deletions components/Dashboard/Trending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ import { getSubscribers } from '../../utils/api';
import { CHAIN_LIST } from '../../utils/constants';
import { LeaderboardType } from '../../types/otherTypes';

const data = [
{
channel: '0xB88460Bb2696CAb9D66013A05dFF29a28330689D',
name: 'Push Protocol',
icon: 'https://backend.epns.io/apis/v1/channels/icon/0xB88460Bb2696CAb9D66013A05dFF29a28330689D',
subscriber: 91630,
},
{
channel: '0x90A48D5CF7343B08dA12E067680B4C6dbfE551Be',
name: 'ShapeShift',
icon: 'https://backend.epns.io/apis/v1/channels/icon/0x90A48D5CF7343B08dA12E067680B4C6dbfE551Be',
subscriber: 32473,
},
{
channel: '0xe56f1D3EDFFF1f25855aEF744caFE7991c224FFF',
name: 'CoinDesk',
icon: 'https://backend.epns.io/apis/v1/channels/icon/0xe56f1D3EDFFF1f25855aEF744caFE7991c224FFF',
subscriber: 10944,
},
{
channel: '0xf1A1542Ca902AE861B59bffE77D92E8CD76146f1',
name: 'HyperLiquid',
icon: 'https://backend.epns.io/apis/v1/channels/icon/0xf1A1542Ca902AE861B59bffE77D92E8CD76146f1',
subscriber: 53,
},
{
channel: '0x76bA9825A5F707F133124E4608F1F2Dd1EF4006a',
name: 'Cow Protocol',
icon: 'https://backend.epns.io/apis/v1/channels/icon/0x76bA9825A5F707F133124E4608F1F2Dd1EF4006a',
subscriber: 185,
},
];

export default function Trending() {
const [leaderBoard, setLeaderBoard] = React.useState<LeaderboardType[]>([]);
const [isLoading, setIsLoading] = React.useState<boolean>(false);
Expand Down Expand Up @@ -91,7 +124,9 @@ export default function Trending() {
});
}

const filteredChannels=trendingChannelData.filter(channel=> channel.subscriber>30);
const filteredChannels = trendingChannelData.filter(
(channel) => channel.subscriber > 30
);

const sortedChannels = filteredChannels?.sort(
(a, b) => parseFloat(b?.trend) - parseFloat(a?.trend)
Expand All @@ -104,9 +139,12 @@ export default function Trending() {
return (
<LeaderBoard
title="Trending"
data={leaderBoard}
isTrending={true}
isLoading={isLoading}
// data={leaderBoard}
data={data}
// isTrending={true} // not showing trends for now as we don't have that data in static response
isTrending={false}
//isLoading={isLoading}
isLoading={false}
/>
);
}

0 comments on commit d920b91

Please sign in to comment.