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

Fix fancy link - issue #1160 #1164

Closed

Conversation

amankumarconnect
Copy link

✨ Codu Pull Request 💻

Fixes #1160

Pull Request details

  • Removed the .fancy-link and .fancy-link:hover classes from globals.css as part of the effort to follow the component-based styling approach promoted by Tailwind CSS.
  • Applied the styles directly to the components using .fancy-link, replacing them with the equivalent Tailwind classes:
    cursor-pointer bg-gradient-to-r from-orange-400 to-pink-600 bg-clip-text tracking-wide text-transparent hover:from-orange-300 hover:to-pink-500
  • Ensured that the hover effects and link styling remain consistent across all relevant components.

Any Breaking changes

None

Associated Screenshots

None

@amankumarconnect amankumarconnect requested a review from a team as a code owner October 21, 2024 10:06
Copy link
Contributor

coderabbitai bot commented Oct 21, 2024

Walkthrough

The pull request introduces several enhancements to various components in the application. Key updates include the implementation of image upload handling and improved error handling in the Create component, along with UI enhancements. Other components, such as GetStarted, ArticlePreview, CommentsArea, and EditorHints, primarily receive styling updates to align with a new gradient design while maintaining existing functionality. The global CSS file has been updated to remove the .fancy-link class, transitioning towards component-based styling.

Changes

File Path Change Summary
app/(app)/create/[[...paramsArr]]/_client.tsx Added image upload handling, improved error handling, updated form submission logic, enhanced UI for uploads, refined tag management, and dynamic URL generation.
app/(app)/get-started/_client.tsx Updated styling for the "return home" link with new utility classes; core functionality unchanged.
components/ArticlePreview/ArticlePreview.tsx Updated styling for the "Read full article" link to a gradient background; no functional changes.
components/Comments/CommentsArea.tsx Enhanced button styles for signing in and signing up with a gradient background; core functionality unchanged.
components/EditorHints/EditorHints.tsx Updated styling for anchor elements with a gradient background; no functional changes.
styles/globals.css Removed .fancy-link class and hover styles; organized styles under .old-input class using Tailwind CSS.

Assessment against linked issues

Objective Addressed Explanation
Remove the .fancy-link and .fancy-link:hover classes (1160)
Apply styles directly within relevant components (1160)

Possibly related PRs

Suggested labels

hacktoberfest-accepted, hacktoberfest

Suggested reviewers

  • NiallJoeMaher
  • John-Paul-Larkin

Poem

In a world where links once fancied,
Now styled with gradients, oh so chancy!
Image uploads, a breeze to share,
With error handling, we show we care.
From comments to articles, all in a row,
Our UI shines bright, ready to glow! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7a38bd7 and f6a61ce.

📒 Files selected for processing (3)
  • app/(app)/get-started/_client.tsx (1 hunks)
  • components/ArticlePreview/ArticlePreview.tsx (1 hunks)
  • components/Comments/CommentsArea.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/(app)/get-started/_client.tsx
  • components/ArticlePreview/ArticlePreview.tsx
  • components/Comments/CommentsArea.tsx

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

vercel bot commented Oct 21, 2024

@amankumarconnect is attempting to deploy a commit to the Codú Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Hello @amankumarconnect, thanks for opening your first Pull Request. The maintainers will review this Pull Request and provide feedback as soon as possible. Keep up the great work!

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: 1

🧹 Outside diff range and nitpick comments (1)
components/EditorHints/EditorHints.tsx (1)

41-43: LGTM: Consistent styling applied

The styling changes are consistent with the previous anchor element, which is good for maintaining visual consistency throughout the component.

However, consider refactoring these repeated class names into a custom Tailwind CSS class or a reusable React component to adhere to the DRY principle and improve maintainability.

Example refactoring:

  1. Create a custom Tailwind class in your tailwind.config.js:
module.exports = {
  theme: {
    extend: {
      // other extensions...
    },
  },
  plugins: [
    // other plugins...
    function({ addComponents, theme }) {
      addComponents({
        '.fancy-link': {
          '@apply cursor-pointer bg-gradient-to-r from-orange-400 to-pink-600 bg-clip-text tracking-wide text-transparent hover:from-orange-300 hover:to-pink-500': {}
        },
      })
    },
  ],
}
  1. Use the custom class in your component:
