refresh apps

This commit is contained in:
PhilReact 2024-11-11 18:59:40 +02:00
parent f705886d41
commit 893eafbdeb
5 changed files with 43 additions and 3 deletions

View File

@ -24,6 +24,10 @@ export const sortablePinnedAppsAtom = atom({
},{ },{
name: 'Qombo', name: 'Qombo',
service: 'APP' service: 'APP'
},
{
name: 'Q-Trade',
service: 'APP'
} }
], ],
}); });

View File

@ -47,6 +47,7 @@ const officialAppList = [
"qombo", "qombo",
"q-fund", "q-fund",
"q-shop", "q-shop",
"q-trade"
]; ];
const ScrollerStyled = styled("div")({ const ScrollerStyled = styled("div")({

View File

@ -117,9 +117,18 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop
} }
}, []); }, []);
useEffect(() => { useEffect(() => {
getQapps();
getCategories() getCategories()
}, [getQapps, getCategories]); }, [getCategories]);
useEffect(() => {
getQapps();
const interval = setInterval(() => {
getQapps();
}, 20 * 60 * 1000); // 20 minutes in milliseconds
return () => clearInterval(interval);
}, [getQapps]);
const selectedAppInfoFunc = (e) => { const selectedAppInfoFunc = (e) => {
const data = e.detail?.data; const data = e.detail?.data;
@ -445,6 +454,7 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop
myName={myName} myName={myName}
hasPublishApp={!!(myApp || myWebsite)} hasPublishApp={!!(myApp || myWebsite)}
categories={categories} categories={categories}
getQapps={getQapps}
/> />
{mode === "appInfo" && !selectedTab && <AppInfo app={selectedAppInfo} myName={myName} />} {mode === "appInfo" && !selectedTab && <AppInfo app={selectedAppInfo} myName={myName} />}

View File

@ -41,6 +41,7 @@ const officialAppList = [
"qombo", "qombo",
"q-fund", "q-fund",
"q-shop", "q-shop",
"q-trade"
]; ];
const ScrollerStyled = styled('div')({ const ScrollerStyled = styled('div')({

View File

@ -32,6 +32,7 @@ import IconSearch from "../../assets/svgs/Search.svg";
import IconClearInput from "../../assets/svgs/ClearInput.svg"; import IconClearInput from "../../assets/svgs/ClearInput.svg";
import qappDevelopText from "../../assets/svgs/qappDevelopText.svg"; import qappDevelopText from "../../assets/svgs/qappDevelopText.svg";
import qappLibraryText from "../../assets/svgs/qappLibraryText.svg"; import qappLibraryText from "../../assets/svgs/qappLibraryText.svg";
import RefreshIcon from "@mui/icons-material/Refresh";
import qappDots from "../../assets/svgs/qappDots.svg"; import qappDots from "../../assets/svgs/qappDots.svg";
@ -55,6 +56,7 @@ const officialAppList = [
"qombo", "qombo",
"q-fund", "q-fund",
"q-shop", "q-shop",
"q-trade"
]; ];
const ScrollerStyled = styled("div")({ const ScrollerStyled = styled("div")({
@ -96,7 +98,8 @@ export const AppsLibraryDesktop = ({
myName, myName,
hasPublishApp, hasPublishApp,
isShow, isShow,
categories categories,
getQapps
}) => { }) => {
const [searchValue, setSearchValue] = useState(""); const [searchValue, setSearchValue] = useState("");
const virtuosoRef = useRef(); const virtuosoRef = useRef();
@ -169,6 +172,11 @@ export const AppsLibraryDesktop = ({
}} }}
> >
<img src={qappLibraryText} /> <img src={qappLibraryText} />
<Box sx={{
display: 'flex',
gap: '20px',
alignItems: 'center'
}}>
<AppsSearchContainer <AppsSearchContainer
sx={{ sx={{
width: "412px", width: "412px",
@ -200,6 +208,22 @@ export const AppsLibraryDesktop = ({
)} )}
</AppsSearchRight> </AppsSearchRight>
</AppsSearchContainer> </AppsSearchContainer>
<ButtonBase
onClick={(e) => {
getQapps()
}}
>
<RefreshIcon
sx={{
color: "rgba(250, 250, 250, 0.5)",
width: '40px',
height: 'auto'
}}
/>
</ButtonBase>
</Box>
</Box> </Box>
</AppsWidthLimiter> </AppsWidthLimiter>
</AppsDesktopLibraryHeader> </AppsDesktopLibraryHeader>