Skip to content

Commit 2032427

Browse files
committed
feat(web): history-timeline-ui
1 parent 42e865c commit 2032427

File tree

4 files changed

+86
-5
lines changed

4 files changed

+86
-5
lines changed

web/src/assets/svgs/icons/history.svg

Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
import HistoryIcon from "assets/svgs/icons/history.svg";
4+
5+
const HeaderContainer = styled.div`
6+
display: flex;
7+
gap: 8px;
8+
`;
9+
10+
const StyledP = styled.p`
11+
margin: 0;
12+
color: ${({ theme }) => theme.primaryText};
13+
`;
14+
15+
const SVGContainer = styled.div`
16+
display: flex;
17+
align-items: center;
18+
justify-content: center;
19+
svg {
20+
fill: ${({ theme }) => theme.primaryText};
21+
height: 16px;
22+
width: 17px;
23+
}
24+
`;
25+
const Header: React.FC = () => {
26+
return (
27+
<HeaderContainer>
28+
<SVGContainer>
29+
<HistoryIcon />
30+
</SVGContainer>
31+
<StyledP>History</StyledP>
32+
</HeaderContainer>
33+
);
34+
};
35+
36+
export default Header;
Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,53 @@
1+
import { Card, CustomTimeline } from "@kleros/ui-components-library";
12
import React from "react";
3+
import styled, { useTheme } from "styled-components";
4+
import Header from "./Header";
5+
import ClosedIcon from "assets/svgs/icons/check-circle-outline.svg";
26

7+
const Container = styled(Card)`
8+
display: flex;
9+
width: 100%;
10+
height: auto;
11+
flex-direction: column;
12+
align-items: start;
13+
padding: 22px 32px;
14+
gap: 54px;
15+
`;
16+
17+
const StyledTimeline = styled(CustomTimeline)`
18+
width: 100%;
19+
margin-bottom: 30px;
20+
`;
321
interface IHistory {}
422

5-
const History: React.FC<IHistory> = ({}) => {
6-
return <div>History</div>;
23+
const History: React.FC<IHistory> = () => {
24+
const theme = useTheme();
25+
const items = [
26+
{
27+
title: "Item Submitted",
28+
variant: theme.primaryBlue,
29+
subtitle: "April 06, 2022",
30+
rightSided: true,
31+
},
32+
{
33+
title: "Item Challenged",
34+
party: "- Case #1369 by Alice.eth",
35+
variant: theme.secondaryPurple,
36+
subtitle: "April 07, 2022",
37+
rightSided: true,
38+
},
39+
{
40+
title: "Item Submitted",
41+
subtitle: "April 06, 2022",
42+
rightSided: true,
43+
Icon: ClosedIcon,
44+
},
45+
];
46+
return (
47+
<Container>
48+
<Header />
49+
<StyledTimeline {...{ items }} />
50+
</Container>
51+
);
752
};
853
export default History;

web/src/pages/AllLists/RegistryDetails/Tabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ const Tabs: React.FC = () => {
3636
const navigate = useNavigate();
3737
const { id } = useParams();
3838
const location = useLocation();
39-
const currentPathName = location.pathname.split("/").at(-1);
39+
const currentPathName = location.pathname.split("/").at(3);
4040

41-
const findTabIndex = (pathName) => TABS.findIndex(({ path }) => path === pathName);
41+
const findTabIndex = (pathName) => TABS.findIndex(({ path }) => pathName.startsWith(path));
4242
const [currentTab, setCurrentTab] = useState(findTabIndex(currentPathName));
4343

4444
useEffect(() => {

0 commit comments

Comments
 (0)