@ammarkhalidfarooq/dashboard-package 0.3.40 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +355 -97
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +356 -98
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Suspense, lazy, useState, useEffect } from 'react';
|
|
2
2
|
import { Box, Button, Menu, MenuItem, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, LinearProgress, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Avatar } from '@mui/material';
|
|
3
|
-
import { MoreHoriz, PaidOutlined, Adjust, FavoriteOutlined, SearchOutlined, PeopleAltOutlined, HighlightOff, NearMe, Email, IndeterminateCheckBoxOutlined, NotInterested, MoreVert, Check, InfoOutlined, Settings, TrendingUp,
|
|
3
|
+
import { MoreHoriz, PaidOutlined, Adjust, FavoriteOutlined, SearchOutlined, PeopleAltOutlined, HighlightOff, NearMe, Email, IndeterminateCheckBoxOutlined, NotInterested, MoreVert, Check, InfoOutlined, Settings, TrendingUp, PersonOutlined } from '@mui/icons-material';
|
|
4
4
|
import { createTheme, useTheme } from '@mui/material/styles';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import ReactApexChart from 'react-apexcharts';
|
|
@@ -796,19 +796,17 @@ var CardWrapper = function CardWrapper(_ref) {
|
|
|
796
796
|
children = _ref.children,
|
|
797
797
|
sx = _ref.sx;
|
|
798
798
|
return /*#__PURE__*/jsx(Card, {
|
|
799
|
-
sx: _objectSpread2({
|
|
800
|
-
width: "100%",
|
|
799
|
+
sx: _objectSpread2(_objectSpread2({
|
|
800
|
+
// width: "100%",
|
|
801
801
|
display: "flex",
|
|
802
802
|
flexDirection: "column",
|
|
803
803
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
804
804
|
borderRadius: 4,
|
|
805
|
-
border: "1px solid #f0f0f0"
|
|
805
|
+
border: "1px solid #f0f0f0"
|
|
806
|
+
}, sx), {}, {
|
|
806
807
|
height: "100%"
|
|
807
|
-
}
|
|
808
|
+
}),
|
|
808
809
|
children: /*#__PURE__*/jsxs(CardContent, {
|
|
809
|
-
sx: {
|
|
810
|
-
p: 3
|
|
811
|
-
},
|
|
812
810
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
813
811
|
variant: "subtitle2",
|
|
814
812
|
sx: {
|
|
@@ -2067,29 +2065,29 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
2067
2065
|
xs: 12,
|
|
2068
2066
|
md: 6,
|
|
2069
2067
|
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
2070
|
-
title: "
|
|
2071
|
-
subtitle: "Where
|
|
2068
|
+
title: "Source breakdown",
|
|
2069
|
+
subtitle: "Where organic visitors come from",
|
|
2072
2070
|
series: [40.8, 35.1, 14.2, 3.3],
|
|
2073
2071
|
labels: ["Meta Ads", "Google Ads", "TikTok", "Snapchat"],
|
|
2074
|
-
colors: ["#4267B2", "#4285F4", "#06510bff", "#
|
|
2072
|
+
colors: ["#4267B2", "#4285F4", "#06510bff", "#f2b61dff"],
|
|
2075
2073
|
centerLabel: "total spend",
|
|
2076
2074
|
centerValue: "$8.3K",
|
|
2077
2075
|
items: [{
|
|
2078
|
-
label: "
|
|
2076
|
+
label: "Google Search",
|
|
2079
2077
|
val: "40.8%",
|
|
2080
2078
|
color: "#4267B2"
|
|
2081
2079
|
}, {
|
|
2082
|
-
label: "
|
|
2080
|
+
label: "Direct",
|
|
2083
2081
|
val: "35.1%",
|
|
2084
2082
|
color: "#4285F4"
|
|
2085
2083
|
}, {
|
|
2086
|
-
label: "
|
|
2084
|
+
label: "Bing / Other",
|
|
2087
2085
|
val: "14.2%",
|
|
2088
2086
|
color: "#06510bff"
|
|
2089
2087
|
}, {
|
|
2090
|
-
label: "
|
|
2088
|
+
label: "Referalls",
|
|
2091
2089
|
val: "3.3%",
|
|
2092
|
-
color: "#
|
|
2090
|
+
color: "#f2b61dff"
|
|
2093
2091
|
}],
|
|
2094
2092
|
showBottomSummary: false,
|
|
2095
2093
|
sx: {
|
|
@@ -2106,19 +2104,217 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
2106
2104
|
xs: 12,
|
|
2107
2105
|
md: 6,
|
|
2108
2106
|
children: /*#__PURE__*/jsx(GeographyCard, {
|
|
2109
|
-
subtitle: "
|
|
2107
|
+
subtitle: "Top countries by organic traffic"
|
|
2110
2108
|
})
|
|
2111
2109
|
})]
|
|
2112
2110
|
})]
|
|
2113
2111
|
});
|
|
2114
2112
|
};
|
|
2115
2113
|
|
|
2114
|
+
var EmailTrendCard = function EmailTrendCard(_ref) {
|
|
2115
|
+
var title = _ref.title,
|
|
2116
|
+
subtitle = _ref.subtitle,
|
|
2117
|
+
value = _ref.value,
|
|
2118
|
+
trend = _ref.trend,
|
|
2119
|
+
series = _ref.series,
|
|
2120
|
+
colors = _ref.colors,
|
|
2121
|
+
_ref$yAxisMax = _ref.yAxisMax,
|
|
2122
|
+
yAxisMax = _ref$yAxisMax === void 0 ? 60 : _ref$yAxisMax,
|
|
2123
|
+
_ref$yAxisTickAmount = _ref.yAxisTickAmount,
|
|
2124
|
+
yAxisTickAmount = _ref$yAxisTickAmount === void 0 ? 3 : _ref$yAxisTickAmount,
|
|
2125
|
+
_ref$yAxisFormatter = _ref.yAxisFormatter,
|
|
2126
|
+
yAxisFormatter = _ref$yAxisFormatter === void 0 ? function (val) {
|
|
2127
|
+
return "".concat(val, "%");
|
|
2128
|
+
} : _ref$yAxisFormatter;
|
|
2129
|
+
var chartOptions = {
|
|
2130
|
+
chart: {
|
|
2131
|
+
type: "area",
|
|
2132
|
+
toolbar: {
|
|
2133
|
+
show: false
|
|
2134
|
+
},
|
|
2135
|
+
sparkline: {
|
|
2136
|
+
enabled: false
|
|
2137
|
+
},
|
|
2138
|
+
fontFamily: "Inter, sans-serif"
|
|
2139
|
+
},
|
|
2140
|
+
stroke: {
|
|
2141
|
+
curve: "smooth",
|
|
2142
|
+
width: 2,
|
|
2143
|
+
dashArray: series.map(function (s) {
|
|
2144
|
+
return s.dashed ? 5 : 0;
|
|
2145
|
+
})
|
|
2146
|
+
},
|
|
2147
|
+
fill: {
|
|
2148
|
+
type: "gradient",
|
|
2149
|
+
gradient: {
|
|
2150
|
+
shadeIntensity: 1,
|
|
2151
|
+
opacityFrom: 0.3,
|
|
2152
|
+
opacityTo: 0.8,
|
|
2153
|
+
stops: [0, 90, 100]
|
|
2154
|
+
}
|
|
2155
|
+
},
|
|
2156
|
+
colors: colors,
|
|
2157
|
+
xaxis: {
|
|
2158
|
+
categories: ["Apr 5", "Apr 12", "Apr 19", "Apr 26", "May 4"],
|
|
2159
|
+
labels: {
|
|
2160
|
+
show: true,
|
|
2161
|
+
style: {
|
|
2162
|
+
colors: 'rgba(0, 0, 0, 0.3)',
|
|
2163
|
+
fontSize: '10px'
|
|
2164
|
+
},
|
|
2165
|
+
offsetY: -5
|
|
2166
|
+
},
|
|
2167
|
+
axisBorder: {
|
|
2168
|
+
show: false
|
|
2169
|
+
},
|
|
2170
|
+
axisTicks: {
|
|
2171
|
+
show: false
|
|
2172
|
+
},
|
|
2173
|
+
position: 'bottom'
|
|
2174
|
+
},
|
|
2175
|
+
yaxis: {
|
|
2176
|
+
max: yAxisMax,
|
|
2177
|
+
tickAmount: yAxisTickAmount,
|
|
2178
|
+
labels: {
|
|
2179
|
+
show: true,
|
|
2180
|
+
style: {
|
|
2181
|
+
colors: 'rgba(0, 0, 0, 0.3)',
|
|
2182
|
+
fontSize: '10px'
|
|
2183
|
+
},
|
|
2184
|
+
formatter: yAxisFormatter
|
|
2185
|
+
}
|
|
2186
|
+
},
|
|
2187
|
+
grid: {
|
|
2188
|
+
show: true,
|
|
2189
|
+
borderColor: "rgba(0, 0, 0, 0.05)",
|
|
2190
|
+
strokeDashArray: 0,
|
|
2191
|
+
xaxis: {
|
|
2192
|
+
lines: {
|
|
2193
|
+
show: false
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
yaxis: {
|
|
2197
|
+
lines: {
|
|
2198
|
+
show: true
|
|
2199
|
+
}
|
|
2200
|
+
},
|
|
2201
|
+
padding: {
|
|
2202
|
+
left: 10,
|
|
2203
|
+
right: 10,
|
|
2204
|
+
bottom: 0
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2207
|
+
dataLabels: {
|
|
2208
|
+
enabled: false
|
|
2209
|
+
},
|
|
2210
|
+
legend: {
|
|
2211
|
+
show: series.length > 1,
|
|
2212
|
+
position: 'bottom',
|
|
2213
|
+
horizontalAlign: 'left',
|
|
2214
|
+
fontSize: '11px',
|
|
2215
|
+
fontFamily: 'Inter, sans-serif',
|
|
2216
|
+
offsetY: -5,
|
|
2217
|
+
markers: {
|
|
2218
|
+
width: 8,
|
|
2219
|
+
height: 8,
|
|
2220
|
+
radius: 12
|
|
2221
|
+
},
|
|
2222
|
+
itemMargin: {
|
|
2223
|
+
horizontal: 10,
|
|
2224
|
+
vertical: 0
|
|
2225
|
+
}
|
|
2226
|
+
},
|
|
2227
|
+
tooltip: {
|
|
2228
|
+
theme: 'light'
|
|
2229
|
+
}
|
|
2230
|
+
};
|
|
2231
|
+
return /*#__PURE__*/jsxs(Card, {
|
|
2232
|
+
sx: {
|
|
2233
|
+
p: 3,
|
|
2234
|
+
borderRadius: 4,
|
|
2235
|
+
border: "1px solid #f0f0f0",
|
|
2236
|
+
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
2237
|
+
bgcolor: "#fff",
|
|
2238
|
+
height: "100%",
|
|
2239
|
+
display: "flex",
|
|
2240
|
+
flexDirection: "column"
|
|
2241
|
+
},
|
|
2242
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
2243
|
+
sx: {
|
|
2244
|
+
mb: 1,
|
|
2245
|
+
textAlign: 'left'
|
|
2246
|
+
},
|
|
2247
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
2248
|
+
sx: {
|
|
2249
|
+
fontWeight: 700,
|
|
2250
|
+
fontSize: "18px",
|
|
2251
|
+
color: "#000"
|
|
2252
|
+
},
|
|
2253
|
+
children: title
|
|
2254
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
2255
|
+
sx: {
|
|
2256
|
+
fontSize: "12px",
|
|
2257
|
+
color: "rgba(0, 0, 0, 0.4)",
|
|
2258
|
+
fontWeight: 500
|
|
2259
|
+
},
|
|
2260
|
+
children: subtitle
|
|
2261
|
+
})]
|
|
2262
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
2263
|
+
sx: {
|
|
2264
|
+
display: "flex",
|
|
2265
|
+
alignItems: "center",
|
|
2266
|
+
gap: 1.5,
|
|
2267
|
+
mb: 1
|
|
2268
|
+
},
|
|
2269
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
2270
|
+
sx: {
|
|
2271
|
+
fontSize: "28px",
|
|
2272
|
+
fontWeight: 700,
|
|
2273
|
+
color: "#000"
|
|
2274
|
+
},
|
|
2275
|
+
children: value
|
|
2276
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
2277
|
+
sx: {
|
|
2278
|
+
bgcolor: "#ebfcf4",
|
|
2279
|
+
color: "#10b981",
|
|
2280
|
+
px: 1,
|
|
2281
|
+
py: 0.4,
|
|
2282
|
+
borderRadius: "100px",
|
|
2283
|
+
fontSize: "12px",
|
|
2284
|
+
fontWeight: 700,
|
|
2285
|
+
display: "flex",
|
|
2286
|
+
alignItems: "center",
|
|
2287
|
+
gap: 0.3
|
|
2288
|
+
},
|
|
2289
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
2290
|
+
style: {
|
|
2291
|
+
fontSize: '10px'
|
|
2292
|
+
},
|
|
2293
|
+
children: "\u25B2"
|
|
2294
|
+
}), " ", trend]
|
|
2295
|
+
})]
|
|
2296
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
2297
|
+
sx: {
|
|
2298
|
+
flexGrow: 1,
|
|
2299
|
+
height: 150,
|
|
2300
|
+
ml: -2,
|
|
2301
|
+
mr: -1
|
|
2302
|
+
},
|
|
2303
|
+
children: /*#__PURE__*/jsx(ReactApexChart, {
|
|
2304
|
+
options: chartOptions,
|
|
2305
|
+
series: series,
|
|
2306
|
+
type: "area",
|
|
2307
|
+
height: "100%"
|
|
2308
|
+
})
|
|
2309
|
+
})]
|
|
2310
|
+
});
|
|
2311
|
+
};
|
|
2312
|
+
|
|
2116
2313
|
var EmailSection = function EmailSection() {
|
|
2117
2314
|
var _useState = useState("Total raised"),
|
|
2118
2315
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2119
2316
|
activeMetric = _useState2[0],
|
|
2120
2317
|
setActiveMetric = _useState2[1];
|
|
2121
|
-
var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
2122
2318
|
var metricInfo = {
|
|
2123
2319
|
"Total raised": {
|
|
2124
2320
|
value: "$48,920",
|
|
@@ -2181,14 +2377,6 @@ var EmailSection = function EmailSection() {
|
|
|
2181
2377
|
data: [28, 32, 29, 34, 30, 30, 30.35]
|
|
2182
2378
|
}
|
|
2183
2379
|
};
|
|
2184
|
-
var selectedInfo = metricInfo[activeMetric];
|
|
2185
|
-
var mainChart = {
|
|
2186
|
-
label: activeMetric,
|
|
2187
|
-
value: selectedInfo.value,
|
|
2188
|
-
trend: selectedInfo.subValue,
|
|
2189
|
-
data: selectedInfo.data,
|
|
2190
|
-
categories: categories
|
|
2191
|
-
};
|
|
2192
2380
|
var renderCard = function renderCard(title) {
|
|
2193
2381
|
return /*#__PURE__*/jsx(DisplayCard, {
|
|
2194
2382
|
title: title,
|
|
@@ -2201,12 +2389,8 @@ var EmailSection = function EmailSection() {
|
|
|
2201
2389
|
isActive: activeMetric === title,
|
|
2202
2390
|
sx: {
|
|
2203
2391
|
flex: 1
|
|
2204
|
-
// border:
|
|
2205
|
-
// activeMetric === title
|
|
2206
|
-
// ? "2px solid rgb(99, 99, 230)"
|
|
2207
|
-
// : "2px solid #f0f0f0",
|
|
2208
2392
|
}
|
|
2209
|
-
});
|
|
2393
|
+
}, title);
|
|
2210
2394
|
};
|
|
2211
2395
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
2212
2396
|
children: [/*#__PURE__*/jsx(Box, {
|
|
@@ -2225,20 +2409,72 @@ var EmailSection = function EmailSection() {
|
|
|
2225
2409
|
flexWrap: "wrap"
|
|
2226
2410
|
},
|
|
2227
2411
|
children: ["Open rate", "Clicks", "Unique Clicks", "Bounce rate", "Revenue per Click"].map(renderCard)
|
|
2228
|
-
}), /*#__PURE__*/
|
|
2412
|
+
}), /*#__PURE__*/jsxs(Grid, {
|
|
2229
2413
|
container: true,
|
|
2230
2414
|
spacing: 3,
|
|
2231
2415
|
sx: {
|
|
2232
|
-
mt: 1
|
|
2416
|
+
mt: 1,
|
|
2417
|
+
mb: 8
|
|
2233
2418
|
},
|
|
2234
|
-
children: /*#__PURE__*/jsx(
|
|
2235
|
-
item:
|
|
2236
|
-
|
|
2237
|
-
md:
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2419
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
2420
|
+
item: true,
|
|
2421
|
+
xs: 12,
|
|
2422
|
+
md: 4,
|
|
2423
|
+
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
2424
|
+
title: "Open rate trend",
|
|
2425
|
+
subtitle: "Daily \xB7 30 days",
|
|
2426
|
+
value: "42.3%",
|
|
2427
|
+
trend: "2.1pp",
|
|
2428
|
+
series: [{
|
|
2429
|
+
name: 'Open Rate',
|
|
2430
|
+
data: [38, 42, 41, 43, 42.3]
|
|
2431
|
+
}],
|
|
2432
|
+
colors: ['rgb(99, 99, 230)'],
|
|
2433
|
+
yAxisMax: 53,
|
|
2434
|
+
yAxisTickAmount: 3
|
|
2435
|
+
})
|
|
2436
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
2437
|
+
item: true,
|
|
2438
|
+
xs: 12,
|
|
2439
|
+
md: 4,
|
|
2440
|
+
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
2441
|
+
title: "Clicks trend",
|
|
2442
|
+
subtitle: "Total + unique \xB7 30 days",
|
|
2443
|
+
value: "1,612",
|
|
2444
|
+
trend: "14%",
|
|
2445
|
+
series: [{
|
|
2446
|
+
name: 'Total clicks',
|
|
2447
|
+
data: [56, 112, 80, 150, 112]
|
|
2448
|
+
}, {
|
|
2449
|
+
name: 'Unique clicks',
|
|
2450
|
+
data: [30, 70, 45, 100, 75],
|
|
2451
|
+
dashed: true
|
|
2452
|
+
}],
|
|
2453
|
+
colors: ['#10B981', '#10B981'],
|
|
2454
|
+
yAxisMax: 168,
|
|
2455
|
+
yAxisTickAmount: 3,
|
|
2456
|
+
yAxisFormatter: function yAxisFormatter(val) {
|
|
2457
|
+
return val;
|
|
2458
|
+
}
|
|
2459
|
+
})
|
|
2460
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
2461
|
+
item: true,
|
|
2462
|
+
xs: 12,
|
|
2463
|
+
md: 4,
|
|
2464
|
+
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
2465
|
+
title: "Bounce rate trend",
|
|
2466
|
+
subtitle: "Daily \xB7 lower is better",
|
|
2467
|
+
value: "1.8%",
|
|
2468
|
+
trend: "0.3pp",
|
|
2469
|
+
series: [{
|
|
2470
|
+
name: 'Bounce Rate',
|
|
2471
|
+
data: [2.2, 1.9, 2.0, 1.7, 1.8]
|
|
2472
|
+
}],
|
|
2473
|
+
colors: ['#f2994a'],
|
|
2474
|
+
yAxisMax: 2.5,
|
|
2475
|
+
yAxisTickAmount: 3
|
|
2476
|
+
})
|
|
2477
|
+
})]
|
|
2242
2478
|
}), /*#__PURE__*/jsxs(Grid, {
|
|
2243
2479
|
container: true,
|
|
2244
2480
|
spacing: 3,
|
|
@@ -4252,24 +4488,43 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
|
|
|
4252
4488
|
},
|
|
4253
4489
|
children: row.val4
|
|
4254
4490
|
}), columns.length > 5 && /*#__PURE__*/jsx(Box, {
|
|
4255
|
-
children: row.type === "trend" ? /*#__PURE__*/
|
|
4491
|
+
children: row.type === "trend" ? /*#__PURE__*/jsx(Box, {
|
|
4256
4492
|
sx: {
|
|
4257
4493
|
display: "flex",
|
|
4258
4494
|
alignItems: "center",
|
|
4259
|
-
gap: 0.5
|
|
4260
|
-
color: row.trendType === "up" ? "#22C55E" : "#EF4444",
|
|
4261
|
-
fontSize: "12px",
|
|
4262
|
-
fontWeight: 600
|
|
4495
|
+
gap: 0.5
|
|
4263
4496
|
},
|
|
4264
|
-
children:
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
}
|
|
4272
|
-
|
|
4497
|
+
children: row.trendType === "up" ? /*#__PURE__*/jsxs(Fragment, {
|
|
4498
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4499
|
+
sx: {
|
|
4500
|
+
fontSize: "14px",
|
|
4501
|
+
color: "#22C55E"
|
|
4502
|
+
},
|
|
4503
|
+
children: "\u25B2"
|
|
4504
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
4505
|
+
sx: {
|
|
4506
|
+
fontSize: "12px",
|
|
4507
|
+
color: "#22C55E",
|
|
4508
|
+
fontWeight: 700
|
|
4509
|
+
},
|
|
4510
|
+
children: row.trendLabel
|
|
4511
|
+
})]
|
|
4512
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
4513
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
4514
|
+
sx: {
|
|
4515
|
+
fontSize: "14px",
|
|
4516
|
+
color: "#EF4444"
|
|
4517
|
+
},
|
|
4518
|
+
children: "\u25BC"
|
|
4519
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
4520
|
+
sx: {
|
|
4521
|
+
fontSize: "12px",
|
|
4522
|
+
color: "#EF4444",
|
|
4523
|
+
fontWeight: 700
|
|
4524
|
+
},
|
|
4525
|
+
children: row.trendLabel
|
|
4526
|
+
})]
|
|
4527
|
+
})
|
|
4273
4528
|
}) : /*#__PURE__*/jsx(Box, {
|
|
4274
4529
|
sx: {
|
|
4275
4530
|
display: "inline-block",
|
|
@@ -4910,8 +5165,27 @@ var MetricDonutCard = function MetricDonutCard(_ref) {
|
|
|
4910
5165
|
});
|
|
4911
5166
|
};
|
|
4912
5167
|
|
|
5168
|
+
function formatNumber(num) {
|
|
5169
|
+
if (num >= 1000000000) {
|
|
5170
|
+
return (num / 1000000000).toFixed(1).replace(/\.0$/, "") + "B";
|
|
5171
|
+
}
|
|
5172
|
+
if (num >= 1000000) {
|
|
5173
|
+
return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
|
|
5174
|
+
}
|
|
5175
|
+
if (num >= 1000) {
|
|
5176
|
+
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "K";
|
|
5177
|
+
}
|
|
5178
|
+
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
5179
|
+
}
|
|
5180
|
+
|
|
4913
5181
|
var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
4914
|
-
var
|
|
5182
|
+
var _donationTypeData$sum, _donationTypeData$sum2, _donationTypeData$sum3, _donationTypeData$sum4, _donationTypeData$sum5, _donationTypeData$sum6;
|
|
5183
|
+
var sx = _ref.sx,
|
|
5184
|
+
_ref$donationTypeData = _ref.donationTypeData,
|
|
5185
|
+
donationTypeData = _ref$donationTypeData === void 0 ? [] : _ref$donationTypeData;
|
|
5186
|
+
console.log("CHART DATA", donationTypeData);
|
|
5187
|
+
var recurringColor = (donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum = donationTypeData.summary) === null || _donationTypeData$sum === void 0 || (_donationTypeData$sum = _donationTypeData$sum.recurring) === null || _donationTypeData$sum === void 0 ? void 0 : _donationTypeData$sum.color) || "rgb(99, 99, 230)";
|
|
5188
|
+
var oneTimeColor = (donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum2 = donationTypeData.summary) === null || _donationTypeData$sum2 === void 0 || (_donationTypeData$sum2 = _donationTypeData$sum2.oneTime) === null || _donationTypeData$sum2 === void 0 ? void 0 : _donationTypeData$sum2.color) || "#10B981";
|
|
4915
5189
|
var chartOptions = {
|
|
4916
5190
|
chart: {
|
|
4917
5191
|
type: "bar",
|
|
@@ -4936,7 +5210,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4936
5210
|
dataLabels: {
|
|
4937
5211
|
enabled: true,
|
|
4938
5212
|
formatter: function formatter(val) {
|
|
4939
|
-
return "$".concat(val
|
|
5213
|
+
return "$".concat(formatNumber(val));
|
|
4940
5214
|
},
|
|
4941
5215
|
offsetY: -22,
|
|
4942
5216
|
style: {
|
|
@@ -4951,7 +5225,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4951
5225
|
colors: ["transparent"]
|
|
4952
5226
|
},
|
|
4953
5227
|
xaxis: {
|
|
4954
|
-
categories:
|
|
5228
|
+
categories: (donationTypeData === null || donationTypeData === void 0 ? void 0 : donationTypeData.categories) || [],
|
|
4955
5229
|
axisBorder: {
|
|
4956
5230
|
show: false
|
|
4957
5231
|
},
|
|
@@ -4971,7 +5245,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4971
5245
|
tickAmount: 3,
|
|
4972
5246
|
labels: {
|
|
4973
5247
|
formatter: function formatter(val) {
|
|
4974
|
-
return
|
|
5248
|
+
return "$".concat(formatNumber(val));
|
|
4975
5249
|
},
|
|
4976
5250
|
style: {
|
|
4977
5251
|
colors: "rgba(0, 0, 0, 0.4)",
|
|
@@ -4982,7 +5256,7 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
4982
5256
|
fill: {
|
|
4983
5257
|
opacity: 1
|
|
4984
5258
|
},
|
|
4985
|
-
colors: [
|
|
5259
|
+
colors: [recurringColor, oneTimeColor],
|
|
4986
5260
|
grid: {
|
|
4987
5261
|
borderColor: "#f1f1f1",
|
|
4988
5262
|
strokeDashArray: 4,
|
|
@@ -5002,18 +5276,12 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5002
5276
|
tooltip: {
|
|
5003
5277
|
y: {
|
|
5004
5278
|
formatter: function formatter(val) {
|
|
5005
|
-
return "$".concat(val
|
|
5279
|
+
return "$".concat(formatNumber(val));
|
|
5006
5280
|
}
|
|
5007
5281
|
}
|
|
5008
5282
|
}
|
|
5009
5283
|
};
|
|
5010
|
-
var series = [
|
|
5011
|
-
name: "Recurring",
|
|
5012
|
-
data: [9.2, 11.8, 13.4, 4.9]
|
|
5013
|
-
}, {
|
|
5014
|
-
name: "One-time",
|
|
5015
|
-
data: [32.4, 41.2, 46.8, 14.3]
|
|
5016
|
-
}];
|
|
5284
|
+
var series = (donationTypeData === null || donationTypeData === void 0 ? void 0 : donationTypeData.series) || [];
|
|
5017
5285
|
return /*#__PURE__*/jsxs(Card, {
|
|
5018
5286
|
sx: _objectSpread2({
|
|
5019
5287
|
bgcolor: "#fff",
|
|
@@ -5073,14 +5341,14 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5073
5341
|
color: "rgba(0, 0, 0, 0.5)",
|
|
5074
5342
|
fontWeight: 500
|
|
5075
5343
|
},
|
|
5076
|
-
children:
|
|
5077
|
-
}), /*#__PURE__*/
|
|
5344
|
+
children: donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum3 = donationTypeData.summary) === null || _donationTypeData$sum3 === void 0 || (_donationTypeData$sum3 = _donationTypeData$sum3.recurring) === null || _donationTypeData$sum3 === void 0 ? void 0 : _donationTypeData$sum3.label
|
|
5345
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
5078
5346
|
sx: {
|
|
5079
5347
|
fontSize: "13px",
|
|
5080
5348
|
fontWeight: 600,
|
|
5081
5349
|
color: "#000"
|
|
5082
5350
|
},
|
|
5083
|
-
children: "$
|
|
5351
|
+
children: ["$", formatNumber((donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum4 = donationTypeData.summary) === null || _donationTypeData$sum4 === void 0 || (_donationTypeData$sum4 = _donationTypeData$sum4.recurring) === null || _donationTypeData$sum4 === void 0 ? void 0 : _donationTypeData$sum4.total) || 0)]
|
|
5084
5352
|
})]
|
|
5085
5353
|
}), /*#__PURE__*/jsxs(Box, {
|
|
5086
5354
|
sx: {
|
|
@@ -5101,14 +5369,14 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
5101
5369
|
color: "rgba(0, 0, 0, 0.5)",
|
|
5102
5370
|
fontWeight: 500
|
|
5103
5371
|
},
|
|
5104
|
-
children:
|
|
5105
|
-
}), /*#__PURE__*/
|
|
5372
|
+
children: donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum5 = donationTypeData.summary) === null || _donationTypeData$sum5 === void 0 || (_donationTypeData$sum5 = _donationTypeData$sum5.oneTime) === null || _donationTypeData$sum5 === void 0 ? void 0 : _donationTypeData$sum5.label
|
|
5373
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
5106
5374
|
sx: {
|
|
5107
5375
|
fontSize: "13px",
|
|
5108
5376
|
fontWeight: 600,
|
|
5109
5377
|
color: "#000"
|
|
5110
5378
|
},
|
|
5111
|
-
children: "$
|
|
5379
|
+
children: ["$", formatNumber((donationTypeData === null || donationTypeData === void 0 || (_donationTypeData$sum6 = donationTypeData.summary) === null || _donationTypeData$sum6 === void 0 || (_donationTypeData$sum6 = _donationTypeData$sum6.oneTime) === null || _donationTypeData$sum6 === void 0 ? void 0 : _donationTypeData$sum6.total) || 0)]
|
|
5112
5380
|
})]
|
|
5113
5381
|
})]
|
|
5114
5382
|
})]
|
|
@@ -5242,7 +5510,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5242
5510
|
return /*#__PURE__*/jsxs(Card, {
|
|
5243
5511
|
sx: _objectSpread2({
|
|
5244
5512
|
bgcolor: "#fff",
|
|
5245
|
-
borderRadius:
|
|
5513
|
+
borderRadius: 4,
|
|
5246
5514
|
border: "1px solid #f0f0f0",
|
|
5247
5515
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
5248
5516
|
p: 3,
|
|
@@ -5401,7 +5669,8 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5401
5669
|
}), /*#__PURE__*/jsx(Box, {
|
|
5402
5670
|
sx: {
|
|
5403
5671
|
height: 160,
|
|
5404
|
-
width: "100%"
|
|
5672
|
+
width: "100%",
|
|
5673
|
+
flexShrink: 0
|
|
5405
5674
|
},
|
|
5406
5675
|
children: /*#__PURE__*/jsx(ReactApexChart, {
|
|
5407
5676
|
options: chartOptions,
|
|
@@ -5413,19 +5682,6 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
5413
5682
|
});
|
|
5414
5683
|
};
|
|
5415
5684
|
|
|
5416
|
-
function formatNumber(num) {
|
|
5417
|
-
if (num >= 1000000000) {
|
|
5418
|
-
return (num / 1000000000).toFixed(1).replace(/\.0$/, "") + "B";
|
|
5419
|
-
}
|
|
5420
|
-
if (num >= 1000000) {
|
|
5421
|
-
return (num / 1000000).toFixed(1).replace(/\.0$/, "") + "M";
|
|
5422
|
-
}
|
|
5423
|
-
if (num >= 1000) {
|
|
5424
|
-
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "K";
|
|
5425
|
-
}
|
|
5426
|
-
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
5427
|
-
}
|
|
5428
|
-
|
|
5429
5685
|
var OverallSection = function OverallSection(_ref) {
|
|
5430
5686
|
var _apiData$totalRaisedP, _apiData$netRaisedCar, _apiData$netRaisedPre, _apiData$averageDonat, _apiData$averageDonat2, _apiData$roasCard, _apiData$roasCardPrev;
|
|
5431
5687
|
var _ref$apiData = _ref.apiData,
|
|
@@ -5439,6 +5695,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5439
5695
|
_useState2 = _slicedToArray(_useState, 2),
|
|
5440
5696
|
activeMetric = _useState2[0],
|
|
5441
5697
|
setActiveMetric = _useState2[1];
|
|
5698
|
+
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationType) || [];
|
|
5442
5699
|
var allCharts = [].concat(_toConsumableArray(primaryCharts), _toConsumableArray(secondaryCharts), _toConsumableArray(tertiaryCharts), _toConsumableArray(quaternaryCharts));
|
|
5443
5700
|
var getExtendedCharts = function getExtendedCharts() {
|
|
5444
5701
|
var charts = _toConsumableArray(allCharts);
|
|
@@ -5477,7 +5734,6 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5477
5734
|
}
|
|
5478
5735
|
return charts;
|
|
5479
5736
|
};
|
|
5480
|
-
console.log("API DATA", apiData);
|
|
5481
5737
|
var metricInfo = {
|
|
5482
5738
|
"Total Raised": {
|
|
5483
5739
|
value: "$".concat(formatNumber(apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedCard)) || "$240.9K",
|
|
@@ -5820,6 +6076,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5820
6076
|
value: selectedInfo.value,
|
|
5821
6077
|
trend: selectedInfo.subValue
|
|
5822
6078
|
});
|
|
6079
|
+
console.log("Donation Type Data", donationTypeData);
|
|
5823
6080
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
5824
6081
|
children: [/*#__PURE__*/jsx(Box, {
|
|
5825
6082
|
sx: {
|
|
@@ -5908,7 +6165,8 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5908
6165
|
container: true,
|
|
5909
6166
|
spacing: 3,
|
|
5910
6167
|
sx: {
|
|
5911
|
-
mt: 2
|
|
6168
|
+
mt: 2,
|
|
6169
|
+
alignItems: "stretch"
|
|
5912
6170
|
},
|
|
5913
6171
|
children: [/*#__PURE__*/jsx(Grid, {
|
|
5914
6172
|
item: true,
|
|
@@ -5916,8 +6174,9 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5916
6174
|
md: 3,
|
|
5917
6175
|
children: /*#__PURE__*/jsx(DonationTypeBarChart, {
|
|
5918
6176
|
sx: {
|
|
5919
|
-
|
|
5920
|
-
}
|
|
6177
|
+
height: 330
|
|
6178
|
+
},
|
|
6179
|
+
donationTypeData: donationTypeData
|
|
5921
6180
|
})
|
|
5922
6181
|
}), /*#__PURE__*/jsx(Grid, {
|
|
5923
6182
|
item: true,
|
|
@@ -5925,7 +6184,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5925
6184
|
md: 3,
|
|
5926
6185
|
children: /*#__PURE__*/jsx(PaidDonorGeographyCard, {
|
|
5927
6186
|
sx: {
|
|
5928
|
-
|
|
6187
|
+
height: 330
|
|
5929
6188
|
}
|
|
5930
6189
|
})
|
|
5931
6190
|
}), /*#__PURE__*/jsx(Grid, {
|
|
@@ -5934,7 +6193,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5934
6193
|
md: 3,
|
|
5935
6194
|
children: /*#__PURE__*/jsx(RefundsChargebacksCard, {
|
|
5936
6195
|
sx: {
|
|
5937
|
-
|
|
6196
|
+
height: 330
|
|
5938
6197
|
}
|
|
5939
6198
|
})
|
|
5940
6199
|
}), /*#__PURE__*/jsx(Grid, {
|
|
@@ -5943,7 +6202,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5943
6202
|
md: 3,
|
|
5944
6203
|
children: /*#__PURE__*/jsx(TrafficSourceCard, {
|
|
5945
6204
|
sx: {
|
|
5946
|
-
|
|
6205
|
+
height: 330
|
|
5947
6206
|
}
|
|
5948
6207
|
})
|
|
5949
6208
|
})]
|
|
@@ -5951,8 +6210,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5951
6210
|
container: true,
|
|
5952
6211
|
spacing: 3,
|
|
5953
6212
|
sx: {
|
|
5954
|
-
mt: 1
|
|
5955
|
-
mb: 2
|
|
6213
|
+
mt: 1
|
|
5956
6214
|
},
|
|
5957
6215
|
children: [/*#__PURE__*/jsx(Grid, {
|
|
5958
6216
|
item: true,
|