Closed calebWei closed 10 months ago
Attempted to refactor bulky app class code from
{selectedTemplate === 'Template' && (
<Template
fontFile={selectedFontLeft}
googleFontData={googleFontLeft}
side="left"
lineHeight={lineHeightLeft}
fontFeatureOptions={fontFeatureOptionsLeft}
fontSettings={fontSettingsLeft}
template="Template"
/>
)}
{selectedTemplate === 'Article' && (
<Template
fontFile={selectedFontLeft}
googleFontData={googleFontLeft}
side="left"
lineHeight={lineHeightLeft}
fontFeatureOptions={fontFeatureOptionsLeft}
fontSettings={fontSettingsLeft}
template="Article"
/>
)}
{selectedTemplate === 'Research Paper' && (
<Template
fontFile={selectedFontLeft}
googleFontData={googleFontLeft}
side="left"
lineHeight={lineHeightLeft}
fontFeatureOptions={fontFeatureOptionsLeft}
fontSettings={fontSettingsLeft}
template="Template"
/>
)}
{selectedTemplate === 'Poster' && (
<Template
fontFile={selectedFontLeft}
googleFontData={googleFontLeft}
side="left"
lineHeight={lineHeightLeft}
fontFeatureOptions={fontFeatureOptionsLeft}
fontSettings={fontSettingsLeft}
template="Poster"
/>
)}
to:
<Template
fontFile={selectedFontLeft}
googleFontData={googleFontLeft}
side="left"
lineHeight={lineHeightLeft}
fontFeatureOptions={fontFeatureOptionsLeft}
fontSettings={fontSettingsLeft}
template={selectedTemplate}
/>
Refactor reverted because the change in selectedTemplate no longer triggers an update, thus rendering the dropdown menu non-functional.
Please feel free to give some advice to improving this template, as it feels quite basic at the moment.
Attempted to refactor bulky app class code from
{selectedTemplate === 'Template' && ( <Template fontFile={selectedFontLeft} googleFontData={googleFontLeft} side="left" lineHeight={lineHeightLeft} fontFeatureOptions={fontFeatureOptionsLeft} fontSettings={fontSettingsLeft} template="Template" /> )} {selectedTemplate === 'Article' && ( <Template fontFile={selectedFontLeft} googleFontData={googleFontLeft} side="left" lineHeight={lineHeightLeft} fontFeatureOptions={fontFeatureOptionsLeft} fontSettings={fontSettingsLeft} template="Article" /> )} {selectedTemplate === 'Research Paper' && ( <Template fontFile={selectedFontLeft} googleFontData={googleFontLeft} side="left" lineHeight={lineHeightLeft} fontFeatureOptions={fontFeatureOptionsLeft} fontSettings={fontSettingsLeft} template="Template" /> )} {selectedTemplate === 'Poster' && ( <Template fontFile={selectedFontLeft} googleFontData={googleFontLeft} side="left" lineHeight={lineHeightLeft} fontFeatureOptions={fontFeatureOptionsLeft} fontSettings={fontSettingsLeft} template="Poster" /> )}
to:
<Template fontFile={selectedFontLeft} googleFontData={googleFontLeft} side="left" lineHeight={lineHeightLeft} fontFeatureOptions={fontFeatureOptionsLeft} fontSettings={fontSettingsLeft} template={selectedTemplate} />
Refactor reverted because the change in selectedTemplate no longer triggers an update, thus rendering the dropdown menu non-functional.
PR #123 should make this possible
Please feel free to give some advice to improving this template, as it feels quite basic at the moment.
If you have the whitespace—perhaps allow comparing more than just two typefaces at once
Kudos, SonarCloud Quality Gate passed!
Changes
Tests applied
Issue ticket number(s)
Enter the issue numbers resolved by this pull request
Checklist