Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Dec 6, 2024
1 parent 9e6fb3e commit 4f890ef
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion configs/envs/.env.eth_sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NEXT_PUBLIC_AD_ADBUTLER_CONFIG_DESKTOP={ "id": "632019", "width": "728", "height
NEXT_PUBLIC_AD_ADBUTLER_CONFIG_MOBILE={ "id": "632018", "width": "320", "height": "100" }
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=https://admin-rs.services.blockscout.com
NEXT_PUBLIC_API_BASE_PATH=/
NEXT_PUBLIC_API_HOST=eth-sepolia.k8s-dev.blockscout.com
NEXT_PUBLIC_API_HOST=eth-sepolia.blockscout.com
NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml
NEXT_PUBLIC_CONTRACT_CODE_IDES=[{'title':'Remix IDE','url':'https://remix.ethereum.org/?address={hash}&blockscout={domain}','icon_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/ide-icons/remix.png'}]
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=https://contracts-info.services.blockscout.com
Expand Down
8 changes: 4 additions & 4 deletions types/api/advancedFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export type AdvancedFilterResponseItem = {
} | null;
type: string;
value: string | null;
}
};

export type AdvancedFiltersSearchParams = {
methods: Record<string, string>;
tokens: Record<string, TokenInfo>;
}
};

export type AdvancedFilterResponse = {
items: Array<AdvancedFilterResponseItem>;
Expand All @@ -59,11 +59,11 @@ export type AdvancedFilterResponse = {
transaction_index: number;
items_count: number;
};
}
};

export type AdvancedFilterMethodsResponse = Array<AdvancedFilterMethodInfo>;

export type AdvancedFilterMethodInfo = {
method_id: string;
name?: string;
}
};
2 changes: 1 addition & 1 deletion ui/address/mud/AddressMudRecordsKeyFilterContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = {
title: string;
columnName: string;
onClose?: () => void;
}
};

const AddressMudRecordsKeyFilter = ({ value = '', handleFilterChange, columnName, title, onClose }: Props) => {
const [ filterValue, setFilterValue ] = React.useState<string>(value);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions ui/advancedFilter/ColumnFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = {
isLoading?: boolean;
className?: string;
children: React.ReactNode;
}
};

type ContentProps = {
title: string;
Expand All @@ -29,7 +29,7 @@ type ContentProps = {
onReset?: () => void;
onClose?: () => void;
children: React.ReactNode;
}
};

