@ -3,30 +3,25 @@ GiftedDialog.vue to handle person entity display * with selection states and
conflict detection . * * @ author Matthew Raymer * /
conflict detection . * * @ author Matthew Raymer * /
< template >
< template >
< li :class ="cardClasses" @click ="handleClick" >
< li :class ="cardClasses" @click ="handleClick" >
< div class = "relative w-fit mx-auto" >
< div >
< EntityIcon
< EntityIcon
v - if = "person.did"
v - if = "person.did"
: contact = "person"
: contact = "person"
class = "!size-[3rem] mx-auto border border-slate-300 bg-white overflow-hidden rounded-full mb-1 "
class = "!size-[2rem] border border-slate-300 bg-white overflow-hidden rounded-full"
/ >
/ >
< font -awesome
< font -awesome
v - else
v - else
icon = "circle-question"
icon = "circle-question"
class = "text-slate-400 text-5xl mb-1"
class = "text-slate-400 text-5xl mb-1"
/ >
/ >
<!-- Time icon overlay for contacts -- >
< div
v - if = "person.did && showTimeIcon"
class = "rounded-full bg-slate-400 absolute bottom-0 right-0 p-1 translate-x-1/3"
>
< font -awesome icon = "clock" class = "block text-white text-xs w-[1em]" / >
< / div >
< / div >
< / div >
< h3 :class ="nameClasses" >
< div class = "overflow-hidden" >
{ { displayName } }
< h3 :class ="nameClasses" >
< / h3 >
{ { displayName } }
< / h3 >
< p class = "text-xs text-slate-500 truncate" > { { person . did } } < / p >
< / div >
< / li >
< / li >
< / template >
< / template >
@ -81,29 +76,32 @@ export default class PersonCard extends Vue {
* Computed CSS classes for the card
* Computed CSS classes for the card
* /
* /
get cardClasses ( ) : string {
get cardClasses ( ) : string {
const baseCardClasses =
"flex items-center gap-2 px-2 py-1.5 border-b border-slate-300" ;
if ( ! this . selectable || this . conflicted ) {
if ( ! this . selectable || this . conflicted ) {
return "opacity-50 cursor-not-allowed" ;
return ` ${ baseCardClasses } *:opacity-50 cursor-not-allowed ` ;
}
}
return "cursor-pointer hover:bg-slate-50" ;
return ` ${ baseCardClasses } cursor-pointer hover:bg-slate-50 ` ;
}
}
/ * *
/ * *
* Computed CSS classes for the person name
* Computed CSS classes for the person name
* /
* /
get nameClasses ( ) : string {
get nameClasses ( ) : string {
const baseClasses =
const baseNameClasses = "text-sm font-semibold truncate" ;
"text-xs font-medium text-ellipsis whitespace-nowrap overflow-hidden" ;
if ( this . conflicted ) {
if ( this . conflicted ) {
return ` ${ baseClasses } text-slate-4 00 ` ;
return ` ${ baseName Classes } text-slate-5 00 ` ;
}
}
/ / A d d i t a l i c s t y l i n g f o r e n t i t i e s w i t h o u t s e t n a m e s
/ / A d d i t a l i c s t y l i n g f o r e n t i t i e s w i t h o u t s e t n a m e s
if ( ! this . person . name ) {
if ( ! this . person . name ) {
return ` ${ baseClasses } italic text-slate-500 ` ;
return ` ${ baseName Classes } italic text-slate-500 ` ;
}
}
return baseClasses ;
return baseName Classes ;
}
}
/ * *
/ * *