feat: add minimal flat Cloud shape component#94
feat: add minimal flat Cloud shape component#94shreyashpatel5506 wants to merge 13 commits intoashutosh1919:mainfrom
Conversation
✅ Deploy Preview for awesomeshapes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@shreyashpatel5506 Deploy preview fails |
Yes, the dependency conflict exists on main as well. |
|
If everything looks good, please review. |
|
@ashutosh1919 please check my pr |
There was a problem hiding this comment.
Pull request overview
This PR attempts to add a new Cloud shape component to the react-awesome-shapes library. However, the implementation does not follow the established patterns used by all other shapes in the codebase, creating significant API inconsistencies and maintainability concerns.
Changes:
- Added a new Cloud shape component using direct SVG rendering (instead of the BaseShape wrapper pattern)
- Exported Cloud component from library index
- Added Cloud to the shapes demo constants and display
- Included unrelated changes to footer component, configuration files, and build setup
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/shapes/cloudshape.tsx | New Cloud component with non-standard implementation pattern |
| src/lib/index.tsx | Exports Cloud using default export (inconsistent with other shapes) |
| src/constants/shapes.constant.ts | Adds Cloud to scope and example (with invalid gradient color) |
| src/components/demo/shapesdemos.tsx | Adds Cloud to demo display |
| src/components/layout/footer.tsx | Unrelated: Updates deprecated Themed.a to Link with security attributes |
| .npmrc | Unrelated: Adds legacy-peer-deps configuration |
| .vscode/settings.json | Unrelated: Adds VS Code PR settings |
| .github/workflows/lint-check.yml | Unrelated: Updates Node version and install command |
| .eslintrc.json | Unrelated: Adds ESLint rule for sx prop |
| package.json | Unrelated: Adds Babel plugin dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/lib/shapes/cloudshape.tsx
Outdated
| import React from 'react'; | ||
|
|
||
| interface CloudProps { | ||
| width?: number | string; | ||
| height?: number | string; | ||
| color?: string; | ||
| zIndex?: number; | ||
| } | ||
|
|
||
| const Cloud: React.FC<CloudProps> = ({ | ||
| width = '220px', | ||
| height = '120px', | ||
| color = '#E5E7EB', | ||
| zIndex = 1 | ||
| }) => { | ||
| return ( | ||
| <svg | ||
| aria-label="Minimal flat cloud shape" | ||
| height={height} | ||
| role="img" | ||
| style={{ zIndex }} | ||
| viewBox="0 0 220 120" | ||
| width={width} | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path | ||
| d=" | ||
| M60 90 | ||
| H150 | ||
| C175 90 190 75 190 60 | ||
| C190 45 175 35 160 38 | ||
| C155 22 138 15 122 22 | ||
| C112 8 90 10 82 25 | ||
| C65 25 50 38 50 55 | ||
| C35 58 30 70 30 80 | ||
| C30 88 40 90 60 90 | ||
| Z | ||
| " | ||
| fill={color} | ||
| /> | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default Cloud; |
There was a problem hiding this comment.
The Cloud component does not follow the established pattern used by other shapes in this codebase. All other shapes (Circle, Star, Heart, Arrow, Message, etc.) use the BaseShape wrapper component with styled-components and clip-path. This inconsistency creates maintenance issues and API incompatibility.
The Cloud component should:
- Use BaseShape wrapper for consistent positioning and responsive behavior
- Accept the standard ShapeProps or ShapeWithSize interface properties (top, left, right, bottom, position, className, breakpoints, zIndex as string)
- Use styled-components with clip-path or background for the shape rendering
- Follow the same pattern as other shapes for consistency
| export const cloudExample = `<Cloud | ||
| width="220px" | ||
| height="120px" | ||
| color="linear-gradient(135deg, #c7d2fe, #a5b4fc)" |
There was a problem hiding this comment.
The color value uses a CSS linear-gradient which is incompatible with the SVG fill attribute. SVG fill only accepts solid colors (like hex, rgb, or named colors), not CSS gradient syntax. The gradient will not render as expected. Use a solid color value like "#c7d2fe" instead, or implement gradient support using SVG gradient elements (linearGradient/radialGradient) if gradient rendering is desired.
|
can you merge it ? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| C30 88 40 90 60 90 | ||
| Z | ||
| " | ||
| fill={color} |
There was a problem hiding this comment.
The color prop is passed as the SVG fill attribute, so CSS gradient strings such as "linear-gradient(135deg, #c7d2fe, #a5b4fc)" (used in cloudExample) will have no visual effect. The SVG fill attribute does not support CSS gradient syntax — gradients in SVG must be defined using <linearGradient> or <radialGradient> defs. As a result, the demo example in shapes.constant.ts will render the Cloud as transparent/missing color instead of showing the intended gradient. Either the color prop should only accept plain CSS color values (and the demo example corrected), or the component needs to support SVG gradient defs to render gradients correctly.
|
@shreyashpatel5506 can you look at issues raised by copilot? |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
❌ Deploy Preview for awesomeshapes failed.
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
almost all are solved |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
✨ What’s added
aria-label🧪 Testing
📌 Notes
(framework-related). This PR does not introduce or modify dependencies
and focuses only on adding the Cloud shape component.