Skip to content

Commit

Permalink
Merge pull request #39 from j-h-scheufen/develop
Browse files Browse the repository at this point in the history
Fix Release to main
  • Loading branch information
j-h-scheufen authored Oct 22, 2024
2 parents f616ac6 + 7599d0f commit 62fa6ed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import { useAtomValue } from 'jotai';

import GroupCard from '@/components/GroupCard';
import { currentUserGroupAtom } from '@/hooks/state/currentUser';
import CreateGroupAssociation from '../CreateGroupAssociation';

const ProfileGroupAssociation = () => {
const { data: group, isFetching } = useAtomValue(currentUserGroupAtom);

if (isFetching) return <Spinner />;

return group ? (
<GroupCard group={group} />
) : (
<div className="text-default-500 text-sm">You are currently not associated with a group</div>
);
return group ? <GroupCard group={group} /> : <CreateGroupAssociation />;
};

export default ProfileGroupAssociation;
2 changes: 0 additions & 2 deletions packages/quilombo/components/forms/ImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const ImageUpload = ({ value, ownerId, useFileUploadMutation: useDynamicMutation
const [validationError, setValidationError] = useState<string | null>(null);
const fileInputRef = useRef<HTMLInputElement | null>(null);

console.log('value in ImageUpload', value);
console.log('imagePreview;', imagePreview);
const selectImageFile = () => {
fileInputRef.current?.click();
};
Expand Down
2 changes: 1 addition & 1 deletion packages/quilombo/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const IMAGE_FORMATS: Record<ImageType, ResizeOptions> = {
groupBanner: { height: 250, width: 800, fit: 'cover', position: 'attention' },
};

export const MAX_IMAGE_UPLOAD_SIZE_MB = 5;
export const MAX_IMAGE_UPLOAD_SIZE_MB = 4.5; // 4.5 MB is the current limit for Vercel serverless functions! https://vercel.com/docs/concepts/limits/overview#serverless-function-payload-size-limit

export const PINATA_FILE_GROUP = 'd923dfed-5f8d-440b-ae87-e8a43504eaa5'; // quilombo group ID

Expand Down
4 changes: 2 additions & 2 deletions packages/quilombo/utils/pinata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const pinToGroup = async (
return { error: `Invalid input data. Unsupported image mime-type. ${inFileType?.mime}`, errorStatus: 400 };
}

// Image processing
const imageBuffer = await sharp(buffer).resize(resizeOptions).webp({ lossless: true }).toBuffer();
// Image processing (hint: rotate() is used to fix orientation before removing EXIF data)
const imageBuffer = await sharp(buffer).rotate().resize(resizeOptions).webp({ lossless: true }).toBuffer();

const uploadData = new FormData();
uploadData.append('file', new Blob([imageBuffer]));
Expand Down

0 comments on commit 62fa6ed

Please sign in to comment.