Skip to content

Commit

Permalink
feat: MET-2039 add new option
Browse files Browse the repository at this point in the history
  • Loading branch information
Sotatek-TaiTruong committed May 3, 2024
1 parent 283a8ea commit 1639589
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions src/components/Dreps/DrepFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface PoolResponse {

const defaultParams = { page: 0, size: 50, sort: "" };

const DrepFilter: React.FC = () => {
const DrepFilter: React.FC<{ loading: boolean }> = ({ loading }) => {
const theme = useTheme();
const { t } = useTranslation();
const { search } = useLocation();
Expand All @@ -65,8 +65,8 @@ const DrepFilter: React.FC = () => {
const handleChange = (panel: string) => (event: React.SyntheticEvent, newExpanded: boolean) => {
setExpanded(newExpanded ? panel : false);
};
const fetchDataRange = useFetch<PoolResponse>(API.DREP_RANGE_VALUES);
const dataRange = fetchDataRange.data;
const { data: dataRange, loading: loadingRange } = useFetch<PoolResponse>(API.DREP_RANGE_VALUES);

const initParams = {
page: 0,
size: 50,
Expand Down Expand Up @@ -301,6 +301,7 @@ const DrepFilter: React.FC = () => {
<FilterWrapper>
<Box
component={Button}
disabled={loadingRange || loading}
variant="text"
px={2}
textTransform={"capitalize"}
Expand Down Expand Up @@ -655,6 +656,17 @@ const DrepFilter: React.FC = () => {
value={filterParams.drepStatus}
onChange={({ target: { value } }) => setFilterParams({ ...filterParams, drepStatus: value })}
>
<FormControlLabel
value={"" || undefined}
control={
<Radio
sx={{
color: theme.palette.secondary.light
}}
/>
}
label={<Box lineHeight={1}>{t("smartContract.any")}</Box>}
/>
<FormControlLabel
value="ACTIVE"
control={
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dreps/DrepsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const DrepsList: React.FC = () => {
}}
>
<Box display="flex" gap="10px">
<DrepFilter />
<DrepFilter loading={fetchData.loading} />
</Box>
</TopSearchContainer>
<Table
Expand Down

0 comments on commit 1639589

Please sign in to comment.