= ({ fields }) => {
return (
{fields.map(({ label, value }, i) => (
diff --git a/web/src/components/RegistriesDisplay/StatsAndFilters.tsx b/web/src/components/StatsAndFilters/index.tsx
similarity index 62%
rename from web/src/components/RegistriesDisplay/StatsAndFilters.tsx
rename to web/src/components/StatsAndFilters/index.tsx
index e840e4e..52fe1a1 100644
--- a/web/src/components/RegistriesDisplay/StatsAndFilters.tsx
+++ b/web/src/components/StatsAndFilters/index.tsx
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
-import Filters from "./Filters";
import Stats, { IStats } from "./Stats";
+import Filters, { IFilters } from "./Filters";
const Container = styled.div`
display: flex;
@@ -12,10 +12,10 @@ const Container = styled.div`
justify-content: space-between;
`;
-const StatsAndFilters: React.FC = ({ totalRegistries }) => (
+const StatsAndFilters: React.FC = ({ fields, isListFilter }) => (
-
-
+
+
);
diff --git a/web/src/pages/AllLists/RegistryDetails/Filters.tsx b/web/src/pages/AllLists/RegistryDetails/Filters.tsx
deleted file mode 100644
index 2c62fd6..0000000
--- a/web/src/pages/AllLists/RegistryDetails/Filters.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import React from "react";
-import styled from "styled-components";
-import { useNavigate, useParams } from "react-router-dom";
-import { DropdownSelect } from "@kleros/ui-components-library";
-import { decodeItemURIFilter, encodeItemURIFilter, useItemRootPath } from "utils/uri";
-
-const Container = styled.div`
- display: flex;
- justify-content: end;
- gap: 12px;
- width: fit-content;
-`;
-
-const Filters: React.FC = () => {
- const { order, filter } = useParams();
- const { ruled, period, ...filterObject } = decodeItemURIFilter(filter ?? "all");
- const navigate = useNavigate();
- const location = useItemRootPath();
-
- const handleStatusChange = (value: string | number) => {
- const parsedValue = JSON.parse(value as string);
- const encodedFilter = encodeItemURIFilter({ ...filterObject, ...parsedValue });
- navigate(`${location}/${order}/${encodedFilter}`);
- };
-
- const handleOrderChange = (value: string | number) => {
- const encodedFilter = encodeItemURIFilter({ ruled, period, ...filterObject });
- navigate(`${location}/${value}/${encodedFilter}`);
- };
-
- return (
-
-
-
- );
-};
-
-export default Filters;
diff --git a/web/src/pages/AllLists/RegistryDetails/List/index.tsx b/web/src/pages/AllLists/RegistryDetails/List/index.tsx
index 4df0808..2356ad3 100644
--- a/web/src/pages/AllLists/RegistryDetails/List/index.tsx
+++ b/web/src/pages/AllLists/RegistryDetails/List/index.tsx
@@ -1,6 +1,6 @@
import React from "react";
import Search from "../Search";
-import StatsAndFilters from "../StatsAndFilters";
+import StatsAndFilters from "~src/components/StatsAndFilters";
interface IList {}
@@ -8,7 +8,7 @@ const List: React.FC = ({}) => {
return (
<>
-
+
>
);
};
diff --git a/web/src/pages/AllLists/RegistryDetails/StatsAndFilters.tsx b/web/src/pages/AllLists/RegistryDetails/StatsAndFilters.tsx
deleted file mode 100644
index 1f5861a..0000000
--- a/web/src/pages/AllLists/RegistryDetails/StatsAndFilters.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from "react";
-import styled from "styled-components";
-import Filters from "./Filters";
-import Stats, { IStats } from "./Stats";
-
-const Container = styled.div`
- display: flex;
- flex-wrap: wrap;
- gap: 8px;
- margin-top: 11px;
- margin-bottom: 48px;
- justify-content: space-between;
-`;
-
-const StatsAndFilters: React.FC = ({ totalItems }) => (
-
-
-
-
-);
-
-export default StatsAndFilters;
diff --git a/web/src/pages/AllLists/RegistryDetails/index.tsx b/web/src/pages/AllLists/RegistryDetails/index.tsx
index fd53e9c..bc8f761 100644
--- a/web/src/pages/AllLists/RegistryDetails/index.tsx
+++ b/web/src/pages/AllLists/RegistryDetails/index.tsx
@@ -48,9 +48,9 @@ const RegistryDetails: React.FC = ({
- } />
+ } />
} />
- } />
+ } />
);
diff --git a/web/src/utils/uri.ts b/web/src/utils/uri.ts
index 1e010d1..51dc361 100644
--- a/web/src/utils/uri.ts
+++ b/web/src/utils/uri.ts
@@ -40,5 +40,5 @@ export const decodeItemURIFilter = (filter: string) => {
export const useItemRootPath = () => {
const location = useLocation();
- return location.pathname.split("/").slice(0, -2).join("/");
+ return location.pathname.split("/").slice(0, -3).join("/");
};
From 42e865cb2e11fd6ce419ee4ff941c79357fb5b76 Mon Sep 17 00:00:00 2001
From: Harman-singh-waraich
Date: Fri, 9 Feb 2024 17:47:38 +0530
Subject: [PATCH 3/9] feat(web): item-card
---
web/src/assets/svgs/icons/globe.svg | 10 ++
web/src/components/ItemCard/index.tsx | 139 ++++++++++++++++++
web/src/consts/index.ts | 38 +++++
.../AllLists/RegistryDetails/List/index.tsx | 15 ++
4 files changed, 202 insertions(+)
create mode 100644 web/src/assets/svgs/icons/globe.svg
create mode 100644 web/src/components/ItemCard/index.tsx
diff --git a/web/src/assets/svgs/icons/globe.svg b/web/src/assets/svgs/icons/globe.svg
new file mode 100644
index 0000000..5f565ba
--- /dev/null
+++ b/web/src/assets/svgs/icons/globe.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/web/src/components/ItemCard/index.tsx b/web/src/components/ItemCard/index.tsx
new file mode 100644
index 0000000..f7a5076
--- /dev/null
+++ b/web/src/components/ItemCard/index.tsx
@@ -0,0 +1,139 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { Button, Card } from "@kleros/ui-components-library";
+import { landscapeStyle } from "styles/landscapeStyle";
+import { items } from "consts/index";
+import { useNavigateAndScrollTop } from "hooks/useNavigateAndScrollTop";
+import { responsiveSize } from "styles/responsiveSize";
+import StatusBanner from "../RegistryCard/StatusBanner";
+import EtherscanIcon from "svgs/icons/etherscan.svg";
+import GlobeIcon from "svgs/icons/globe.svg";
+import { shortenAddress } from "utils/shortenAddress";
+import ArrowIcon from "svgs/icons/arrow.svg";
+
+const StyledListItem = styled(Card)`
+ display: flex;
+ flex-grow: 1;
+ width: 100%;
+ height: max-content;
+ ${landscapeStyle(
+ () => css`
+ height: 64px;
+ `
+ )}
+`;
+
+const Container = styled.div`
+ width: 100%;
+ height: max-content;
+ align-items: center;
+ display: grid;
+ grid-template-rows: repeat(4, min-content);
+ grid-template-columns: 1fr min-content;
+ column-gap: ${responsiveSize(12, 32, 900)};
+ row-gap: 8px;
+ padding: 16px;
+ h3,
+ .address,
+ .ens {
+ grid-column: span 2;
+ }
+ ${landscapeStyle(
+ () => css`
+ height: 64px;
+ justify-content: space-between;
+ grid-template-rows: 1fr;
+ grid-template-columns: ${responsiveSize(200, 250, 900)} ${responsiveSize(120, 150, 900)} 1fr ${responsiveSize(
+ 100,
+ 150,
+ 900
+ )} max-content;
+ padding: 0 32px;
+
+ h3 {
+ grid-column: 1;
+ }
+ .address {
+ grid-column: 2;
+ }
+ .ens {
+ grid-column: 3;
+ }
+ `
+ )}
+`;
+
+const StyledTitle = styled.h3`
+ font-weight: 400;
+ margin: 0px;
+`;
+
+const TruncatedTitle = ({ text, maxLength }) => {
+ const truncatedText = text.length <= maxLength ? text : text.slice(0, maxLength) + "…";
+ return {truncatedText};
+};
+
+const StyledButton = styled(Button)`
+ background-color: transparent;
+ padding: 0;
+ flex-direction: row-reverse;
+ gap: 8px;
+ .button-text {
+ color: ${({ theme }) => theme.primaryBlue};
+ font-weight: 400;
+ }
+
+ :focus,
+ :hover {
+ background-color: transparent;
+ }
+`;
+
+// these are temporary, items will have custom fields?
+const DisplayContainer = styled.div`
+ display: flex;
+ align-items: center;
+ gap: 8px;
+`;
+const StyledEtherscanIcon = styled(EtherscanIcon)`
+ display: flex;
+ height: 16px;
+ width: 16px;
+`;
+
+const StyledP = styled.p`
+ color: ${({ theme }) => theme.primaryBlue};
+ margin: 0;
+`;
+const StyledGlobeIcon = styled(GlobeIcon)`
+ display: flex;
+ height: 16px;
+ width: 16px;
+`;
+
+type Item = (typeof items)[number];
+interface IItemCard extends Item {}
+
+const ItemCard: React.FC = ({ id, title, address, website, status }) => {
+ const navigateAndScrollTop = useNavigateAndScrollTop();
+
+ return (
+ navigateAndScrollTop(`/lists/${id.toString()}/display/desc/all`)}>
+
+
+
+
+ {shortenAddress("0x922911F4f80a569a4425fa083456239838F7F003")}
+
+
+
+ metamask.io
+
+
+
+
+
+ );
+};
+
+export default ItemCard;
diff --git a/web/src/consts/index.ts b/web/src/consts/index.ts
index 54a5fe7..8dd3725 100644
--- a/web/src/consts/index.ts
+++ b/web/src/consts/index.ts
@@ -69,3 +69,41 @@ export const lists = [
logoURI: "https://ipfs.kleros.io//ipfs/QmZPeWnzHGKwvnckQE2QrdRJiUFqQXvQEZGFHdEAh7raHN/fno.png",
},
];
+
+export const items = [
+ {
+ id: 1,
+ title: "ENS Resolver",
+ address: "0x922911F4f80a569a4425fa083456239838F7F003",
+ website: "metamask.io",
+ status: Status.Removed,
+ },
+ {
+ id: 2,
+ title: "ENS Resolver",
+ address: "0x922911F4f80a569a4425fa083456239838F7F003",
+ website: "metamask.io",
+ status: Status.Removed,
+ },
+ {
+ id: 3,
+ title: "ENS Resolver",
+ address: "0x922911F4f80a569a4425fa083456239838F7F003",
+ website: "metamask.io",
+ status: Status.Removed,
+ },
+ {
+ id: 4,
+ title: "ENS Resolver",
+ address: "0x922911F4f80a569a4425fa083456239838F7F003",
+ website: "metamask.io",
+ status: Status.Removed,
+ },
+ {
+ id: 5,
+ title: "ENS Resolver",
+ address: "0x922911F4f80a569a4425fa083456239838F7F003",
+ website: "metamask.io",
+ status: Status.Removed,
+ },
+];
diff --git a/web/src/pages/AllLists/RegistryDetails/List/index.tsx b/web/src/pages/AllLists/RegistryDetails/List/index.tsx
index 2356ad3..dd5c61f 100644
--- a/web/src/pages/AllLists/RegistryDetails/List/index.tsx
+++ b/web/src/pages/AllLists/RegistryDetails/List/index.tsx
@@ -1,6 +1,16 @@
import React from "react";
import Search from "../Search";
import StatsAndFilters from "~src/components/StatsAndFilters";
+import styled from "styled-components";
+import { items } from "consts/index";
+import ItemCard from "components/ItemCard";
+
+const ListContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ gap: 8px;
+`;
interface IList {}
@@ -9,6 +19,11 @@ const List: React.FC = ({}) => {
<>
+
+ {items.map((item) => (
+
+ ))}
+
>
);
};
From 20324275e6157714facfc5266bab459db2e410de Mon Sep 17 00:00:00 2001
From: Harman-singh-waraich
Date: Fri, 9 Feb 2024 18:50:59 +0530
Subject: [PATCH 4/9] feat(web): history-timeline-ui
---
web/src/assets/svgs/icons/history.svg | 2 +-
.../RegistryDetails/History/Header.tsx | 36 ++++++++++++++
.../RegistryDetails/History/index.tsx | 49 ++++++++++++++++++-
.../pages/AllLists/RegistryDetails/Tabs.tsx | 4 +-
4 files changed, 86 insertions(+), 5 deletions(-)
create mode 100644 web/src/pages/AllLists/RegistryDetails/History/Header.tsx
diff --git a/web/src/assets/svgs/icons/history.svg b/web/src/assets/svgs/icons/history.svg
index 3f7ae3d..751a6a4 100644
--- a/web/src/assets/svgs/icons/history.svg
+++ b/web/src/assets/svgs/icons/history.svg
@@ -1,6 +1,6 @@