Created
February 3, 2023 10:55
-
-
Save CodeLeom/202a4ac1d7a4564b68db0b9b6ad81b94 to your computer and use it in GitHub Desktop.
Generate custom logo for your community
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
const LogoGenerator = () => { | |
const [city, setCity] = useState(''); | |
const [logo, setLogo] = useState(null); | |
const handleSubmit = event => { | |
event.preventDefault(); | |
// Example code to generate logo based on city name | |
// Replace this with a real logo generation code | |
setLogo(`City: ${city}`); | |
}; | |
return ( | |
<div> | |
<form onSubmit={handleSubmit}> | |
<label> | |
City Name: | |
<input type="text" value={city} onChange={e => setCity(e.target.value)} /> | |
</label> | |
<button type="submit">Generate Logo</button> | |
</form> | |
{logo && <div>{logo}</div>} | |
</div> | |
); | |
}; | |
export default LogoGenerator; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment