dix text
This commit is contained in:
parent
fe6e8aae95
commit
cea1277edb
|
|
@ -18,7 +18,6 @@ const SearchField: React.FC<Props> = ({ placeholder, searchBy }) => {
|
||||||
const handleInputChange = (value: string) => {
|
const handleInputChange = (value: string) => {
|
||||||
setSearchQuery(value);
|
setSearchQuery(value);
|
||||||
};
|
};
|
||||||
console.log(searchBy,"searchBy");
|
|
||||||
|
|
||||||
const handleInputChangeWithDebounce = useDebounce((value: string) => {
|
const handleInputChangeWithDebounce = useDebounce((value: string) => {
|
||||||
setFilter({
|
setFilter({
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||||
|
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
id={name}
|
id={name}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,8 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
style={{ height: 120 }}
|
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||||
|
|
||||||
id={id}
|
id={id}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
style={{ height: 120 }}
|
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
style={{ height: 120 }}
|
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@
|
||||||
transition: 1s ease-in-out;
|
transition: 1s ease-in-out;
|
||||||
animation: fadeInRight 1s ease-in-out;
|
animation: fadeInRight 1s ease-in-out;
|
||||||
max-height: 90vh;
|
max-height: 90vh;
|
||||||
|
min-height: 90vh;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
@include Scrollbar;
|
@include Scrollbar;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,6 @@ import useAxios from "./useAxios";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { PaginationParams } from "../utils/PaginationParams";
|
import { PaginationParams } from "../utils/PaginationParams";
|
||||||
import { filterParams } from "../utils/filterParams";
|
import { filterParams } from "../utils/filterParams";
|
||||||
import useAuthState from "../../zustand/AuthState";
|
|
||||||
import { useFilterStateState } from "../../zustand/Filter";
|
|
||||||
|
|
||||||
function useGetQuery(
|
function useGetQuery(
|
||||||
KEY: string | string[],
|
KEY: string | string[],
|
||||||
url: string,
|
url: string,
|
||||||
|
|
@ -16,10 +13,13 @@ function useGetQuery(
|
||||||
const { show, pagination, ...remainingParams } = params;
|
const { show, pagination, ...remainingParams } = params;
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const { page, per_page } = PaginationParams(location);
|
const { page, per_page } = PaginationParams(location);
|
||||||
|
|
||||||
|
console.log(remainingParams)
|
||||||
const paramToSend = pagination
|
const paramToSend = pagination
|
||||||
|
|
||||||
|
|
||||||
? { page: page, per_page: per_page, ...remainingParams }
|
? { page: page, per_page: per_page, ...remainingParams }
|
||||||
: { ...remainingParams };
|
: { ...remainingParams };
|
||||||
|
|
||||||
|
|
|
||||||
16
src/utils/shallowEqual.ts
Normal file
16
src/utils/shallowEqual.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
export function shallowEqual(obj1: any, obj2: any): boolean {
|
||||||
|
const keys1 = Object.keys(obj1);
|
||||||
|
const keys2 = Object.keys(obj2);
|
||||||
|
|
||||||
|
if (keys1.length !== keys2.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const key of keys1) {
|
||||||
|
if (obj1[key] !== obj2[key]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user