Skip to content

Commit

Permalink
performance fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gregordr committed May 26, 2024
1 parent d801054 commit 35458b6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 40 deletions.
Empty file modified CLI-Install/install-systemd.sh
100755 → 100644
Empty file.
Empty file modified CLI-Install/postgresql.sh
100755 → 100644
Empty file.
65 changes: 25 additions & 40 deletions frontend/src/Components/Shared/AlbumGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@ import AlbumInfo from "../AlbumPage/AlbumInfo";
import { baseURL } from "../../API";
import FolderInfo from "../AlbumPage/FolderInfo";

const theme = createMuiTheme({
palette: {
primary: {
main: "#cccccc",
dark: "#cccccc",
light: "#cccccc",
},
},
});

const useStyles = makeStyles(() =>
createStyles({
root: {
overflow: "hidden",
},
icon: {
color: "rgba(255, 255, 255, 0.54)",
"&:hover, &.Mui-focusVisible": { backgroundColor: "rgba(255, 255, 255, 0.05)" }
},
photoDiv: {
margin: 5,
Expand Down Expand Up @@ -82,24 +73,21 @@ function Album(props: { album: AlbumT; click: () => void; fetchAlbums: () => Pro
title={props.album.name}
subtitle={<span>{props.album.imagecount} elements</span>}
actionIcon={
//To do: remove this to increase scroll speed
<ThemeProvider theme={theme}>
<IconButton
aria-label={`info about ${props.album.name}`}
color="primary"
onClick={(e) => {
setOpenInfo(true);
e.stopPropagation();
}}
className={classes.icon}
>
<Info />
</IconButton>
</ThemeProvider>
<IconButton
aria-label={`info about ${props.album.name}`}
color="primary"
onClick={(e) => {
setOpenInfo(true);
e.stopPropagation();
}}
className={classes.icon}
>
<Info />
</IconButton>
}
/>
</GridListTile>
<AlbumInfo album={props.album} open={openInfo} setOpen={setOpenInfo} fetchAlbums={props.fetchAlbums} currentFolder={props.currentFolder}></AlbumInfo>
{openInfo && <AlbumInfo album={props.album} open={openInfo} setOpen={setOpenInfo} fetchAlbums={props.fetchAlbums} currentFolder={props.currentFolder}></AlbumInfo>}
</>
);
}
Expand Down Expand Up @@ -145,24 +133,21 @@ function Folder(props: { folder: FolderT; click: () => void; fetchAlbums: () =>
title={props.folder.name}
// subtitle={<span>{'props.folder.imagecount'} elements</span>}
actionIcon={
//To do: remove this to increase scroll speed
<ThemeProvider theme={theme}>
<IconButton
aria-label={`info about ${props.folder.name}`}
color="primary"
onClick={(e) => {
setOpenInfo(true);
e.stopPropagation();
}}
className={classes.icon}
>
<Info />
</IconButton>
</ThemeProvider>
<IconButton
aria-label={`info about ${props.folder.name}`}
color="primary"
onClick={(e) => {
setOpenInfo(true);
e.stopPropagation();
}}
className={classes.icon}
>
<Info />
</IconButton>
}
/>
</GridListTile>
<FolderInfo folder={props.folder} open={openInfo} setOpen={setOpenInfo} currentFolder={props.currentFolder}></FolderInfo>
{openInfo && <FolderInfo folder={props.folder} open={openInfo} setOpen={setOpenInfo} currentFolder={props.currentFolder}></FolderInfo>}
</>
);
}
Expand Down

0 comments on commit 35458b6

Please sign in to comment.