Skip to content

Instantly share code, notes, and snippets.

@CodeLeom
Created February 3, 2023 10:55
Show Gist options
  • Save CodeLeom/202a4ac1d7a4564b68db0b9b6ad81b94 to your computer and use it in GitHub Desktop.
Save CodeLeom/202a4ac1d7a4564b68db0b9b6ad81b94 to your computer and use it in GitHub Desktop.
Generate custom logo for your community
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