Remove Add and use AddIcon from MUI

This commit is contained in:
Nicola Benaglia 2025-04-20 17:57:19 +02:00
parent 2f3252a2e3
commit fda3208072
5 changed files with 23 additions and 35 deletions

View File

@ -1,9 +1,4 @@
import { import { IconButton, InputAdornment, TextFieldProps } from '@mui/material';
IconButton,
InputAdornment,
TextField,
TextFieldProps,
} from '@mui/material';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import AddIcon from '@mui/icons-material/Add'; import AddIcon from '@mui/icons-material/Add';
import RemoveIcon from '@mui/icons-material/Remove'; import RemoveIcon from '@mui/icons-material/Remove';
@ -44,6 +39,7 @@ export const BoundedNumericTextField = ({
const stringIsEmpty = (value: string) => { const stringIsEmpty = (value: string) => {
return value === ''; return value === '';
}; };
const isAllZerosNum = /^0*\.?0*$/; const isAllZerosNum = /^0*\.?0*$/;
const isFloatNum = /^-?[0-9]*\.?[0-9]*$/; const isFloatNum = /^-?[0-9]*\.?[0-9]*$/;
const isIntegerNum = /^-?[0-9]+$/; const isIntegerNum = /^-?[0-9]+$/;
@ -85,6 +81,7 @@ export const BoundedNumericTextField = ({
} }
return value; return value;
}; };
const filterValue = (value: string) => { const filterValue = (value: string) => {
if (stringIsEmpty(value)) return ''; if (stringIsEmpty(value)) return '';
value = filterTypes(value); value = filterTypes(value);
@ -120,6 +117,7 @@ export const BoundedNumericTextField = ({
setTextFieldValue(value); setTextFieldValue(value);
}; };
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const { onChange, ...noChangeProps } = { ...props }; const { onChange, ...noChangeProps } = { ...props };
return ( return (

View File

@ -1,4 +1,3 @@
import React, { useEffect, useMemo, useState } from 'react';
import { import {
AppCircle, AppCircle,
AppCircleContainer, AppCircleContainer,

View File

@ -2,12 +2,12 @@ import { Typography, Box, ButtonBase } from '@mui/material';
import { styled } from '@mui/system'; import { styled } from '@mui/system';
export const AppsParent = styled(Box)(({ theme }) => ({ export const AppsParent = styled(Box)(({ theme }) => ({
alignItems: 'center',
display: 'flex', display: 'flex',
width: '100%',
flexDirection: 'column', flexDirection: 'column',
height: '100%', height: '100%',
alignItems: 'center',
overflow: 'auto', overflow: 'auto',
width: '100%',
// For WebKit-based browsers (Chrome, Safari, etc.) // For WebKit-based browsers (Chrome, Safari, etc.)
'::-webkit-scrollbar': { '::-webkit-scrollbar': {
width: '0px', // Set the width to 0 to hide the scrollbar width: '0px', // Set the width to 0 to hide the scrollbar
@ -25,34 +25,34 @@ export const AppsParent = styled(Box)(({ theme }) => ({
})); }));
export const AppsContainer = styled(Box)(({ theme }) => ({ export const AppsContainer = styled(Box)(({ theme }) => ({
display: 'flex',
width: '90%',
justifyContent: 'space-evenly',
gap: '24px',
flexWrap: 'wrap',
alignItems: 'flex-start', alignItems: 'flex-start',
alignSelf: 'center', alignSelf: 'center',
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
color: theme.palette.text.primary, color: theme.palette.text.primary,
display: 'flex',
flexWrap: 'wrap',
gap: '24px',
justifyContent: 'space-evenly',
width: '90%',
})); }));
export const AppsLibraryContainer = styled(Box)(({ theme }) => ({ export const AppsLibraryContainer = styled(Box)(({ theme }) => ({
display: 'flex',
width: '100%',
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'center', alignItems: 'center',
backgroundColor: theme.palette.background.paper, backgroundColor: theme.palette.background.paper,
display: 'flex',
flexDirection: 'column',
justifyContent: 'flex-start',
width: '100%',
})); }));
export const AppsWidthLimiter = styled(Box)(({ theme }) => ({ export const AppsWidthLimiter = styled(Box)(({ theme }) => ({
display: 'flex',
width: '90%',
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'flex-start', alignItems: 'flex-start',
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
color: theme.palette.text.primary, color: theme.palette.text.primary,
display: 'flex',
flexDirection: 'column',
justifyContent: 'flex-start',
width: '90%',
})); }));
export const AppsSearchContainer = styled(Box)(({ theme }) => ({ export const AppsSearchContainer = styled(Box)(({ theme }) => ({
@ -99,15 +99,6 @@ export const AppCircleContainer = styled(Box)(({ theme }) => ({
width: '100%', width: '100%',
})); }));
export const Add = styled(Typography)(({ theme }) => ({
backgroundColor: theme.palette.background.default,
color: theme.palette.text.primary,
fontSize: '36px',
fontWeight: 500,
lineHeight: '43.57px',
textAlign: 'left',
}));
export const AppCircleLabel = styled(Typography)(({ theme }) => ({ export const AppCircleLabel = styled(Typography)(({ theme }) => ({
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
color: theme.palette.text.primary, color: theme.palette.text.primary,

View File

@ -7,7 +7,7 @@ import {
AppsContainer, AppsContainer,
} from './Apps-styles'; } from './Apps-styles';
import { Box, ButtonBase, Input, useTheme } from '@mui/material'; import { Box, ButtonBase, Input, useTheme } from '@mui/material';
import { Add } from '@mui/icons-material'; import AddIcon from '@mui/icons-material/Add';
import { executeEvent } from '../../utils/events'; import { executeEvent } from '../../utils/events';
import { Spacer } from '../../common/Spacer'; import { Spacer } from '../../common/Spacer';
import { SortablePinnedApps } from './SortablePinnedApps'; import { SortablePinnedApps } from './SortablePinnedApps';
@ -140,7 +140,7 @@ export const AppsHomeDesktop = ({
}} }}
> >
<AppCircle> <AppCircle>
<Add>+</Add> <AddIcon />
</AppCircle> </AppCircle>
<AppCircleLabel>Library</AppCircleLabel> <AppCircleLabel>Library</AppCircleLabel>

View File

@ -23,13 +23,13 @@ import {
import { Label } from '../Group/AddGroup'; import { Label } from '../Group/AddGroup';
import { Spacer } from '../../common/Spacer'; import { Spacer } from '../../common/Spacer';
import { import {
Add,
AppCircle, AppCircle,
AppCircleContainer, AppCircleContainer,
AppCircleLabel, AppCircleLabel,
PublishQAppChoseFile, PublishQAppChoseFile,
PublishQAppInfo, PublishQAppInfo,
} from './Apps-styles'; } from './Apps-styles';
import AddIcon from '@mui/icons-material/Add';
import ImageUploader from '../../common/ImageUploader'; import ImageUploader from '../../common/ImageUploader';
import { MyContext } from '../../App'; import { MyContext } from '../../App';
import { fileToBase64 } from '../../utils/fileReading'; import { fileToBase64 } from '../../utils/fileReading';
@ -234,7 +234,7 @@ export const AppsPrivate = ({ myName }) => {
}} }}
> >
<AppCircle> <AppCircle>
<Add>+</Add> <AddIcon />
</AppCircle> </AppCircle>
<AppCircleLabel>Private</AppCircleLabel> <AppCircleLabel>Private</AppCircleLabel>