Skip to content

Commit d883408

Browse files
committed
Cleanup refactor work
1 parent 493e4b5 commit d883408

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

.changeset/heavy-donuts-bow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'@openproject/primer-view-components': minor
2+
'@openproject/primer-view-components': major
33
---
44

55
Add `Primer::OpenProject::AvatarWithFallback` component with client-side fallback rendering. When no image src is provided, renders an SVG with user initials and consistent colors generated client-side by the AvatarFallbackElement web component. Extends `Primer::Beta::Avatar` without modifying upstream behavior.

app/components/primer/open_project/avatar_fallback.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { attr, controller } from '@github/catalyst'
1+
import {attr, controller} from '@github/catalyst'
22

33
@controller
44
export class AvatarFallbackElement extends HTMLElement {
55
@attr uniqueId = ''
66
@attr altText = ''
77

88
connectedCallback() {
9-
if (!this.uniqueId || !this.altText) {
10-
console.warn('AvatarFallbackElement: uniqueId and altText attributes are required for proper fallback rendering')
11-
return
12-
}
9+
if (!this.uniqueId || !this.altText) return
1310

1411
const fallbackSvg = this.querySelector('svg[role="img"]')
1512
if (!fallbackSvg) return
@@ -69,5 +66,3 @@ export class AvatarFallbackElement extends HTMLElement {
6966
return hash % 360
7067
}
7168
}
72-
73-
// Custom element registration is handled automatically by the @controller decorator

app/components/primer/open_project/avatar_with_fallback.pcss

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)