Skip to content

Commit

Permalink
Merge branch 'main' into feat/96-image-deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibesh10101011 authored Dec 16, 2024
2 parents 7ab8415 + 6f71d77 commit daa6b03
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run format:check
npm run lint:check
34 changes: 18 additions & 16 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"extends": ["react-app", "eslint-config-prettier"],
"rules": {
// Accessibility rules
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/img-redundant-alt": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/media-has-caption": "off",
// React Hook rules
"react-hooks/exhaustive-deps": "off",
// Temporarily turn warnings into errors to suppress them
"no-warning-comments": ["error", { "terms": ["todo", "fixme"], "location": "anywhere" }]
}
"extends": ["react-app", "eslint-config-prettier"],
"rules": {
// Accessibility rules
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/img-redundant-alt": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/media-has-caption": "off",
// React Hook rules
"react-hooks/exhaustive-deps": "off",
// Temporarily turn warnings into errors to suppress them
"no-warning-comments": [
"error",
{ "terms": ["todo", "fixme"], "location": "anywhere" }
]
}
}
3 changes: 3 additions & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
dist/
.npm/
src-tauri/target/
src-tauri/gen/schemas/
2 changes: 1 addition & 1 deletion frontend/src/components/AITagging/FilterControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function FilterControls({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent
className="w-[200px] bg-white dark:text-foreground max-h-[500px] overflow-y-auto"
className="max-h-[500px] w-[200px] overflow-y-auto bg-white dark:text-foreground"
align="end"
>
<DropdownMenuRadioGroup
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Album/Album.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const AlbumsView: React.FC = () => {
const transformedAlbums = albums.map((album: Album) => ({
id: album.album_name,
title: album.album_name,
coverImage: album.image_paths[0] || `D:/Data/picto/UPDATED-PICTOPY/PictoPy/frontend/public/tauri.svg`,
coverImage: album.image_paths[0] ||
`D:/Data/Pictopy/PictoPy/frontend/public/tauri.svg`,
imageCount: album.image_paths.length,
}));

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Album/ImageSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ImageSelectionPage: React.FC<ImageSelectionPageProps> = ({
useAddMultipleImagesToAlbum();

// Extract the array of image paths
const allImages: string[] = allImagesData??[];;
const allImages: string[] = allImagesData ?? [];

useEffect(() => {
if (error) {
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/components/Media/MediaView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ const MediaView: React.FC<MediaViewProps> = ({
setGlobalIndex((currentPage - 1) * itemsPerPage + initialIndex);
}, [initialIndex, currentPage, itemsPerPage]);

useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "ArrowRight") {
handleNextItem();
} else if (e.key === "ArrowLeft") {
handlePrevItem();
}
};

window.addEventListener("keydown", handleKeyDown);

return () => {
window.removeEventListener("keydown", handleKeyDown);
};
}, [globalIndex]);

function handlePrevItem() {
if (globalIndex > 0) {
setGlobalIndex(globalIndex - 1);
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/components/Navigation/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ export function Navbar(props: { title?: string }) {
return (
<>
<header className="flex w-full flex-row items-center justify-center align-middle">
< div className="flex h-16 items-center justify-between bg-[#333333] px-16 w-[50%] mt-3 rounded-3xl ">
<div className="flex h-16 items-center justify-between bg-[#333333] px-16 w-[50%] mt-3 rounded-3xl ">
<div className="flex items-center gap-4">
<div className="flex items-center gap-2">
<img src="/tauri.svg" height={"20px"} width={"20px"} alt="" />
<span className="font-sans text-lg font-bold text-gray-50">
Pictopy
<div className="flex items-center gap-4">
<span className="font-sans text-lg font-medium text-gray-50">
Welcome {props.title || 'User'}
</span>
</div>
</div>
<div className="flex items-center gap-4">
<span className="font-sans text-lg font-medium text-gray-50">
Welcome {props.title || 'User'}
</span>
</div>
</div>
</header>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Navigation/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Sidebar() {
}`;

return (
<div className="sidebar flex w-40 flex-col justify-between space-y-4 border-r border-gray-700 bg-[#333333] p-4 dark:border-gray-700 m-4 rounded-3xl">
<div className="sidebar m-4 flex w-40 flex-col justify-between space-y-4 rounded-3xl border-r border-gray-700 bg-[#333333] p-4 dark:border-gray-700">
<div className="mt-2 flex flex-col gap-10">
<Link to="/home" className={linkClasses('/home')}>
<HomeIcon
Expand Down
1 change: 0 additions & 1 deletion frontend/src/layout/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Sidebar from '@/components/Navigation/Sidebar/Sidebar';
const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return (
<div className="flex w-full flex-col bg-gray-900">
<Navbar />
<div className="sidebar flex" style={{ height: 'calc(100vh - 64px)' }}>
<Sidebar />
<div className="flex flex-1 overflow-x-auto p-4 text-white">
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ extra:
- icon: fontawesome/brands/discord
link: https://discord.com/invite/6mFZ2S846n
name: Join AOSSIE on Discord
- icon: fontawesome/brands/twitter
- icon: fontawesome/brands/x-twitter
link: https://x.com/aossie_org
name: Follow AOSSIE on Twitter
21 changes: 20 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
"name": "pictopy",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"linux-dev": "bash ./scripts/linux-dev.sh",
"win-dev": "cd scripts && win-dev.bat"
}

"name": "pictopy",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"linux-dev": "bash ./scripts/linux-dev.sh",
"win-dev": "cd scripts && win-dev.bat",
"prepare": "husky",
"lint:check": "cd frontend && eslint --max-warnings 0 --config .eslintrc.json .",
"lint:fix": "cd frontend && eslint --max-warnings 0 --config .eslintrc.json . --fix",
"format:fix": "cd frontend && prettier --write \"**/*.{ts,tsx,json}\"",
"format:check": "cd frontend && prettier --check \"**/*.{ts,tsx,json}\""
},
"devDependencies": {
"husky": "^9.1.7"
}
}

0 comments on commit daa6b03

Please sign in to comment.