mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Correctly used the max length variable for the bio text box in modal
refs https://github.com/TryGhost/Team/issues/1716
This commit is contained in:
parent
0a1b1eb70a
commit
2027c88f58
1 changed files with 4 additions and 4 deletions
|
@ -11,8 +11,8 @@ const AddNameDialog = (props) => {
|
||||||
const [name, setName] = useState(member.name ?? '');
|
const [name, setName] = useState(member.name ?? '');
|
||||||
const [bio, setBio] = useState(member.bio ?? '');
|
const [bio, setBio] = useState(member.bio ?? '');
|
||||||
|
|
||||||
const maxBioCharsLeft = 50;
|
const maxBioChars = 50;
|
||||||
const [bioCharsLeft, setBioCharsLeft] = useState(maxBioCharsLeft);
|
const [bioCharsLeft, setBioCharsLeft] = useState(maxBioChars);
|
||||||
|
|
||||||
const [error, setError] = useState({name: '', bio: ''});
|
const [error, setError] = useState({name: '', bio: ''});
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ const AddNameDialog = (props) => {
|
||||||
placeholder="Head of Marketing at Acme, Inc"
|
placeholder="Head of Marketing at Acme, Inc"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
let bioText = e.target.value;
|
let bioText = e.target.value;
|
||||||
setBioCharsLeft(maxBioCharsLeft - bioText.length);
|
setBioCharsLeft(maxBioChars - bioText.length);
|
||||||
setBio(bioText);
|
setBio(bioText);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
|
@ -125,7 +125,7 @@ const AddNameDialog = (props) => {
|
||||||
submit();
|
submit();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
maxLength="50"
|
maxLength={maxBioChars}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
className="transition-opacity duration-200 ease-linear w-full h-[44px] mt-8 px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] bg-[#3204F5] opacity-100 hover:opacity-90"
|
className="transition-opacity duration-200 ease-linear w-full h-[44px] mt-8 px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] bg-[#3204F5] opacity-100 hover:opacity-90"
|
||||||
|
|
Loading…
Add table
Reference in a new issue