Use desktop file

This commit is contained in:
Nicola Benaglia 2025-04-20 13:53:57 +02:00
parent 2f7a04c6b1
commit b5a9620dc4
2 changed files with 67 additions and 53 deletions

View File

@ -1,3 +1,4 @@
import React, { useEffect, useMemo, useState } from 'react';
import {
AppCircle,
AppCircleContainer,
@ -17,9 +18,11 @@ import {
AppsLibraryContainer,
AppsWidthLimiter,
} from './Apps-styles';
import { Avatar, Box } from '@mui/material';
import { getBaseApiReact } from '../../App';
import { Avatar, Box, ButtonBase, InputBase } from '@mui/material';
import { Add } from '@mui/icons-material';
import { getBaseApiReact, isMobile } from '../../App';
import LogoSelected from '../../assets/svgs/LogoSelected.svg';
import { Spacer } from '../../common/Spacer';
import { executeEvent } from '../../utils/events';
import { AppRating } from './AppRating';
@ -27,7 +30,7 @@ import {
settingsLocalLastUpdatedAtom,
sortablePinnedAppsAtom,
} from '../../atoms/global';
import { saveToLocalStorage } from './AppsNavBar';
import { saveToLocalStorage } from './AppsNavBarDesktop';
import { useRecoilState, useSetRecoilState } from 'recoil';
export const AppInfo = ({ app, myName }) => {
@ -46,8 +49,9 @@ export const AppInfo = ({ app, myName }) => {
return (
<AppsLibraryContainer
sx={{
height: '100%',
justifyContent: 'flex-start',
height: !isMobile && '100%',
justifyContent: !isMobile && 'flex-start',
alignItems: isMobile && 'center',
}}
>
<Box
@ -58,8 +62,7 @@ export const AppInfo = ({ app, myName }) => {
width: '90%',
}}
>
<Spacer height="30px" />
{!isMobile && <Spacer height="30px" />}
<AppsWidthLimiter>
<AppInfoSnippetContainer>
<AppInfoSnippetLeft
@ -167,9 +170,15 @@ export const AppInfo = ({ app, myName }) => {
}}
>
<AppDownloadButtonText>
{!isMobile ? (
<>
{isSelectedAppPinned
? 'Unpin from dashboard'
: 'Pin to dashboard'}
</>
) : (
<>{isSelectedAppPinned ? 'Unpin' : 'Pin'}</>
)}
</AppDownloadButtonText>
</AppDownloadButton>
<AppDownloadButton

View File

@ -1,3 +1,4 @@
import React from 'react';
import {
AppCircle,
AppCircleContainer,
@ -11,8 +12,9 @@ import {
AppInfoUserName,
} from './Apps-styles';
import { Avatar, ButtonBase } from '@mui/material';
import { getBaseApiReact } from '../../App';
import { getBaseApiReact, isMobile } from '../../App';
import LogoSelected from '../../assets/svgs/LogoSelected.svg';
import { Spacer } from '../../common/Spacer';
import { executeEvent } from '../../utils/events';
import { AppRating } from './AppRating';
@ -21,7 +23,7 @@ import {
settingsLocalLastUpdatedAtom,
sortablePinnedAppsAtom,
} from '../../atoms/global';
import { saveToLocalStorage } from './AppsNavBar';
import { saveToLocalStorage } from './AppsNavBarDesktop';
export const AppInfoSnippet = ({
app,
@ -122,6 +124,7 @@ export const AppInfoSnippet = ({
gap: '10px',
}}
>
{!isMobile && (
<AppDownloadButton
onClick={() => {
setSortablePinnedApps((prev) => {
@ -132,7 +135,8 @@ export const AppInfoSnippet = ({
updatedApps = prev.filter(
(item) =>
!(
item?.name === app?.name && item?.service === app?.service
item?.name === app?.name &&
item?.service === app?.service
)
);
} else {
@ -165,6 +169,7 @@ export const AppInfoSnippet = ({
{isSelectedAppPinned ? 'Unpin' : 'Pin'}
</AppDownloadButtonText>
</AppDownloadButton>
)}
<AppDownloadButton
onClick={() => {