Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 👤 Implement gravatar #1268

Merged
merged 3 commits into from
Sep 27, 2023
Merged

feat: 👤 Implement gravatar #1268

merged 3 commits into from
Sep 27, 2023

Conversation

matthieujacq
Copy link
Contributor

@matthieujacq matthieujacq commented Sep 27, 2023

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Screenshots (if appropriate):

If the user already has a gravatar corresponding to her email :
image

Otherwise, the default :
image

@matthieujacq matthieujacq added enhancement New feature or request frontend labels Sep 27, 2023
@matthieujacq matthieujacq self-assigned this Sep 27, 2023
@matthieujacq matthieujacq temporarily deployed to preview September 27, 2023 08:47 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Sep 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 0:42am
quivr-strapi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 0:42am
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 0:42am

@dosubot dosubot bot added the area: frontend Related to frontend functionality or under the /frontend directory label Sep 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/chat/components/ChatsList/components/ChatsListItem/hooks/useGravatar.ts

The changes in this file are of moderate risk. The developer has added a new hook to compute the gravatar URL. However, the computeGravatarUrl function is called initially with no argument, which might not be the intended behavior. Consider passing the email from the session to the initial call.

const [gravatarUrl, setGravatarUrl] = useState<string>(computeGravatarUrl(session?.user.email));

🔍🔗🚫


Powered by Code Review GPT

domains: [
"www.quivr.app",
"quivr-cms.s3.eu-west-3.amazonaws.com",
"www.gravatar.com",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would also need to add the gravatar url to the ContentSecurityPolicy in frontend/next.config.js so it won't be blocked in preview and prod


return (
<Link aria-label="account" className={sidebarLinkStyle} href={"/user"}>
<MdPerson className="text-4xl" />
<div className="relative w-8 h-8">
<Image
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what happens when it doesnt exist on gravatar ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It displays a default image representing an anonymous user :
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: frontend Related to frontend functionality or under the /frontend directory enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants