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

Feature/UI ux update #2731

Merged

Conversation

Abhi-MS
Copy link

@Abhi-MS Abhi-MS commented Feb 2, 2025

What kind of change does this PR introduce?

Fixed styling to match that of Talawa docs website. Added homepage.

Issue Number:

Fixes part of #2678

Did you add tests for your changes?

Visual testing was done. Tests are not required for docs folder

  • Tests are written for all changes made in this PR.
  • Test coverage meets or exceeds the current coverage (~90/95%).

Snapshots/Videos:

Talawa.mp4

If relevant, did you update the documentation?

Not relevant

Summary

This PR fixes the navbar and styling of Talawa mobile docs website (https://docs-mobile.talawa.io/). Also added a minimal homepage similar to the other docs websites.

Does this PR introduce a breaking change?

No.

Checklist for Repository Standards

  • Have you reviewed and implemented all applicable coderaabbitai review suggestions?
  • Have you ensured that the PR aligns with the repository’s contribution guidelines?

Other information

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • New Features

    • Rebranded the documentation site with a refreshed tagline, updated favicon, and streamlined navigation links.
    • Introduced a new homepage hero section showcasing a clear title, tagline, and prominent call-to-action buttons linking to documentation and GitHub.
    • Removed legacy homepage features and standalone markdown content for a more focused user experience.
  • Style

    • Revamped styling for enhanced responsiveness and dark mode support, with refined layouts and interactive element designs.

Copy link
Contributor

coderabbitai bot commented Feb 2, 2025

Walkthrough

This pull request rebrands and restructures the documentation site. The Docusaurus configuration is updated with a new tagline, favicon, navbar, and footer. Several homepage elements are removed (including the HomepageFeatures component and related styles) and replaced with new components (HeaderHero, ActionButton, HomeCallToAction) in the index page. Moreover, CSS files have been overhauled to update variables and support dark mode along with responsive design, and an unused markdown page has been removed.

Changes

Files Summary of Changes
docs/docusaurus.config.ts Updated config with new tagline, favicon, navbar items, and footer links to reflect rebranding.
docs/.../HomepageFeatures/* Removed the HomepageFeatures component, its type definitions, and associated styles (CSS modules and files).
docs/.../layout/HeaderHero.tsx Added a new HeaderHero component, rendering a banner with titles and a HomeCallToAction element.
docs/.../pages/index.tsx Overhauled the homepage by removing the old header and feature components and integrating the new HeaderHero component along with updated meta tags.
docs/.../css/*.css Updated CSS files: removed old CSS variable blocks, added new rules for responsiveness and dark mode, and modified navbar styles.
docs/.../pages/markdown-page.md Removed the standalone Markdown page.
docs/.../utils/*.tsx Added new utility components: ActionButton (with conditional styling and security attributes) and HomeCallToAction (rendering dual action buttons linking to docs and GitHub).

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant I as Homepage (Index)
    participant H as HeaderHero
    participant CTA as HomeCallToAction
    participant AB as ActionButton

    U->>I: Request homepage
    I->>H: Render HeaderHero component
    H->>CTA: Display call-to-action section
    CTA->>AB: Render ActionButton for Docs & GitHub
Loading

Suggested labels

ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes
  • noman2002
  • tasneemkoushar

Poem

In the code garden, I skip with glee,
New logos and headers set the scene for me.
Old features hop away to make room anew,
CSS blossoms in dark and light hues too.
I'm a rabbit, thrilled by the change, hopping into a bright view!
🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

github-actions bot commented Feb 2, 2025

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

Other

🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.

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

🧹 Nitpick comments (5)
docs/src/utils/HomeCallToAction.tsx (1)

1-30: Consider using environment variables for URLs.

The implementation is clean and follows best practices. However, consider moving the GitHub URL to an environment variable or configuration file for easier maintenance.

Example configuration:

// config.ts
export const GITHUB_URL = 'https://github.com/PalisadoesFoundation/talawa';

// HomeCallToAction.tsx
import { GITHUB_URL } from '../config';
docs/src/utils/ActionButton.tsx (2)

21-31: Consider adding rel="noreferrer" for all external links.

While the current implementation correctly handles rel for target="_blank", consider adding noreferrer for all external links (URLs starting with http/https) regardless of target.

-      rel={target === '_blank' ? 'noopener noreferrer' : undefined}
+      rel={href.startsWith('http') ? 'noopener noreferrer' : undefined}

3-10: Consider using const assertion for button types.

To make the type system more strict and prevent typos, consider using a const assertion for button types.

const BUTTON_TYPES = ['primary', 'secondary'] as const;
type ButtonType = typeof BUTTON_TYPES[number];

interface ActionButtonProps {
  href: string;
  type?: ButtonType;
  // ... rest of the props
}
docs/src/css/index.css (1)

7-67: LGTM! The CSS variables and dark mode support are well-structured.

The changes effectively support the UI/UX update:

  • Comprehensive set of variables for markdown styling
  • Well-structured dark mode support
  • Color scheme aligns with Talawa documentation

Consider adding CSS comments to document the purpose of each color variable group for better maintainability.

Add documentation comments for color variable groups:

 :root {
+  /* Markdown heading colors */
   --h1-markdown: #021526;
   --h2-markdown: #3a6d8c;
   --h3-markdown: #474e93;
   --h4-markdown: #508c9b;
   --h5-markdown: #6a9ab0;
   --h6-markdown: #888888;
   --hx-markdown-underline: #eeeeee;

+  /* Primary theme colors */
   --ifm-color-primary: #1e56e3;
   --ifm-color-primary-light: #33925d;
   --ifm-color-primary-lighter: #359962;
   --ifm-color-primary-lightest: #3cad6e;

+  /* Gray scale colors */
   --ifm-color-gray-100: #e3e3e6;
   /* ... other gray colors ... */

Also applies to: 71-116

docs/src/css/custom.css (1)

464-725: Optimize media queries by consolidating duplicate breakpoints.

The responsive design is well-implemented, but there are duplicate media query breakpoints that could be consolidated for better maintainability:

  • @media (max-width: 768px) appears twice (lines 464-468 and 651-664)
  • @media (min-width: 997px) and (max-width: 1327px) appears twice (lines 470-475 and 691-696)

Consolidate the duplicate media queries:

-@media (max-width: 768px) {
-  .container > div > div:first-child {
-    padding: 1rem !important;
-  }
-}

/* Small to Medium Screens */
@media only screen and (max-width: 768px) {
+  .container > div > div:first-child {
+    padding: 1rem !important;
+  }
  .center {
    text-align: center;
  }
  .HeaderHero .title {
    font-size: 60px;
  }
  .HeaderHero .tagline {
    font-size: 30px;
  }
}

-@media (min-width: 997px) and (max-width: 1327px) {
-  .container > div > div:first-child {
-    padding-left: 4rem !important;
-    padding-right: 4rem !important;
-  }
-}

/* Medium to Large Screens */
@media (min-width: 997px) and (max-width: 1327px) {
+  .container > div > div:first-child {
+    padding-left: 4rem !important;
+    padding-right: 4rem !important;
+  }
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ebad94 and e436354.

⛔ Files ignored due to path filters (2)
  • docs/static/img/icons/logo.png is excluded by !**/*.png
  • docs/static/img/logo.svg is excluded by !**/*.svg
📒 Files selected for processing (11)
  • docs/docusaurus.config.ts (2 hunks)
  • docs/src/components/HomepageFeatures/index.tsx (0 hunks)
  • docs/src/components/HomepageFeatures/styles.module.css (0 hunks)
  • docs/src/components/layout/HeaderHero.tsx (1 hunks)
  • docs/src/css/custom.css (12 hunks)
  • docs/src/css/index.css (1 hunks)
  • docs/src/pages/index.module.css (0 hunks)
  • docs/src/pages/index.tsx (1 hunks)
  • docs/src/pages/markdown-page.md (0 hunks)
  • docs/src/utils/ActionButton.tsx (1 hunks)
  • docs/src/utils/HomeCallToAction.tsx (1 hunks)
💤 Files with no reviewable changes (4)
  • docs/src/pages/markdown-page.md
  • docs/src/components/HomepageFeatures/styles.module.css
  • docs/src/pages/index.module.css
  • docs/src/components/HomepageFeatures/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Checking codebase
🔇 Additional comments (4)
docs/src/pages/index.tsx (1)

1-24: LGTM! Clean implementation with good SEO practices.

The new Index component is well-structured with proper meta tags for social sharing and SEO. The code follows React best practices with clear separation of concerns.

docs/src/components/layout/HeaderHero.tsx (1)

1-24: Great job on accessibility implementation!

The HeaderHero component demonstrates excellent use of semantic HTML and ARIA attributes:

  • Uses semantic section with role="banner"
  • Proper heading hierarchy (h1, h2)
  • ARIA relationships with aria-describedby
  • Navigation role with descriptive aria-label
docs/docusaurus.config.ts (1)

9-10: LGTM! The configuration changes align with the PR objectives.

The changes effectively enhance the documentation site's branding and navigation:

  • Updated tagline and favicon for better branding
  • Streamlined navbar with improved navigation links
  • Enhanced footer with comprehensive community and social media links

Also applies to: 60-66, 67-109, 112-167

docs/src/css/custom.css (1)

536-616: LGTM! The HeaderHero and ActionButton styles are well-designed.

The new styles effectively support the homepage redesign:

  • HeaderHero component has appropriate spacing and typography
  • ActionButton styles provide clear visual hierarchy
  • Hover states enhance interactivity

Copy link

codecov bot commented Feb 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.37%. Comparing base (3ebad94) to head (e436354).
Report is 1 commits behind head on develop-postgres.

Additional details and impacted files
@@                Coverage Diff                @@
##           develop-postgres    #2731   +/-   ##
=================================================
  Coverage             96.37%   96.37%           
=================================================
  Files                   189      189           
  Lines                 10020    10020           
=================================================
  Hits                   9657     9657           
  Misses                  363      363           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@palisadoes palisadoes merged commit a5e2559 into PalisadoesFoundation:develop-postgres Feb 2, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants