Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Apr 30, 2024
1 parent a57e0ac commit 864aa11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions ui-src/MissingFontsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
type MissingFontsSectionProps = {
missingFonts?: string[];
fonts?: string[];
};

export const MissingFontsSection = ({ missingFonts }: MissingFontsSectionProps) => {
if (missingFonts === undefined || !missingFonts.length) return;
export const MissingFontsSection = ({ fonts }: MissingFontsSectionProps) => {
if (fonts === undefined || !fonts.length) return;

return (
<section>
<div id="missing-fonts">
{missingFonts.length} missing font
{missingFonts.length > 1 ? 's' : ''}:{' '}
{fonts.length} missing font
{fonts.length > 1 ? 's' : ''}:{' '}
</div>
<small>Ensure fonts are installed in Penpot before exporting.</small>
<div id="missing-fonts-list">
<ul>
{Array.from(missingFonts).map(font => (
{Array.from(fonts).map(font => (
<li key={font}>{font}</li>
))}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion ui-src/PenpotExporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const PenpotExporter = () => {
<h2>Penpot Exporter</h2>
</header>
<Loader loading={!pluginReady} />
<MissingFontsSection missingFonts={missingFonts} />
<MissingFontsSection fonts={missingFonts} />
<footer>
<button className="brand" disabled={exporting || !pluginReady} onClick={exportPenpot}>
{exporting ? 'Exporting...' : 'Export to Penpot'}
Expand Down

0 comments on commit 864aa11

Please sign in to comment.