From 1b020b2a9ba00e1b2b591820c51664049ca731d8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 23 Feb 2023 16:05:24 -0600 Subject: [PATCH 1/2] Improve rounded courners in MediaGallery and Chats --- app/soapbox/components/media-gallery.tsx | 30 +++++++++++++++---- .../chats/components/chat-message.tsx | 7 ++++- app/styles/components/media-gallery.scss | 4 +-- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/app/soapbox/components/media-gallery.tsx b/app/soapbox/components/media-gallery.tsx index 001ac0729..0c26b26f6 100644 --- a/app/soapbox/components/media-gallery.tsx +++ b/app/soapbox/components/media-gallery.tsx @@ -152,7 +152,14 @@ const Item: React.FC = ({ ); return ( -
+
1, + })} + key={attachment.id} + style={{ position, float, left, top, right, bottom, height, width: `${width}%` }} + > {attachmentIcon} @@ -245,7 +252,14 @@ const Item: React.FC = ({ } return ( -
+
1, + })} + key={attachment.id} + style={{ position, float, left, top, right, bottom, height, width: `${width}%` }} + > {last && total > ATTACHMENT_LIMIT && (
+{total - ATTACHMENT_LIMIT + 1} @@ -260,7 +274,7 @@ const Item: React.FC = ({ ); }; -interface IMediaGallery { +export interface IMediaGallery { sensitive?: boolean media: ImmutableList height?: number @@ -270,13 +284,15 @@ interface IMediaGallery { visible?: boolean onToggleVisibility?: () => void displayMedia?: string - compact: boolean + compact?: boolean + className?: string } const MediaGallery: React.FC = (props) => { const { media, defaultWidth = 0, + className, onOpenMedia, cacheWidth, compact, @@ -546,7 +562,11 @@ const MediaGallery: React.FC = (props) => { }, [node.current]); return ( -
+
{children}
); diff --git a/app/soapbox/features/chats/components/chat-message.tsx b/app/soapbox/features/chats/components/chat-message.tsx index 597c78ef1..eccdaa6d7 100644 --- a/app/soapbox/features/chats/components/chat-message.tsx +++ b/app/soapbox/features/chats/components/chat-message.tsx @@ -23,6 +23,7 @@ import ChatMessageReaction from './chat-message-reaction'; import ChatMessageReactionWrapper from './chat-message-reaction-wrapper/chat-message-reaction-wrapper'; import type { Menu as IMenu } from 'soapbox/components/dropdown-menu'; +import type { IMediaGallery } from 'soapbox/components/media-gallery'; import type { ChatMessage as ChatMessageEntity } from 'soapbox/types/entities'; const messages = defineMessages({ @@ -112,8 +113,12 @@ const ChatMessage = (props: IChatMessage) => { return ( - {(Component: any) => ( + {(Component: React.FC) => ( Date: Tue, 28 Feb 2023 10:13:53 -0600 Subject: [PATCH 2/2] Add `yarn i18n` command to fix translation files --- docs/development/yarn-commands.md | 4 +++- package.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/development/yarn-commands.md b/docs/development/yarn-commands.md index f03b8e073..0180ed89f 100644 --- a/docs/development/yarn-commands.md +++ b/docs/development/yarn-commands.md @@ -15,7 +15,9 @@ NODE_ENV=development - `yarn build` - Compile without a dev server, into `/static` directory. ## Translations -- `yarn manage:translations` - Normalizes translation files. Should always be run after editing i18n strings. +- `yarn i18n` - Rebuilds app and updates English locale to prepare for translations in other languages. Should always be run after editing i18n strings. + +- `yarn manage:translations` - A low-level translations manager utility. ## Tests - `yarn test:all` - Runs all tests and linters. diff --git a/package.json b/package.json index 79d36fa67..561279c1c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "build": "npx webpack", "audit:fix": "npx yarn-audit-fix", "manage:translations": "npx ts-node ./scripts/translationRunner.ts", + "i18n": "rm -rf build tmp && npx cross-env NODE_ENV=production ${npm_execpath} run build && ${npm_execpath} manage:translations en", "test": "npx cross-env NODE_ENV=test npx jest", "test:coverage": "${npm_execpath} run test --coverage", "test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint",