typefaceoff / typefaceoff

Browser tool for facing off typefaces.
http://typefaceoff.github.io
MIT License
9 stars 13 forks source link

Feat/heading template #121

Closed calebWei closed 10 months ago

calebWei commented 10 months ago

Changes

Tests applied

Issue ticket number(s)

Enter the issue numbers resolved by this pull request

Checklist

calebWei commented 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.

calebWei commented 10 months ago

Please feel free to give some advice to improving this template, as it feels quite basic at the moment. image

jess-lowe commented 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.

PR #123 should make this possible

JamesNZL commented 10 months ago

Please feel free to give some advice to improving this template, as it feels quite basic at the moment. image

If you have the whitespace—perhaps allow comparing more than just two typefaces at once

sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication