Skip to content

Commit 2cc8332

Browse files
Merge pull request #38 from sanjam3712/feat/character-count-indicator
feat: Add character count indicator to resume text fields
2 parents 7d36698 + c26a00c commit 2cc8332

2 files changed

Lines changed: 8 additions & 32 deletions

File tree

package-lock.json

Lines changed: 2 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/ResumeForm/Form/InputGroup.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ const BulletListTextareaGeneral = <T extends string>({
122122
showBulletPoints = true,
123123
}: InputProps<T, string[]> & { showBulletPoints?: boolean }) => {
124124
const html = getHTMLFromBulletListStrings(bulletListStrings);
125+
const charCount = bulletListStrings.join(" ").length;
126+
const maxChars = 300;
127+
125128
return (
126129
<InputGroupWrapper label={label} className={wrapperClassName}>
127130
<ContentEditable
@@ -141,6 +144,9 @@ const BulletListTextareaGeneral = <T extends string>({
141144
}}
142145
html={html}
143146
/>
147+
<div className={`text-right text-xs mt-1 ${charCount > maxChars ? "text-red-500" : "text-gray-400"}`}>
148+
{charCount} / {maxChars} characters
149+
</div>
144150
</InputGroupWrapper>
145151
);
146152
};

0 commit comments

Comments
 (0)