Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ changes.
- Fix crashing backend on unhandled missing proposal from vote [Issue 2920](https://github.com/IntersectMBO/govtool/issues/2920)
- Remove abstain votes (not auto abstain) from total DRep stake
- Fix counting committee members [Issue 2948](https://github.com/IntersectMBO/govtool/issues/2948)
- Fix refetching DRep list on every enter [Issue 2994](https://github.com/IntersectMBO/govtool/issues/2994)

### Changed

Expand Down
116 changes: 57 additions & 59 deletions govtool/frontend/src/components/molecules/DataActionsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,64 +57,62 @@ export const DataActionsBar: FC<DataActionsBarProps> = ({ ...props }) => {
} = theme;

return (
<>
<Box alignItems="center" display="flex" justifyContent="space-between">
<InputBase
inputProps={{ "data-testid": "search-input" }}
onChange={(e) => setSearchText(e.target.value)}
placeholder="Search..."
value={searchText}
startAdornment={
<Search
style={{
color: "#99ADDE",
height: 16,
marginRight: 4,
width: 16,
}}
/>
}
sx={{
bgcolor: "white",
border: 1,
borderColor: "secondaryBlue",
borderRadius: 50,
boxShadow: `2px 2px 20px 0px ${boxShadow2}`,
fontSize: 11,
fontWeight: 500,
height: 48,
padding: "16px 24px",
maxWidth: 500,
}}
/>
<OrderActionsChip
chosenFiltersLength={chosenFiltersLength}
filtersOpen={filtersOpen}
isFiltering={isFiltering}
setFiltersOpen={setFiltersOpen}
chosenSorting={chosenSorting}
setSortOpen={setSortOpen}
sortOpen={sortOpen}
>
{filtersOpen && (
<DataActionsFilters
chosenFilters={chosenFilters}
setChosenFilters={setChosenFilters}
closeFilters={closeFilters}
options={filterOptions}
title={filtersTitle}
/>
)}
{sortOpen && (
<DataActionsSorting
chosenSorting={chosenSorting}
setChosenSorting={setChosenSorting}
closeSorts={closeSorts}
options={sortOptions}
/>
)}
</OrderActionsChip>
</Box>
</>
<Box alignItems="center" display="flex" justifyContent="space-between">
<InputBase
inputProps={{ "data-testid": "search-input" }}
onChange={(e) => setSearchText(e.target.value)}
placeholder="Search..."
value={searchText}
startAdornment={
<Search
style={{
color: "#99ADDE",
height: 16,
marginRight: 4,
width: 16,
}}
/>
}
sx={{
bgcolor: "white",
border: 1,
borderColor: "secondaryBlue",
borderRadius: 50,
boxShadow: `2px 2px 20px 0px ${boxShadow2}`,
fontSize: 11,
fontWeight: 500,
height: 48,
padding: "16px 24px",
maxWidth: 500,
}}
/>
<OrderActionsChip
chosenFiltersLength={chosenFiltersLength}
filtersOpen={filtersOpen}
isFiltering={isFiltering}
setFiltersOpen={setFiltersOpen}
chosenSorting={chosenSorting}
setSortOpen={setSortOpen}
sortOpen={sortOpen}
>
{filtersOpen && (
<DataActionsFilters
chosenFilters={chosenFilters}
setChosenFilters={setChosenFilters}
closeFilters={closeFilters}
options={filterOptions}
title={filtersTitle}
/>
)}
{sortOpen && (
<DataActionsSorting
chosenSorting={chosenSorting}
setChosenSorting={setChosenSorting}
closeSorts={closeSorts}
options={sortOptions}
/>
)}
</OrderActionsChip>
</Box>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const DashboardGovernanceActions = () => {

const { state } = useLocation();
const [content, setContent] = useState<number>(
state && state.isVotedListOnLoad ? 1 : 0,
state?.isVotedListOnLoad ? 1 : 0,
);

const handleChange = (_event: React.SyntheticEvent, newValue: number) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ type StyledTabProps = {
isMobile: boolean;
};

const StyledTab = styled((props: StyledTabProps) => (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const StyledTab = styled(({ isMobile, ...props }: StyledTabProps) => (
<Tab disableRipple {...props} />
))(({ isMobile }) => ({
textTransform: "none",
Expand Down
7 changes: 5 additions & 2 deletions govtool/frontend/src/hooks/queries/useGetDrepDetailsQuery.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { UseInfiniteQueryOptions } from "react-query";

import { Infinite, DRepData } from "@/models";
import { useGetDRepListInfiniteQuery } from "./useGetDRepListQuery";

export const useGetDRepDetailsQuery = (
dRepId: string | null | undefined,
options?: { enabled: boolean },
options?: UseInfiniteQueryOptions<Infinite<DRepData>>,
) => {
const { dRepData, isDRepListLoading } = useGetDRepListInfiniteQuery(
{ searchPhrase: dRepId ?? undefined },
{ enabled: options?.enabled || !!dRepId },
{ enabled: options?.enabled || !!dRepId, ...options },
);

return { dRep: dRepData?.[0], isLoading: isDRepListLoading };
Expand Down
9 changes: 8 additions & 1 deletion govtool/frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import pkg from "../package.json";

const { version } = pkg;

const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
refetchOnMount: false,
},
},
});

const tagManagerArgs = {
gtmId: import.meta.env.VITE_GTM_ID,
Expand Down
Loading