const ColumnFilterContent = ({ title, isFilled, onFilter, onReset, onClose, children }: ContentProps) => {
const onFilterClick = React.useCallback(() => {
Expand All @@ -48,7 +48,7 @@ const ColumnFilterContent = ({ title, isFilled, onFilter, onReset, onClose, chil
color: isFilled ? 'link_hovered' : 'none',
}}
>
Reset
Reset
</Link>
</Flex>
{ children }
Expand Down
2 changes: 1 addition & 1 deletion ui/advancedFilter/FilterByColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Props = {
columnName: string;
handleFilterChange: (field: keyof AdvancedFilterParams, val: unknown) => void;
isLoading?: boolean;
}
};

const FilterByColumn = ({ column, filters, columnName, handleFilterChange, searchParams, isLoading }: Props) => {
const commonProps = { columnName, handleFilterChange, isLoading };
Expand Down
12 changes: 9 additions & 3 deletions ui/advancedFilter/ItemByColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ type Props = {
item: AdvancedFilterResponseItem;
column: ColumnsIds;
isLoading?: boolean;
}
};

const ItemByColumn = ({ item, column, isLoading }: Props) => {
switch (column) {
case 'tx_hash':
Expand All @@ -41,8 +42,13 @@ const ItemByColumn = ({ item, column, isLoading }: Props) => {
<AddressEntity address={ item.from } truncation="constant" isLoading={ isLoading }/>
</Flex>
);
case 'to':
return <AddressEntity address={ item.to ? item.to : item.created_contract } truncation="constant" isLoading={ isLoading }/>;
case 'to': {
const address = item.to ? item.to : item.created_contract;
if (!address) {
return null;
}
return <AddressEntity address={ address } truncation="constant" isLoading={ isLoading }/>;
}
case 'or_and':
return (
<AddressFromToIcon
Expand Down
4 changes: 2 additions & 2 deletions ui/advancedFilter/filters/AddressFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Props = {
type: 'from' | 'to';
isLoading?: boolean;
onClose?: () => void;
}
};

type InputProps = {
address?: string;
Expand All @@ -35,7 +35,7 @@ type InputProps = {
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
onClear: () => void;
onAddFieldClick: () => void;
}
};

const AddressFilterInput = ({ address, mode, onModeChange, onChange, onClear, isLast, onAddFieldClick }: InputProps) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion ui/advancedFilter/filters/AddressRelationFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Props = {
columnName: string;
isLoading?: boolean;
onClose?: () => void;
}
};

const AddressRelationFilter = ({ value = DEFAULT_VALUE, handleFilterChange, onClose }: Props) => {
const onFilter = React.useCallback((val: Value) => {
Expand Down
4 changes: 2 additions & 2 deletions ui/advancedFilter/filters/AgeFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const FILTER_PARAM_TO = 'age_to';
const FILTER_PARAM_AGE = 'age';

const defaultValue = { age: '', from: '', to: '' } as const;
type AgeFromToValue = { age: AdvancedFilterAge | ''; from: string; to: string }
type AgeFromToValue = { age: AdvancedFilterAge | ''; from: string; to: string };

type Props = {
value?: AgeFromToValue;
handleFilterChange: (filed: keyof AdvancedFilterParams, value?: string) => void;
columnName: string;
isLoading?: boolean;
onClose?: () => void;
}
};

const AgeFilter = ({ value = defaultValue, handleFilterChange, onClose }: Props) => {
const [ currentValue, setCurrentValue ] = React.useState<AgeFromToValue>(value);
Expand Down
4 changes: 2 additions & 2 deletions ui/advancedFilter/filters/AmountFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ const PRESETS = [
];

const defaultValue = { from: '', to: '' };
type AmountValue = { from?: string; to?: string }
type AmountValue = { from?: string; to?: string };

type Props = {
value?: AmountValue;
handleFilterChange: (filed: keyof AdvancedFilterParams, value?: string) => void;
onClose?: () => void;
}
};

const AmountFilter = ({ value = {}, handleFilterChange, onClose }: Props) => {
const [ currentValue, setCurrentValue ] = React.useState<AmountValue>(value || defaultValue);
Expand Down
2 changes: 1 addition & 1 deletion ui/advancedFilter/filters/AssetFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Props = {
columnName: string;
isLoading?: boolean;
onClose?: () => void;
}
};

const AssetFilter = ({ value = [], handleFilterChange, onClose }: Props) => {
const [ currentValue, setCurrentValue ] = React.useState<Value>([ ...value ]);
Expand Down
2 changes: 1 addition & 1 deletion ui/advancedFilter/filters/MethodFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = {
value?: Array<AdvancedFilterMethodInfo>;
handleFilterChange: (filed: keyof AdvancedFilterParams, val: Array<string>) => void;
onClose?: () => void;
}
};

const MethodFilter = ({ value = [], handleFilterChange, onClose }: Props) => {
const [ currentValue, setCurrentValue ] = React.useState<Array<AdvancedFilterMethodInfo>>([ ...value ]);
Expand Down
2 changes: 1 addition & 1 deletion ui/advancedFilter/filters/TypeFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Props = {
value?: Array<AdvancedFilterType>;
handleFilterChange: (filed: keyof AdvancedFilterParams, value: Array<AdvancedFilterType>) => void;
onClose?: () => void;
}
};

const TypeFilter = ({ value = [], handleFilterChange, onClose }: Props) => {
const [ currentValue, setCurrentValue ] = React.useState<Array<AdvancedFilterType>>([ ...value ]);
Expand Down
1 change: 0 additions & 1 deletion ui/shared/pagination/useQueryWithPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ export default function useQueryWithPages<Resource extends PaginatedResources>({
});
}
scrollToTop();

router.push(
{
pathname: router.pathname,
Expand Down

0 comments on commit 4f890ef

Please sign in to comment.