Monorepo for Tangled tangled.org

appview/pages: render a placeholder avatar when there's no did #896

merged opened by anirudh.fi targeting master from icy/tolqpt
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:hwevmowznbiukdf6uk5dwrrq/sh.tangled.repo.pull/3m7zpneazn422
-17
Interdiff #0 #1
-17
appview/pages/funcmap.go
··· 360 "fullAvatar": func(handle string) string { 361 return p.AvatarUrl(handle, "") 362 }, 363 - "placeholderAvatar": func(size string) template.HTML { 364 - sizeClass := "size-6" 365 - iconSize := "size-4" 366 - if size == "tiny" { 367 - sizeClass = "size-6" 368 - iconSize = "size-4" 369 - } else if size == "small" { 370 - sizeClass = "size-8" 371 - iconSize = "size-5" 372 - } else { 373 - sizeClass = "size-12" 374 - iconSize = "size-8" 375 - } 376 - icon, _ := p.icon("user-round", []string{iconSize, "text-gray-400", "dark:text-gray-500"}) 377 - return template.HTML(fmt.Sprintf(`<div class="%s rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center flex-shrink-0">%s</div>`, sizeClass, icon)) 378 - }, 379 "profileAvatarUrl": func(profile *models.Profile, size string) string { 380 return p.ProfileAvatarUrl(profile, size) 381 }, ··· 437 438 func (p *Pages) AvatarUrl(handle, size string) string { 439 handle = strings.TrimPrefix(handle, "@") 440 - 441 handle = p.resolveDid(handle) 442 443 secret := p.avatar.SharedSecret
··· 360 "fullAvatar": func(handle string) string { 361 return p.AvatarUrl(handle, "") 362 }, 363 "profileAvatarUrl": func(profile *models.Profile, size string) string { 364 return p.ProfileAvatarUrl(profile, size) 365 }, ··· 421 422 func (p *Pages) AvatarUrl(handle, size string) string { 423 handle = strings.TrimPrefix(handle, "@") 424 handle = p.resolveDid(handle) 425 426 secret := p.avatar.SharedSecret
appview/pages/templates/repo/commit.html

This file has not been changed.

appview/pages/templates/repo/index.html

This file has not been changed.

appview/pages/templates/repo/log.html

This file has not been changed.

History

6 rounds 1 comment
sign up or login to add to the discussion
1 commit
expand
appview/pages: render a placeholder avatar when there's no did
3/3 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
appview/pages: render a placeholder avatar when there's no did
3/3 success
expand
expand 0 comments
1 commit
expand
appview/pages: render a placeholder avatar when there's no did
3/3 success
expand
expand 0 comments
1 commit
expand
appview/pages: render a placeholder avatar when there's no did
3/3 success
expand
expand 0 comments
1 commit
expand
appview/pages: render a placeholder avatar when there's no did
expand 0 comments
1 commit
expand
appview/pages: render a placeholder avatar when there's no did
expand 1 comment

stack looks good to me!

Haven't tested yet. I should configure avatar service in my local setup to test this.