diff --git a/client/src/pages/Create/Create.css b/client/src/pages/Create/Create.css index c5288d7..70cafeb 100644 --- a/client/src/pages/Create/Create.css +++ b/client/src/pages/Create/Create.css @@ -45,6 +45,10 @@ textarea::placeholder { transition: color 150ms ease-in-out; } +.text-limit-error { + color: var(--color-error-500) +} + @media (min-width: 560px) { .gif-video { height: 288px; diff --git a/client/src/pages/Create/Create.js b/client/src/pages/Create/Create.js index e5b9242..a4798fb 100644 --- a/client/src/pages/Create/Create.js +++ b/client/src/pages/Create/Create.js @@ -27,6 +27,7 @@ function Create({ history }) { const [isWebcamReady, setIsWebcamReady] = useState(false) const [gifId, setGifId] = useState() const [text, setText] = useState('') + const [textLimitError, setTextLimitError] = useState('') const [isProcessingGif, setIsProcessingGif] = useState('') const [isUploading, setUploading] = useState(false) const [warning, setWarning] = useState( @@ -135,6 +136,15 @@ function Create({ history }) { download(fileBlob, `${gifId}.gif`) } + const handleText = (input) => { + if (input.length === 30) { + setTextLimitError('Caption must have a maximum limit of 30 characters.') + } else { + setText(input) + setTextLimitError('') + } + } + const header = ( <>
{textLimitError}
+ )}