Skip to content

Commit 11de4b0

Browse files
authored
feat!: use Gravatar for default avatar (#6765)
- Fixes #6725 . Gravatar and custom avatar components. - Makes Gravatar the default
1 parent 0162560 commit 11de4b0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/payload/src/config/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Config } from './types.js'
22

33
export const defaults: Omit<Config, 'db' | 'editor' | 'secret'> = {
44
admin: {
5-
avatar: 'default',
5+
avatar: 'gravatar',
66
components: {},
77
custom: {},
88
dateFormat: 'MMMM do yyyy, h:mm a',

packages/ui/src/graphics/Account/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React from 'react'
55
import { useAuth } from '../../providers/Auth/index.js'
66
import { useConfig } from '../../providers/Config/index.js'
77
import { DefaultAccountIcon } from './Default/index.js'
8-
export { GravatarAccountIcon } from './Gravatar/index.js'
8+
import { GravatarAccountIcon } from './Gravatar/index.js'
99

1010
export const Account = () => {
1111
const {
@@ -22,4 +22,6 @@ export const Account = () => {
2222
const isOnAccountPage = pathname === `${adminRoute}${accountRoute}`
2323

2424
if (!user?.email || Avatar === 'default') return <DefaultAccountIcon active={isOnAccountPage} />
25+
if (Avatar === 'gravatar') return <GravatarAccountIcon />
26+
if (Avatar) return <Avatar active={isOnAccountPage} />
2527
}

0 commit comments

Comments
 (0)