From a6ac3966a71f188c6ca2fec15d180412a9e1cc04 Mon Sep 17 00:00:00 2001 From: Josh Daniel Date: Mon, 2 Oct 2023 08:39:58 +0800 Subject: [PATCH 1/3] chore: increase image quality when saving --- apps/web/src/components/Dialog/Message.tsx | 2 +- apps/web/src/components/InboxTabs/SeenCard.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/Dialog/Message.tsx b/apps/web/src/components/Dialog/Message.tsx index 0992f0d9..6ea23964 100644 --- a/apps/web/src/components/Dialog/Message.tsx +++ b/apps/web/src/components/Dialog/Message.tsx @@ -46,7 +46,7 @@ export const MessageDialog = ({ return; } - toPng(cardRef.current, { cacheBust: true }) + toPng(cardRef.current, { cacheBust: true, pixelRatio: 5 }) .then((dataUrl) => { const link = document.createElement('a'); link.download = `${user?.username}_${nanoid(5)}.png`; diff --git a/apps/web/src/components/InboxTabs/SeenCard.tsx b/apps/web/src/components/InboxTabs/SeenCard.tsx index 72d82197..e6e65a78 100644 --- a/apps/web/src/components/InboxTabs/SeenCard.tsx +++ b/apps/web/src/components/InboxTabs/SeenCard.tsx @@ -64,7 +64,7 @@ export const SeenCard = ({ message, refetch }: Props) => { return; } - toPng(cardRef.current, { cacheBust: true }) + toPng(cardRef.current, { cacheBust: true, pixelRatio: 5 }) .then((dataUrl) => { const link = document.createElement('a'); link.download = `${user?.username}_${id}.png`; From 333304b70f712517bab2a4c21f1c85a8f40b072b Mon Sep 17 00:00:00 2001 From: Josh Daniel Date: Mon, 2 Oct 2023 08:47:15 +0800 Subject: [PATCH 2/3] fix: add spacing between cards --- apps/web/src/components/InboxTabs/Recent.tsx | 2 +- apps/web/src/components/InboxTabs/Sent.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/InboxTabs/Recent.tsx b/apps/web/src/components/InboxTabs/Recent.tsx index 197b35ef..c21f0a89 100644 --- a/apps/web/src/components/InboxTabs/Recent.tsx +++ b/apps/web/src/components/InboxTabs/Recent.tsx @@ -75,7 +75,7 @@ export const Recent = () => { setIsOpen={setMsgModal} /> - + {messages?.map((m) => ( - + -

- NEW -

{status === 'loading' || loading ? ( diff --git a/apps/web/src/schema/message/message.resolvers.ts b/apps/web/src/schema/message/message.resolvers.ts index b7ba08b4..d9eea342 100644 --- a/apps/web/src/schema/message/message.resolvers.ts +++ b/apps/web/src/schema/message/message.resolvers.ts @@ -97,9 +97,9 @@ export class MessageResolver { if (latestMessage?.updatedAt) { const diff = new Date().getTime() - latestMessage.updatedAt.getTime(); - if (diff < 1000 * 60 * 5 && process.env.NODE_ENV !== 'development') { + if (diff < 1000 * 60 && process.env.NODE_ENV !== 'development') { return { - error: 'You can only send a message once every 5 minutes.', + error: 'You can only send a message once every 1 minute.', }; } }