Fix a small bug within the URL shortener component

This commit is contained in:
Anthony Al Lazkani 2024-12-25 22:36:09 +02:00 committed by Elia el Lazkani
parent 35fa564a70
commit abb7282869

View file

@ -82,14 +82,15 @@ export default function () {
<form className="url-input" onSubmit={ShortenIt}>
<input
type="text"
placeholder="www.example.com"
placeholder="http://www.example.com"
aria-label="URL input field"
value={url}
onChange={(e) => setUrl(e.target.value)}
/>
<button type="submit">Shorten It</button>
</form>
{shortenedUrl && (
{shortenedUrl && showInput && (
<div className="url-input shortened">
<input type="text" readOnly value={shortenedUrl} />
<button onClick={copyURL}>Copy</button>
@ -102,8 +103,8 @@ export default function () {
</div>
<div className="right-side-content">
<p>
Shortenit is a free and open-source URL shortening service
designed for simplicity and efficiency.
Shortenit is a free and open-source URL shortening service designed
for simplicity and efficiency.
</p>
</div>
</div>