Skip to content

Commit 7dd5203

Browse files
Merge pull request #11 from globalfund/feat/filters-expandable-views
Feat/filters expandable views
2 parents 48af0b1 + 18f9b82 commit 7dd5203

10 files changed

Lines changed: 443 additions & 238 deletions

File tree

src/app/components/Charts/common/backbtn/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export function VizBackBtn(props: Props) {
4040
) {
4141
history.push(prevActiveStep.path);
4242
}
43+
} else {
44+
props.setVizLevel(props.vizLevel - 1);
4345
}
4446
}
4547

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import React from "react";
2+
import { useRecoilState } from "recoil";
3+
import { useHistory } from "react-router-dom";
4+
import RightIcon from "@material-ui/icons/ChevronRight";
5+
import { breadCrumbItems } from "app/state/recoil/atoms";
6+
7+
export default function BreadCrumbs() {
8+
const [breadCrumbList, setBreadCrumbList] = useRecoilState(breadCrumbItems);
9+
const history = useHistory();
10+
return (
11+
<div
12+
css={`
13+
display: flex;
14+
gap: 12px;
15+
align-items: center;
16+
justify-content: flex-start;
17+
padding-top: 12px;
18+
padding-bottom: 12px;
19+
font-family: "GothamNarrow-Book", "Helvetica Neue", sans-serif;
20+
overflow-x: scroll;
21+
&::-webkit-scrollbar {
22+
width: 0.1em;
23+
}
24+
&::-webkit-scrollbar-track {
25+
box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
26+
}
27+
&::-webkit-scrollbar-thumb {
28+
background-color: white;
29+
border-radius: 0px;
30+
border: 1px solid white;
31+
}
32+
width: 100vw;
33+
/* padding-left: 16px;
34+
padding-right: 16px; */
35+
@media (min-width: 1280px) {
36+
max-width: 1280px;
37+
}
38+
@media (min-width: 600px) {
39+
padding-left: 24px;
40+
padding-right: 24px;
41+
}
42+
`}
43+
>
44+
{breadCrumbList.map((item, index) => (
45+
<div
46+
css={`
47+
display: flex;
48+
gap: 12px;
49+
align-items: center;
50+
`}
51+
>
52+
<button
53+
css={`
54+
background: ${index === breadCrumbList.length - 1
55+
? "#495057"
56+
: "#868e96"};
57+
height: 32px;
58+
border-radius: 20px;
59+
font-size: 14px;
60+
font-weight: 700;
61+
color: #fff;
62+
text-align: center;
63+
border: none;
64+
outline: none;
65+
width: max-content;
66+
padding: 0 2rem;
67+
cursor: pointer;
68+
:hover,
69+
:active,
70+
:focus {
71+
background: #495057;
72+
}
73+
`}
74+
type="button"
75+
onClick={() => {
76+
history.push(item.path);
77+
setBreadCrumbList([...breadCrumbList.slice(0, index + 1)]);
78+
}}
79+
>
80+
<b>{item.name}</b>
81+
</button>
82+
{index === breadCrumbList.length - 1 ? null : (
83+
<div
84+
css={`
85+
color: #495057;
86+
display: flex;
87+
align-items: center;
88+
`}
89+
>
90+
<RightIcon color="inherit" />
91+
</div>
92+
)}
93+
</div>
94+
))}
95+
</div>
96+
);
97+
}

src/app/components/Mobile/BottomNavigation/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const useStyles = makeStyles({
2121
},
2222
});
2323

24-
export function createActionButtons() {
24+
export function useCreateActionButtons() {
2525
const cmsData = useCMSData({ returnData: true });
2626

2727
return [
@@ -47,7 +47,7 @@ export function MobileBottomNavigation() {
4747
const history = useHistory();
4848
const classes = useStyles();
4949
const [value, setValue] = React.useState(0);
50-
const actionButtons = createActionButtons();
50+
const actionButtons = useCreateActionButtons();
5151

5252
function getIsActive(path: string) {
5353
switch (path) {

0 commit comments

Comments
 (0)