Reading photo with react from solid.community


#1

I’m looking at the demo app from https://github.com/solid/react-components
and login and displaying user’s name works fine. How do I read/display photos I have in my card? In react example code photo is referred as

<Image src=“user.image” defaultSrc=“profile.svg” className=“profile”/>

That doesn’t load photo. Photos are save in solid.community profile as vcard:hasPhoto, or as label “has photo”. Using “has photo” didn’t work either.


#2

How did you compose the microquery for hasPhoto? I do not believe ldflex has an alias for hasPhoto directly so I think the query might look something like src=“user.vcard_hasPhoto”.

You can test ldflex microqueries using the playground, which let’s you experiment with ldflex and shows you the underlying sparql as well:

https://solid.github.io/ldflex-playground


#3

Ah, missed that part, so didn’t make any microquery yet…


#4

This works:

<Image
src={[${activeProfile}].vcard_hasPhoto}
className=“pic”
/>