Merge pull request #28 from Permissionless-Software-Foundation/dh-profile-refactor

feat(nostr): Expanded profile properties
This commit is contained in:
Chris Troutner
2025-07-08 16:51:23 -07:00
committed by GitHub
2 changed files with 74 additions and 2 deletions
@@ -16,7 +16,12 @@ function ProfilePost (props) {
const { bchWalletState } = props.appData const { bchWalletState } = props.appData
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({
name: '', name: '',
about: '' about: '',
picture: '',
display_name: '',
website: '',
banner: '',
bot: false
}) })
const [errorMsg, setErrorMsg] = useState('') const [errorMsg, setErrorMsg] = useState('')
@@ -90,7 +95,12 @@ function ProfilePost (props) {
const resetForm = () => { const resetForm = () => {
setFormData({ setFormData({
name: '', name: '',
about: '' about: '',
picture: '',
display_name: '',
website: '',
banner: '',
bot: false
}) })
} }
@@ -137,6 +147,67 @@ function ProfilePost (props) {
/> />
</Form.Group> </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'> <div className='d-flex justify-content-center'>
{!onFetch && ( {!onFetch && (
<Button variant='primary' type='submit' disabled={onFetch}> <Button variant='primary' type='submit' disabled={onFetch}>
@@ -34,6 +34,7 @@ function ProfileRead (props) {
pool.on('event', (relay, subId, ev) => { pool.on('event', (relay, subId, ev) => {
console.log('Received event:', ev) console.log('Received event:', ev)
const profile = JSON.parse(ev.content) const profile = JSON.parse(ev.content)
console.log('Profile:', profile)
setPost(profile) setPost(profile)
setProfile(profile) setProfile(profile)
}) })