Skip to content
Snippets Groups Projects
Commit 18634386 authored by Lukas's avatar Lukas
Browse files

Update search ranges imports

parent 1de8a5bf
No related branches found
No related tags found
1 merge request!530Lbudginas/#432 build warnings
......@@ -12,7 +12,6 @@ import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
import { TabsContent } from "@/components/ui/tabs";
import OperationsTable from "@/components/OperationsTable";
import useURLParams from "@/hooks/common/useURLParams";
import useSearchRanges from "@/hooks/common/useSearchRanges";
import { defaultSearchParams } from "@/pages/[accountName]";
import useOperationsFormatter from "@/hooks/common/useOperationsFormatter";
import {
......
......@@ -4,10 +4,10 @@ import SearchRanges from "@/components/searchRanges/SearchRanges";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import useSearchRanges from "@/hooks/common/useSearchRanges";
import useURLParams from "@/hooks/common/useURLParams";
import OperationTypesDialog from "@/components/OperationTypesDialog";
import useAccountOperationTypes from "@/hooks/api/accountPage/useAccountOperationTypes";
import { useSearchesContext } from "@/contexts/SearchesContext";
interface AccountSearchParams {
accountName?: string | undefined;
......@@ -43,6 +43,7 @@ const BalanceHistorySearch = () => {
const [coinType, setCoinType] = useState<string>("HIVE"); // State to store the selected coin name
const COIN_TYPES = ["HIVE", "VESTS", "HBD"];
const router = useRouter();
const { searchRanges } = useSearchesContext();
const accountNameFromRoute = (router.query.accountName as string)?.slice(1);
const { accountOperationTypes } =
useAccountOperationTypes(accountNameFromRoute);
......@@ -92,8 +93,6 @@ const BalanceHistorySearch = () => {
const [initialSearch, setInitialSearch] = useState<boolean>(false);
const [filters, setFilters] = useState<boolean[]>([]);
const searchRanges = useSearchRanges();
const handleSearch = async (resetPage?: boolean) => {
if (
!initialSearch &&
......@@ -200,7 +199,10 @@ const BalanceHistorySearch = () => {
className="w-[180px] border border-gray-300 p-2 rounded bg-theme dark:bg-theme"
>
{COIN_TYPES.map((type) => (
<option key={type} value={type}>
<option
key={type}
value={type}
>
{type}
</option>
))}
......
import { useState, ChangeEvent, useEffect } from "react";
import { useState, ChangeEvent } from "react";
import { Loader2 } from "lucide-react";
import Explorer from "@/types/Explorer";
import { trimAccountName } from "@/utils/StringUtils";
......@@ -10,7 +10,6 @@ import { useSearchesContext } from "@/contexts/SearchesContext";
import usePermlinkSearch from "@/hooks/api/common/usePermlinkSearch";
import { startCommentPermlinkSearch } from "./utils/commentPermlinkSearchHelpers";
import PostTypeSelector from "./PostTypeSelector";
import useSearchRanges from "@/hooks/common/useSearchRanges";
const CommentsPermlinkSearch = () => {
const {
......@@ -19,17 +18,16 @@ const CommentsPermlinkSearch = () => {
setCommentPaginationPage,
setCommentType,
setLastSearchKey,
searchRanges,
} = useSearchesContext();
const searchRanges = useSearchRanges("lastTime");
const { permlinkSearchDataLoading } = usePermlinkSearch(permlinkSearchProps);
const [accountName, setAccountName] = useState<string>("");
const [localCommentType, setLocalCommentType] =
useState<Explorer.CommentType>("post");
const { getRangesValues, setLastTimeUnitValue } = searchRanges;
const { getRangesValues } = searchRanges;
const onButtonClick = async () => {
if (accountName !== "") {
......@@ -66,14 +64,6 @@ const CommentsPermlinkSearch = () => {
}
};
// Set inital permlink search range as last 30 days
useEffect(() => {
setLastTimeUnitValue(30);
return () => {
setLastTimeUnitValue(undefined);
};
}, []);
const handleChangeCommentType = (e: ChangeEvent<HTMLSelectElement>) => {
const {
target: { value },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment