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

Analytics layout #262

Merged
merged 3 commits into from
May 10, 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
24 changes: 4 additions & 20 deletions portal/src/components/analytics/AnalyticsAddressesList.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
import { useQuery } from "react-query";
import { Flex, Spinner } from "@chakra-ui/react";

import queryCacheProps from "../../hooks/hookCommon";
import { SubscriptionsService } from "../../services";
import { Spinner } from "@chakra-ui/react";

import Item from "./AnalyticsAddressesListItem";
import useAnalytics from "../../contexts/AnalyticsContext";
import styles from "./AnalyticsView.module.css";

const AnalyticsAddressesList = () => {
const { addresses } = useAnalytics();

// const getTypes = async () => {
// const response = await SubscriptionsService.getTypes();
// return response.data;
// };

// const types = useQuery(["subscription_types"], getTypes, {
// ...queryCacheProps,
// onSuccess(data: any) {
// console.log(data);
// setTypes(data.subscription_types);
// },
// });

if (addresses.isLoading) {
return <Spinner />;
}

return (
<>
{addresses.data && (
<Flex flexDirection="column" overflowY="auto" gap="5px">
<div className={styles.addressesList}>
{addresses.data.map((address: any, idx: number) => (
<Item
key={address.id}
Expand All @@ -39,7 +23,7 @@ const AnalyticsAddressesList = () => {
// types={types.data?.subscription_types ?? undefined}
/>
))}
</Flex>
</div>
)}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ const AnalyticsNewAddressView = () => {
console.log(e);
if (!type) {
setType("regularAccount");
setChainName("");
}
setChainName("");
});
},
{
Expand Down
8 changes: 8 additions & 0 deletions portal/src/components/analytics/AnalyticsView.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.addressesList {
display: flex;
flex-direction: column;
gap: 5px;
overflow-y: auto;
scrollbar-width: none;
-ms-overflow-style: none;
}
4 changes: 2 additions & 2 deletions portal/src/components/analytics/AnalyticsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const AnalyticsView = () => {
<Flex
gap="30px"
py="30px"
px={{ base: 0, xl: "5%", "2xl": "10%" }}
px={"7%"}
minH={isTallScreen ? "calc(100vh - 320px)" : "760px"}
minW="90%"
w={"100%"}
position="relative"
alignSelf="stretch"
>
Expand Down
Loading