Skip to content

Commit 250a5dd

Browse files
author
Morgan Brown
committed
Fix splits display for ORCID receivers
1 parent c1b5d93 commit 250a5dd

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/lib/components/splits/components/split/split.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import type { SplitGroup, Splits, SplitsComponentSplitsReceiver } from '../../types';
2222
import type { SupportedChain } from '$lib/graphql/__generated__/base-types';
2323
import OrcidAvatar from '../../../../../routes/(pages)/app/(app)/orcids/[orcidId]/components/orcid-avatar.svelte';
24+
import OrcidBadge from '../../../../../routes/(pages)/app/(app)/orcids/[orcidId]/components/orcid-badge.svelte';
2425
2526
export let split: SplitsComponentSplitsReceiver | SplitGroup;
2627
export let disableLink = true;
@@ -108,6 +109,11 @@
108109
outline: true,
109110
},
110111
} as ComponentAndProps;
112+
case 'LinkedIdentityReceiver':
113+
return {
114+
component: OrcidAvatar,
115+
props: { size: 'small' },
116+
} as ComponentAndProps;
111117
}
112118
});
113119
}
@@ -217,9 +223,7 @@
217223
/>
218224
</PrimaryColorThemer>
219225
{:else if split.__typename === 'LinkedIdentityReceiver'}
220-
<!-- For now a hack since OrcidBadge needs an `OrcidAccount` which does not exist on `LinkedIdentityReceiver` ☹️ -->
221-
<OrcidAvatar />
222-
{split.linkedIdentity.orcid}
226+
<OrcidBadge {chainOverride} orcid={split.linkedIdentity} />
223227
{:else if split.__typename === 'SplitGroup'}
224228
<div
225229
class="group"

src/lib/components/splits/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,17 @@ export const SPLITS_COMPONENT_ORCID_RECEIVER_FRAGMENT = gql`
104104
weight
105105
linkedIdentity {
106106
... on OrcidLinkedIdentity {
107+
chain
108+
isClaimed
109+
areSplitsValid
107110
account {
108111
accountId
109112
}
110113
orcid
114+
orcidMetadata {
115+
givenName
116+
familyName
117+
}
111118
}
112119
}
113120
}

0 commit comments

Comments
 (0)