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

Code Review: Add props to all icons that can change their size #65

Open
jessedelira opened this issue Jun 4, 2024 · 0 comments
Open
Labels
good first issue Good for newcomers

Comments

@jessedelira
Copy link
Owner

In the code example below the X icon component is static and cannot be changed, this means if we wanted a different sized XIcon then we would need a different component. Since we want to reuse component, add props to all icons that include the string "h-? w-?"

Example Code

<XIcon height="5" width="5"/>

Production Code

const XIcon = () => {
	return (
		<svg
			xmlns="http://www.w3.org/2000/svg"
			viewBox="0 0 20 20"
			fill="currentColor"
			className="h-5 w-5"
		>
			<path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" />
		</svg>
	);
};

export default XIcon;
@jessedelira jessedelira added the good first issue Good for newcomers label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant