feat(nostr): Expanded profile properties

This commit is contained in:
Daniel Gonzalez
2025-07-08 18:46:03 -04:00
parent 990e41e8f6
commit 7e1b75f965
2 changed files with 74 additions and 2 deletions
@@ -16,7 +16,12 @@ function ProfilePost (props) {
const { bchWalletState } = props.appData
const [formData, setFormData] = useState({
name: '',
about: ''
about: '',
picture: '',
display_name: '',
website: '',
banner: '',
bot: false
})
const [errorMsg, setErrorMsg] = useState('')
@@ -90,7 +95,12 @@ function ProfilePost (props) {
const resetForm = () => {
setFormData({
name: '',
about: ''
about: '',
picture: '',
display_name: '',
website: '',
banner: '',
bot: false
})
}
@@ -137,6 +147,67 @@ function ProfilePost (props) {
/>
</Form.Group>
<Form.Group className='mb-3'>
<Form.Label>Profile Picture URL</Form.Label>
<Form.Control
type='url'
placeholder='Enter URL to your profile picture'
name='picture'
value={formData.picture}
onChange={handleInputChange}
/>
</Form.Group>
<Form.Group className='mb-3'>
<Form.Label>Display Name</Form.Label>
<Form.Control
type='text'
placeholder='Enter your display name'
name='display_name'
value={formData.display_name}
onChange={handleInputChange}
/>
</Form.Group>
<Form.Group className='mb-3'>
<Form.Label>Website</Form.Label>
<Form.Control
type='url'
placeholder='Enter your website URL'
name='website'
value={formData.website}
onChange={handleInputChange}
/>
</Form.Group>
<Form.Group className='mb-3'>
<Form.Label>Banner URL</Form.Label>
<Form.Control
type='url'
placeholder='Enter URL to your banner picture (1024x768 pixels)'
name='banner'
value={formData.banner}
onChange={handleInputChange}
/>
</Form.Group>
<Form.Group className='mb-3'>
<Form.Check
type='checkbox'
label='This account is for a bot'
name='bot'
checked={formData.bot}
onChange={(e) => {
setFormData({
...formData,
bot: e.target.checked
})
setSuccessMsg('')
setErrorMsg('')
}}
/>
</Form.Group>
<div className='d-flex justify-content-center'>
{!onFetch && (
<Button variant='primary' type='submit' disabled={onFetch}>
@@ -34,6 +34,7 @@ function ProfileRead (props) {
pool.on('event', (relay, subId, ev) => {
console.log('Received event:', ev)
const profile = JSON.parse(ev.content)
console.log('Profile:', profile)
setPost(profile)
setProfile(profile)
})