Greenstand / treetracker-web-map-client

The front end of the treetracker web map app.
http://map.treetracker.org
GNU Affero General Public License v3.0
64 stars 180 forks source link

The like component and function #310

Closed dadiorchen closed 2 years ago

dadiorchen commented 2 years ago

We still don't have a login account on the website, so we are considering using the 3rd-party function for this, for example, the Facebook like, so this issue is about building the component and integrating the 3rd-party like button into our tree photo.

Screen Shot 2021-11-26 at 4 53 40 PM

Some hints for building components:

cavesdev commented 2 years ago

Hello! I want to work on this. Just to be clear, do you mean integrating a third party button like this? 143554033-e7f9ab60-da97-403e-a109-92e1d12d7bc3

Or using the same button?

dadiorchen commented 2 years ago

My original idea is to adopt a 3rd party service like facebook, but with a customized appearance, what do you think?

cavesdev commented 2 years ago

Now that I think of it... Using Facebook (for example) as a third party service provider would mean that the like button would have to be linked in some way to a photo or page inside Facebook. I think it falls outside the scope to keep a Facebook page up to date with the photos. Is there plans to add treetracker accounts? maybe we can wait until then to implement a like or favorite button.

dadiorchen commented 2 years ago

Do we just need an account of FB and a homepage then we can implement this feature, or we need to copy all the photos to FB?

dadiorchen commented 2 years ago

I found this: https://developers.facebook.com/docs/plugins/like-button/

cavesdev commented 2 years ago

Doing further testing, I think that the plugin uses the URL to track the like count. In the web-map-site branch, every tree has a unique URL so it can be possible to implement it, the caveat is that users must have a Facebook account to give likes.

Also, I have not found a way yet to customize the like button further than the basic options provided. The blue and white colors are too different from the actual theme, so I think they won't sit well there. I will keep looking for customization options

dadiorchen commented 2 years ago

good progress, thanks @cavesdev ! yes, I think requiring FB account is acceptable, considering it's the biggest social media.

I had that worry too, I think we can just try the best to do it, if we can't eventually, it's fine to display the Facebook-style button on the position.

cavesdev commented 2 years ago

Apparently, according to Facebook's Policy, the brand's assets cannot be changed further than the customization options provided (almost none). Additionally, the like button plugin builds the component on Facebook's side, so customization is also not possible. So, it seems that we are bound to using the Facebook's traditional like button.

It would look like this:

Screen Shot 2022-01-03 at 12 40 25

dadiorchen commented 2 years ago

Great, can you raise a PR for this, I think it is worth a try for us, do I need to give you any FB account stuff?

cavesdev commented 2 years ago

No extra data is needed. The only requirement is that users must have a FB account to like a tree.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.15.0-beta.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: