@ -25,18 +25,20 @@ export const renderViewTemplate = (options: ViewTemplateOptions) => {
switch ( options . type ) {
case 'profile' :
const pubkey = options . id ;
const detail = elem ( 'p' , { data : { 'profileDetails' : pubkey } } ) ;
dom [ ` detail- ${ pubkey } ` ] = detail ;
const header = elem ( 'header' , { className : 'hero' } , [
elem ( 'small' , { } , nip19 . npubEncode ( pubkey ) ) ,
elem ( 'h1' , { } , pubkey ) ,
const detail = elem ( 'p' ) ;
const following = elem ( 'span' ) ;
const profileHeader = elem ( 'header' , { className : 'hero' } , [
elem ( 'small' , { className : 'hero-npub' } , nip19 . npubEncode ( pubkey ) ) ,
elem ( 'div' , { className : 'hero-title' } , [
elem ( 'h1' , { } , pubkey ) ,
] ) ,
detail ,
elem ( 'footer' , { } , [
elem ( 'span' , { data : { following : pubkey } } )
] )
elem ( 'footer' , { } , following ) ,
] ) ;
dom [ pubkey ] = header ;
content . append ( header ) ;
dom . header = profileHeader ;
dom . detail = detail ;
dom . following = following ;
content . append ( profileHeader ) ;
document . title = pubkey ;
break ;
case 'note' :
@ -45,14 +47,14 @@ export const renderViewTemplate = (options: ViewTemplateOptions) => {
break ;
case 'event' :
const id = options . id ;
const eventHeader = elem ( 'header' , { className : 'hero' } , [
elem ( 'h 1', { } , id ) ,
] ) ;
dom [ id ] = eventHeader ;
content . append ( eventHeader ) ;
content . append (
elem ( 'h eader', { className : 'hero' } , [
elem ( 'h1' , { } , id ) ,
] )
) ;
document . title = id ;
break ;
}
const view = elem ( 'section' , { className : 'view' } , [ content ] ) ;
return { content , dom , view } ;
} ;
} ;