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

updated cardperson and circleInitials #481

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/molecules/card/favoriteEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function CardFavoriteEntity({
case 'Collection':
return <CardCollection collection={entity} />;
case 'Person':
return <CardPerson person={entity} />;
return <CardPerson person={entity} midinit={true} />;
case 'Recording':
return <CardRecording recording={entity} />;
case 'Sequence':
Expand Down
4 changes: 3 additions & 1 deletion src/components/molecules/card/inferred.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const Typename = {
export default function CardInferred({ entity }: { entity: InferrableEntity }) {
switch (entity.__typename) {
case Typename.Person:
return <CardPerson person={entity as CardPersonFragment} />;
return (
<CardPerson person={entity as CardPersonFragment} midinit={true} />
);
case Typename.Recording:
return <CardRecording recording={entity as CardRecordingFragment} />;
case Typename.Sequence:
Expand Down
13 changes: 12 additions & 1 deletion src/components/molecules/card/person.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ import styles from './person.module.scss';
interface CardCollectionProps {
person: CardPersonFragment;
compact?: boolean;
largeinit?: boolean;
midinit?: boolean;
smallinit?: boolean;
}

export default function CardPerson({
person,
compact = false,
largeinit = false,
midinit = false,
smallinit = false,
}: CardCollectionProps): JSX.Element {
const { isFavorited, toggleFavorited } = useIsPersonFavorited(person.id);
const { canonicalPath, image, name, recordings } = person;
Expand All @@ -39,7 +45,12 @@ export default function CardPerson({
<RoundImage image={image.url} alt={name} large={compact} />
</div>
) : (
<CircleInitials name={name} large={true} />
<CircleInitials
name={name}
large={largeinit}
mid={midinit}
small={smallinit}
/>
)}
{name}
</Heading2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Presenters(props: {
})}
seeAllUrl={root.lang(lang).presenters.get()}
Card={(p: { node: CardPersonFragment }) => (
<CardPerson person={p.node} compact />
<CardPerson person={p.node} compact largeinit={true} />
)}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/collection/presenters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function CollectionPresenters({
</LineHeading>
<CardGroup>
{nodes.map((node) => (
<CardPerson person={node} key={node.canonicalPath} />
<CardPerson person={node} key={node.canonicalPath} midinit={true} />
))}
</CardGroup>
<Pagination
Expand Down