From f4fb7d6b7a6ef325352280b79ea049f2b833dd16 Mon Sep 17 00:00:00 2001 From: Echo Date: Fri, 6 Mar 2026 13:57:06 +0100 Subject: [PATCH] [Glitch] Profile editing: Rearranging and adding fields Port eb848d082afc8864b2aa15858f414e4867902c65 to glitch-soc Signed-off-by: Claire --- .../form_fields/emoji_text_field.stories.tsx | 6 +- .../form_fields/emoji_text_field.tsx | 18 +- .../account_edit/components/field.tsx | 29 ++ .../glitch/features/account_edit/index.tsx | 70 +++- .../account_edit/modals/bio_modal.tsx | 12 +- .../account_edit/modals/fields_modals.tsx | 60 +++- .../modals/fields_reorder_modal.tsx | 322 ++++++++++++++++++ .../features/account_edit/modals/index.ts | 1 + .../account_edit/modals/name_modal.tsx | 2 +- .../account_edit/modals/styles.module.scss | 66 ++++ .../account_edit/modals/verified_modal.tsx | 1 + .../features/account_edit/styles.module.scss | 22 +- 12 files changed, 566 insertions(+), 43 deletions(-) create mode 100644 app/javascript/flavours/glitch/features/account_edit/components/field.tsx create mode 100644 app/javascript/flavours/glitch/features/account_edit/modals/fields_reorder_modal.tsx diff --git a/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.stories.tsx b/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.stories.tsx index aed04bbcbf..05df009ecf 100644 --- a/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.stories.tsx +++ b/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.stories.tsx @@ -26,13 +26,13 @@ export const Simple: Story = {}; export const WithMaxLength: Story = { args: { - maxLength: 20, + counterMax: 20, }, }; export const WithRecommended: Story = { args: { - maxLength: 20, + counterMax: 20, recommended: true, }, }; @@ -52,7 +52,7 @@ export const TextArea: Story = { value={value} onChange={setValue} label='Label' - maxLength={100} + counterMax={100} /> ); }, diff --git a/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.tsx b/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.tsx index ddd7099217..93deaf0dd6 100644 --- a/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.tsx +++ b/app/javascript/flavours/glitch/components/form_fields/emoji_text_field.tsx @@ -26,7 +26,7 @@ import { TextInput } from './text_input_field'; export type EmojiInputProps = { value?: string; onChange?: Dispatch>; - maxLength?: number; + counterMax?: number; recommended?: boolean; } & Omit; @@ -39,6 +39,7 @@ export const EmojiTextInputField: FC< hint, hasError, maxLength, + counterMax = maxLength, recommended, disabled, ...otherProps @@ -49,7 +50,7 @@ export const EmojiTextInputField: FC< label, hint, hasError, - maxLength, + counterMax, recommended, disabled, inputRef, @@ -63,6 +64,7 @@ export const EmojiTextInputField: FC< @@ -78,7 +80,8 @@ export const EmojiTextAreaField: FC< value, label, maxLength, - recommended = false, + counterMax = maxLength, + recommended, disabled, hint, hasError, @@ -90,7 +93,7 @@ export const EmojiTextAreaField: FC< label, hint, hasError, - maxLength, + counterMax, recommended, disabled, inputRef: textareaRef, @@ -104,6 +107,7 @@ export const EmojiTextAreaField: FC<