Skip to content

Commit

Permalink
fix icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolie Rabideau authored and Jolie Rabideau committed Sep 21, 2023
1 parent 5bd9539 commit d71b1d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ export default function ExtensionCard({
children,
}: ExtensionCardProps) {
const avatar = useMemo(
() =>
iconFilePath ? (
<Avatar variant="square" src={iconFilePath} alt={extensionDescription} />
) : null,
[extensionDescription, iconFilePath],
() => (
<Avatar variant="square" src={iconFilePath ?? undefined} alt={extensionDescription}>
{!iconFilePath ? extensionName[0] : null}
</Avatar>
),
[extensionDescription, extensionName, iconFilePath],
);

const isGallery = useMemo(() => className && className === 'square', [className]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type Extension = {
/**
* File path to the extensions icon
*/
filePath?: string;
iconFilePath?: string;
};

type ExtensionListProps = Omit<ExtensionToggleProps, 'extensionName' | 'extensionDescription'> &
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function ExtensionList({
<ExtensionToggle
className={extensionToggleClassName}
key={ext.name}
iconFilePath={hasIcons ? ext.filePath : undefined}
iconFilePath={hasIcons ? ext.iconFilePath : undefined}
extensionName={ext.name}
extensionDescription={ext.description}
toggledExtensionNames={toggledExtensionNames}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,49 @@ export function fetchExtensions(): Extension[] {
description: 'Edit Scripture Text',
hasUpdateAvailable: false,
isInstalled: true,
filePath: undefined,
iconFilePath: undefined,
} as Extension,
{
name: 'Resource Viewer',
description: 'View Scripture resources',
hasUpdateAvailable: false,
isInstalled: true,
filePath: undefined,
iconFilePath: undefined,
} as Extension,
{
name: 'Parallel Passages',
description: 'Compare parallel passages of Scripture',
hasUpdateAvailable: true,
isInstalled: true,
filePath: undefined,
iconFilePath: undefined,
} as Extension,
{
name: 'Psalms layer-by-layer',
description: 'Provide resources on the Psalms from Cambridge Digital Bible Research',
hasUpdateAvailable: true,
isInstalled: true,
filePath: undefined,
iconFilePath: undefined,
} as Extension,
{
name: 'Hello World',
description: 'Example Bundled Extension',
hasUpdateAvailable: false,
isInstalled: true,
filePath: undefined,
hasUpdateAvailable: true,
isInstalled: false,
iconFilePath: undefined,
} as Extension,
{
name: 'Hello Someone',
description: 'Example Bundled Extension',
hasUpdateAvailable: true,
isInstalled: false,
filePath: undefined,
iconFilePath: undefined,
} as Extension,
{
name: 'Quick Verse',
description: 'Example Bundled Extension',
hasUpdateAvailable: false,
isInstalled: false,
filePath: 'papi-extension://quick-verse/assets/letter-q.png',
iconFilePath: 'papi-extension://quick-verse/assets/letter-q.png',
} as Extension,
];
}
Expand Down

0 comments on commit d71b1d1

Please sign in to comment.