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

feat(web): Sýslumenn footer changes #16945

Merged
merged 4 commits into from
Nov 20, 2024

Conversation

RunarVestmann
Copy link
Member

@RunarVestmann RunarVestmann commented Nov 19, 2024

Sýslumenn footer changes

Digital Iceland requested changes to "Sýslumenn" footer on the web.

  • Different links on main footer (displayed on /s/syslumenn and on articles belonging to organization)
  • Different title and background color on service web footer

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new background style for the footer, enhancing visual appeal.
    • Footer title and text color now dynamically adjust based on context, improving user experience.
    • Updated privacy policy link with a localized string for better clarity.
  • Bug Fixes

    • Simplified link handling for the privacy policy, ensuring accurate navigation.

@RunarVestmann RunarVestmann added the deploy-feature Deploys features to dev label Nov 19, 2024
@RunarVestmann RunarVestmann requested a review from a team as a code owner November 19, 2024 15:44
Copy link
Contributor

coderabbitai bot commented Nov 19, 2024

Walkthrough

The pull request introduces updates to the SyslumennFooter component and its associated styles. A new style for serviceWebFooterBg is added to the CSS file, while the TypeScript file sees modifications to enhance responsiveness based on the isServiceWeb context. This includes changes to the footer title, text color, and link handling for the privacy policy, alongside an updated interface for the HeaderLink component.

Changes

File Change Summary
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts Added new style serviceWebFooterBg for background color; added linkMaxWidth style for responsive design; existing styles remain unchanged.
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx Updated SyslumennFooter to include new variables for footer title and text color based on isServiceWeb; modified link handling and component props for dynamic color.

Possibly related PRs

Suggested reviewers

  • mannipje

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 36.43%. Comparing base (369c8cc) to head (c4d2268).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx 0.00% 11 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16945      +/-   ##
==========================================
+ Coverage   36.41%   36.43%   +0.01%     
==========================================
  Files        6898     6891       -7     
  Lines      144874   144728     -146     
  Branches    41404    41368      -36     
==========================================
- Hits        52755    52730      -25     
+ Misses      92119    91998     -121     
Flag Coverage Δ
web 1.76% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx 0.00% <0.00%> (ø)

... and 15 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 369c8cc...c4d2268. Read the comment docs.

---- 🚨 Try these New Features:

Copy link
Contributor

Affected services are: web,
Feature deployment of your services will begin shortly. Your feature will be accessible here:
https://web-syslumenn-footer-changes-beta.dev01.devland.is/

Deployed services: web.
Excluded services: ``

@datadog-island-is
Copy link

datadog-island-is bot commented Nov 19, 2024

Datadog Report

Branch report: feature/web-syslumenn-footer-changes
Commit report: 18cc435
Test service: web

✅ 0 Failed, 84 Passed, 0 Skipped, 36.06s Total Time
➡️ Test Sessions change in coverage: 1 no change

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (4)
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (1)

17-19: Add documentation for the new style.

The implementation looks good and follows the established patterns. Consider adding a comment to document the purpose and usage of this style.

+// Background style for service web footer variant
 export const serviceWebFooterBg = style({
   background: theme.color.purple100,
 })
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (3)

67-67: Consider extracting the color type for reusability

The color prop updates are consistent and type-safe. However, since keyof typeof theme.color is used multiple times, consider extracting it into a reusable type.

type ThemeColor = keyof typeof theme.color;

Also applies to: 77-77, 112-112


139-143: Simplify the color condition

The ternary operation for link color can be simplified.

-color={footerTextColor === 'white' ? 'white' : 'blue400'}
+color={footerTextColor === 'dark400' ? 'blue400' : 'white'}

140-143: Consider making the privacy policy URL configurable

The privacy policy URL is hardcoded in the localization key. Consider moving it to a configuration file for better maintainability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ed824e6 and eb03087.

