Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented analytics #58

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
/>
);
}
Loading