<a
  href="https://www.markdownguide.org/"
  target="_blank"
  rel="noopener noreferrer"
  className="fancy-link"
>
  markdownguide
</a>

This approach would centralize the styling definition while still keeping it component-specific, making future updates easier.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 77aa243 and 7a38bd7.

📒 Files selected for processing (6)
  • app/(app)/create/[[...paramsArr]]/_client.tsx (2 hunks)
  • app/(app)/get-started/_client.tsx (1 hunks)
  • components/ArticlePreview/ArticlePreview.tsx (1 hunks)
  • components/Comments/CommentsArea.tsx (1 hunks)
  • components/EditorHints/EditorHints.tsx (2 hunks)
  • styles/globals.css (0 hunks)
💤 Files with no reviewable changes (1)
  • styles/globals.css
✅ Files skipped from review due to trivial changes (1)
  • components/Comments/CommentsArea.tsx
🧰 Additional context used
🔇 Additional comments (3)
components/EditorHints/EditorHints.tsx (1)

32-34: LGTM: Successful transition to component-specific styling

The change from the global .fancy-link class to Tailwind CSS utility classes aligns perfectly with the PR objective of transitioning away from global styles. The new classes effectively replicate the previous styling while improving maintainability and making the component's appearance more explicit.

components/ArticlePreview/ArticlePreview.tsx (1)

148-148: Excellent implementation of component-based styling!

The updated className for the "Read full article" link successfully transitions away from global styles (.fancy-link) to component-specific Tailwind CSS classes. This change aligns perfectly with the PR objectives of moving towards a component-based styling approach.

The new styling effectively replicates and enhances the previous design, maintaining visual consistency while improving maintainability. The use of Tailwind CSS classes for gradients, text transparency, and hover effects demonstrates a good understanding of the framework's capabilities.

app/(app)/get-started/_client.tsx (1)

42-44: LGTM: Styling change aligns with PR objectives.

The modification to the "return home" link styling successfully transitions away from global styles, as outlined in the PR objectives. The new Tailwind CSS utility classes effectively replicate the fancy link appearance while keeping the styling component-specific. This change maintains consistency with other components mentioned in the PR summary.

@@ -796,7 +796,7 @@ const Create = () => {
href="https://www.markdownguide.org/"
target="_blank"
rel="noopener noreferrer"
className="fancy-link"
className="cursor-pointer bg-gradient-to-r from-orange-400 to-pink-600 bg-clip-text tracking-wide text-transparent hover:from-orange-300 hover:to-pink-500"
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Refactor repeated inline styles into a reusable component or class

The className attributes on lines 799 and 808 are identical and contain lengthy Tailwind CSS classes. To improve maintainability and reduce duplication, consider creating a reusable component or extracting these common styles into a custom utility class using Tailwind's @apply directive.

Also applies to: 808-808

Copy link
Member

@John-Paul-Larkin John-Paul-Larkin left a comment

Choose a reason for hiding this comment

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

Hey @amankumarconnect
Can you please run the prettier script, and commit the changes. Thanks.
npm run prettier:fix

@amankumarconnect
Copy link
Author

@John-Paul-Larkin I ran the script and committed the changes.
Kindly have a look

@NiallJoeMaher
Copy link
Contributor

Closing this as the author wasn't assigned the issue.

@amankumarconnect
Copy link
Author

My apologies, @NiallJoeMaher. I wasn’t aware that working on an already assigned issue wasn’t allowed. I mistakenly thought that the assignment would be given to whoever opened a PR first. Thank you for pointing that out!

@amankumarconnect
Copy link
Author

@NiallJoeMaher
Also, could you kindly add this information to the CONTRIBUTING.md to help prevent others from being labeled as "SPAM" for opening a PR without having the issue assigned? Thank you!

@NiallJoeMaher
Copy link
Contributor

@amankumarconnect I removed the spam label since it seems like an honest mistake. It's general knowledge in Open Source that you need to be assigned an issue to work on it to stop multiple people working on/rushing or racing to finish issues. Feel free to comment on another unassigned issue if you want to tackle it.

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.

Issue: Transitioning Away from Global Styles in globals.css
3 participants