Refactor: Update ConfigItem component styles and dependencies
This commit is contained in:
@@ -39,7 +39,7 @@ const ConfigItem = ({
|
||||
setConfigId(id);
|
||||
setIsOpenDropDown(!isOpenDropDown);
|
||||
};
|
||||
const [_, setCopyText] = useState<string>("");
|
||||
const [, setCopyText] = useState<string>("");
|
||||
const copyToClipboard = async (textToCopy: string) => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(textToCopy);
|
||||
@@ -62,7 +62,7 @@ const ConfigItem = ({
|
||||
setUsername("");
|
||||
setPassword("");
|
||||
}
|
||||
}, [textCopy]);
|
||||
}, [textCopy , type]);
|
||||
|
||||
const queryUpdateConfig = useQuery({
|
||||
queryKey: ["updateConfig", isOpenDropDown || isOpen],
|
||||
@@ -82,7 +82,7 @@ const ConfigItem = ({
|
||||
maxTraffic: queryUpdateConfig?.data?.data?.result?.max_traffic,
|
||||
traffic: queryUpdateConfig?.data?.data?.result?.traffic,
|
||||
});
|
||||
}, [queryUpdateConfig?.data, queryUpdateConfig.error]);
|
||||
}, [queryUpdateConfig?.data, queryUpdateConfig.error , queryUpdateConfig.isFetching , queryUpdateConfig.isLoading]);
|
||||
return (
|
||||
<>
|
||||
<ModalConfigDetails
|
||||
@@ -121,12 +121,12 @@ const ConfigItem = ({
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
className={`w-full h-full p-3 rounded-md text-xs md:text-base gap-2 flex justify-between items-center text-secondTheme bg-gray-900 shadow-md shadow-gray-900 ${
|
||||
className={`w-full h-full p-3 rounded-md text-xs md:text-base gap-2 flex justify-between items-center flex-wrap text-secondTheme bg-gray-900 shadow-md shadow-gray-900 ${
|
||||
isDisabled ? "filter blur-sm" : ""
|
||||
}`}
|
||||
>
|
||||
<p className="max-md:hidden">تاریخ خرید : {dateBuy}</p>
|
||||
<li className="px-2 py-1 bg-secondTheme shadow-md rounded-md w-auto h-auto text-gray-900 font-bold list-none">
|
||||
<li className="px-2 py-1 max-[400px]:w-full max-[400px]:text-center bg-secondTheme shadow-md rounded-md w-auto h-auto text-gray-900 font-bold list-none">
|
||||
{configName}
|
||||
</li>
|
||||
<div className="max-md:hidden flex flex-row-reverse gap-2 justify-end items-center">
|
||||
@@ -207,9 +207,9 @@ const ConfigItem = ({
|
||||
</Dropdown>
|
||||
)}
|
||||
</div>
|
||||
<div className="md:hidden flex flex-row-reverse gap-2 justify-end items-center">
|
||||
<div className="max-[400px]:w-full md:hidden flex flex-row-reverse gap-2 justify-end items-center">
|
||||
<Button
|
||||
extra="!m-0 !px-2 !py-1 shadow-md"
|
||||
extra="!m-0 !px-2 max-[400px]:w-full !py-1 shadow-md"
|
||||
onClick={() => {
|
||||
setConfigId(id);
|
||||
setIsOpen(true);
|
||||
|
||||
Reference in New Issue
Block a user