📒 Files selected for processing (2)
  • apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (2 hunks)
  • apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (11 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (4)
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (1)

17-19: Verify color contrast accessibility.

Please ensure that the purple100 background color provides sufficient contrast with the text colors used in the footer for WCAG compliance.

apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (3)

17-17: LGTM! Clean variable declarations with good type safety

The new theme import and conditional variables enhance type safety and maintainability while following TypeScript best practices.

Also applies to: 47-50


179-179: LGTM! Well-typed interface extension

The HeaderLink interface update maintains type safety while providing good flexibility with the optional color prop.

Also applies to: 187-187


Line range hint 1-224: Verify client-side only code protection

While the component follows NextJS best practices, let's verify there's no client-side only code that needs protection.

@RunarVestmann RunarVestmann added deprecated:automerge (Disabled) Merge this PR as soon as all checks pass and removed deploy-feature Deploys features to dev labels Nov 20, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (1)

17-19: Consider adding a descriptive comment

The style implementation is clean and correctly uses the theme system. Consider adding a brief comment explaining when this background variant should be used.

+// Background style for service web variant of the footer
 export const serviceWebFooterBg = style({
   background: theme.color.purple100,
 })
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (1)

137-163: Consider extracting privacy policy link into a separate component

The privacy policy link section contains complex conditional rendering and styling logic. Consider extracting it into a dedicated component to improve maintainability and readability.

Example refactor:

interface PrivacyPolicyLinkProps {
  footerTextColor: keyof typeof theme.color;
  n: (key: string, defaultValue: string | boolean) => string;
}

const PrivacyPolicyLink: FC<PrivacyPolicyLinkProps> = ({ footerTextColor, n }) => {
  if (!n('showPrivacyPolicyLink', true)) return null;
  
  return (
    <Box marginTop={3} className={styles.linkMaxWidth}>
      <Link
        color={footerTextColor === 'white' ? 'white' : 'blue400'}
        href={n('privacyPolicyHref', '/s/syslumenn/personuverndarstefna-syslumanna')}
        skipTab
      >
        <Button
          size="small"
          colorScheme="negative"
          icon="arrowForward"
          variant="text"
          as="span"
        >
          {n('privacyPolicyLabel', 'Persónuverndarstefna Sýslumanna')}
        </Button>
      </Link>
    </Box>
  );
};
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between eb03087 and 723d857.

📒 Files selected for processing (2)
  • apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (2 hunks)
  • apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (10 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (6)
apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.css.ts (2)

1-3: LGTM! Clean import structure

The import statements follow TypeScript best practices and properly utilize the organization's UI theme package.


21-27: Verify the fixed maxWidth value

The responsive style implementation is correct, but please verify if the fixed 200px maxWidth for large screens is the intended design value.

apps/web/components/Organization/Wrapper/Themes/SyslumennTheme/SyslumennFooter.tsx (4)

17-17: LGTM! Type-safe theme implementation

The theme import and conditional variables are well-implemented with proper TypeScript type safety through the use of keyof typeof theme.color.

Also applies to: 47-50


67-67: LGTM! Consistent color implementation

The dynamic text color is consistently applied across all Text components, maintaining visual coherence based on the isServiceWeb context.

Also applies to: 77-77, 112-113


124-124: LGTM! Well-structured component enhancement

The HeaderLink component updates properly handle dynamic styling while maintaining type safety and localization support.

Also applies to: 135-135


183-183: LGTM! Well-typed interface extension

The HeaderLink interface is properly extended with the optional color prop, maintaining type safety with theme colors.

Also applies to: 191-191

@kodiakhq kodiakhq bot merged commit 5832eb7 into main Nov 20, 2024
30 checks passed
@kodiakhq kodiakhq bot deleted the feature/web-syslumenn-footer-changes branch November 20, 2024 10:40
jonnigs pushed a commit that referenced this pull request Nov 26, 2024
* Syslumenn footer changes

* Add max width to link

* Potentially hide privacy policy link

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants