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

Enhancement: Replace <img> tags with Next.js Image Component #824 #985

Closed
wants to merge 2 commits into from

Conversation

29deepanshutyagi
Copy link

Replaced all img HTML tags with the Image component across the codebase for better optimization and consistency.
Removed certain unnecessary configurations and added the error level to the ESLint configuration to enforce stricter code quality.
Ensured the changes pass linting and the build process before submission.
Removed outdated drafts and unnecessary files to streamline the project structure.

Changes are pushed through the img branch.

@29deepanshutyagi 29deepanshutyagi requested a review from a team as a code owner September 30, 2024 15:21
Copy link

github-actions bot commented Sep 30, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview c191528

@29deepanshutyagi 29deepanshutyagi changed the title img tag is replaced to Image Enhancement: Replace <img> tags with Next.js Image Component #824 Sep 30, 2024
@DarhkVoyd
Copy link
Member

Hey could you please link the related issue number in your description.

@29deepanshutyagi
Copy link
Author

29deepanshutyagi commented Oct 1, 2024

issue #824 , @DarhkVoyd

Copy link
Member

@DarhkVoyd DarhkVoyd left a comment

Choose a reason for hiding this comment

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

Hey! thanks for working on this issue.

  1. I just left a few comments on some individual changes, please consider those.
  2. More importantly, many of these changes will actually cause errors on pages, not limited to /docs and /tools which are two important pages, due the the fact that the next/image component expects width and height attributes which is missing from most of the instances.
    Note: The errors are suppressed in the production build so you will have to check/debug them in development.

@@ -53,7 +56,8 @@ module.exports = {
'keyword-spacing': ['error', { before: true, after: true }],
'comma-spacing': ['error', { before: false, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'@next/next/no-img-element': 'off',
// Change this rule from 'off' to 'error'
Copy link
Member

Choose a reason for hiding this comment

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

What is the need of this comment? This PR does change it to 'error'.

Copy link
Member

Choose a reason for hiding this comment

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

I do not understand the changes made to this component. Could you please explain how is this relevant to this PR?

src='/logo-white.svg'
alt=' logo-white'
className='h-4 mr-1.5'
/>{' '}
Copy link
Member

Choose a reason for hiding this comment

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

I believe {' '} is a unwanted spacing added by your formatter.

@@ -10,6 +10,8 @@ import { useTheme } from 'next-themes';
import DarkModeToggle from './DarkModeToggle';
import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment';
import ScrollButton from './ScrollButton';
import Image from 'next/image';
import { title } from 'process';
Copy link
Member

Choose a reason for hiding this comment

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

Why are we importing process.title, seems like a mistake?

Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need much of these simple comments.

@@ -8,7 +8,7 @@ import { SegmentHeadline } from './Layout';
import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment';
import CarbonAds from './CarbonsAds';
import { useTheme } from 'next-themes';
import ExternalLinkIcon from '../public/icons/external-link-black.svg';
Copy link
Member

Choose a reason for hiding this comment

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

Why was this removed?

@@ -206,7 +207,7 @@ const Home = (props: any) => {
const [airbnb_logo, setAirbnb_logo] = useState('');
const [postman_logo, setPostman_logo] = useState('');
const [itflashcards_logo, setItflashcards_logo] = useState('');
const [route4me_logo, setRoute4me_logo] = useState('');
Copy link
Member

Choose a reason for hiding this comment

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

Why do we no longer need this?

Copy link
Author

Choose a reason for hiding this comment

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

sure , i will resolve these issues and will raise pr soon

Copy link
Member

Choose a reason for hiding this comment

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

You don't have to close this PR, you can continue adding commits to this.

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