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

added new icons #1323

Merged
merged 1 commit into from
Aug 23, 2024
Merged

added new icons #1323

merged 1 commit into from
Aug 23, 2024

Conversation

Swathi-eGov
Copy link
Contributor

No description provided.

@Swathi-eGov Swathi-eGov requested a review from a team as a code owner August 23, 2024 06:46
Copy link
Contributor

coderabbitai bot commented Aug 23, 2024

Walkthrough

Walkthrough

The recent changes involve the addition of multiple new SVG icon components to a React application. Icons such as Add, Profile, PdfIcon, DocIcon, XlsxIcon, JpgIcon, and PngIcon have been introduced, along with corresponding Storybook configurations for each. The updates include adjustments to export statements and the integration of prop type validation, ensuring consistency and usability across the application.

Changes

File(s) Change Summary
micro-ui/.../SVG.js Added exports for new icons: Add, Profile, PdfIcon, DocIcon, XlsxIcon, JpgIcon, PngIcon.
micro-ui/.../CHANGELOG.md Updated to version 1.0.11 noting the addition of new icons: Profile, Add, and File Icons.
micro-ui/.../index.js Included new SVG icons in the export statement.
micro-ui/.../svg/Add.js, .../DocIcon.js, .../JpgIcon.js, .../PdfIcon.js, .../PngIcon.js, .../Profile.js, .../XlsxIcon.js Introduced new components for each icon with customizable props and prop types validation.
micro-ui/.../svg/Add.stories.js, .../DocIcon.stories.js, .../JpgIcon.stories.js, .../PdfIcon.stories.js, .../PngIcon.stories.js, .../Profile.stories.js, .../XlsxIcon.stories.js Created Storybook configurations for each new icon component, providing default and playground stories for testing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant IconComponent
    participant Storybook

    User->>UI: Request to view icons
    UI->>IconComponent: Load new SVG icons
    IconComponent-->>UI: Render icons
    User->>Storybook: View icon stories
    Storybook-->>User: Display stories for icons
Loading

🐰 In a world of icons bright,
New friends hop into sight.
With Add and Profile, a joyful cheer,
Each click brings them near!
So explore and play, my dear friend,
In our SVG garden, fun won't end! 🌼


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

Outside diff range, codebase verification and nitpick comments (15)
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1)

16-23: Consider adding more argTypes for enhanced Storybook controls.

While the current setup is functional, consider expanding the argTypes to include more props that the Profile component might use. This will provide more interactive controls in Storybook.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1)

16-23: Consider adding more argTypes for enhanced Storybook controls.

Similar to the Profile component, consider expanding the argTypes to include more props that the DocIcon component might use. This will provide more interactive controls in Storybook.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1)

16-23: Consider adding more argTypes for enhanced Storybook controls.

As with the other components, consider expanding the argTypes to include more props that the JpgIcon component might use. This will provide more interactive controls in Storybook.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.stories.js (2)

1-14: Ensure consistent prop types and controls.

The argTypes configuration is minimal. Consider adding more props if PdfIcon supports additional props to enhance the Storybook documentation.


16-23: Consider adding more interactive examples.

The current stories provide a default and a playground example. Consider adding more interactive examples if the PdfIcon component supports additional props or states.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.stories.js (2)

1-14: Ensure consistent prop types and controls.

The argTypes configuration is minimal. Consider adding more props if PngIcon supports additional props to enhance the Storybook documentation.


16-23: Consider adding more interactive examples.

The current stories provide a default and a playground example. Consider adding more interactive examples if the PngIcon component supports additional props or states.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.stories.js (2)

1-14: Ensure consistent prop types and controls.

The argTypes configuration is minimal. Consider adding more props if XlsxIcon supports additional props to enhance the Storybook documentation.


16-23: Consider adding more interactive examples.

The current stories provide a default and a playground example. Consider adding more interactive examples if the XlsxIcon component supports additional props or states.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js (1)

1-38: LGTM! Consider using a default value for the style prop.

The component is well-structured, and the use of prop types is appropriate. Consider setting a default value for the style prop to ensure consistency.

Apply this diff to set a default value for the style prop:

 export const Profile = ({ className, style = {}, width = "32", height = "32" }) => (
-  <svg
-    className={className}
-    style={{ ...style }}
-    width={width}
-    height={height}
-    viewBox="0 0 64 64"
-    fill="none"
-    xmlns="http://www.w3.org/2000/svg"
-  >
+  <svg className={className} style={style} width={width} height={height} viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js (1)

1-38: LGTM! Consider using a default value for the style prop.

The component is well-structured, and the use of prop types is appropriate. Consider setting a default value for the style prop to ensure consistency.

Apply this diff to set a default value for the style prop:

 export const PdfIcon = ({ className, style = {}, width = "33", height = "36", fill = "none" }) => (
-  <svg
-    style={style}
-    width={width}
-    height={height}
-    viewBox="0 0 33 36"
-    fill={fill}
-    xmlns="http://www.w3.org/2000/svg"
-    className={className}
-  >
+  <svg style={style} width={width} height={height} viewBox="0 0 33 36" fill={fill} xmlns="http://www.w3.org/2000/svg" className={className}>
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js (1)

1-44: LGTM! Consider using a default value for the style prop.

The component is well-structured, and the use of prop types is appropriate. Consider setting a default value for the style prop to ensure consistency.

Apply this diff to set a default value for the style prop:

 export const XlsxIcon = ({ className, style = {}, width = "38", height = "38", fill = "none" }) => (
-  <svg style={style} width={width} height={height} viewBox="0 0 38 38" fill={fill} xmlns="http://www.w3.org/2000/svg" className={className}>
+  <svg style={style} width={width} height={height} viewBox="0 0 38 38" fill={fill} xmlns="http://www.w3.org/2000/svg" className={className}>
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1)

22-31: Consider adding more detailed prop type validation.

While the current prop types provide basic validation, consider using more specific types or default values for style to ensure consistency and prevent runtime errors.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1)

21-30: Consider adding more detailed prop type validation.

While the current prop types provide basic validation, consider using more specific types or default values for style to ensure consistency and prevent runtime errors.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1)

35-44: Consider adding more detailed prop type validation.

While the current prop types provide basic validation, consider using more specific types or default values for style to ensure consistency and prevent runtime errors.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1357b93 and 6342e1d.

Files ignored due to path filters (1)
  • micro-ui/web/micro-ui-internals/packages/svg-components/package.json is excluded by !**/*.json
Files selected for processing (17)
  • micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/CHANGELOG.md (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/index.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.stories.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.stories.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.stories.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.stories.js (1 hunks)
Additional context used
Path-based instructions (16)
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.stories.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/svg-components/src/index.js (1)

Pattern **/*.js: check

Additional comments not posted (13)
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1)

1-14: Storybook setup looks good.

The default export and component setup for Storybook are correctly configured.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1)

1-14: Storybook setup looks good.

The default export and component setup for Storybook are correctly configured.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1)

1-14: Storybook setup looks good.

The default export and component setup for Storybook are correctly configured.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.stories.js (1)

1-29: LGTM!

The Storybook configuration for the Add component is well-structured and follows best practices.

micro-ui/web/micro-ui-internals/packages/svg-components/CHANGELOG.md (1)

3-4: LGTM!

The changelog entry for version 1.0.11 is clear and consistent with previous entries.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js (1)

1-47: LGTM!

The Add component is well-implemented with prop types validation and default props. The use of the spread operator for additional props is a good practice.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1)

4-20: Ensure default prop values are appropriate.

The component provides default values for width, height, fill, and style. Ensure these defaults align with the design specifications and requirements.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1)

4-19: Ensure default prop values are appropriate.

The component provides default values for width, height, fill, and style. Ensure these defaults align with the design specifications and requirements.

micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1)

4-33: Ensure default prop values are appropriate.

The component provides default values for width, height, fill, and style. Ensure these defaults align with the design specifications and requirements.

micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js (2)

791-797: Ensure consistency in the export object.

The newly added icons Add, Profile, PdfIcon, DocIcon, XlsxIcon, JpgIcon, and PngIcon should maintain consistency with the existing export structure.

Ensure that the export object structure is consistent with the rest of the file.


2-8: Verify the availability of new icons in the package.

Ensure that the newly added icons Add, Profile, PdfIcon, DocIcon, XlsxIcon, JpgIcon, and PngIcon are available in the @egovernments/digit-ui-svg-components package.

Run the following script to verify the availability of these icons:

micro-ui/web/micro-ui-internals/packages/svg-components/src/index.js (2)

809-815: Ensure consistency in export statements.

The newly added icons (Add, Profile, PdfIcon, DocIcon, XlsxIcon, PngIcon, JpgIcon) are correctly included in the export list. Ensure that these components are used consistently across the application.


1-7: Verify import paths.

Ensure that the paths for the newly added SVG components (Add, Profile, PdfIcon, DocIcon, XlsxIcon, PngIcon, JpgIcon) are correct and that these files exist in the specified directory.

Run the following script to verify the existence of these files:

Verification successful

All import paths are correct.

The specified SVG component files (Add.js, Profile.js, PdfIcon.js, DocIcon.js, XlsxIcon.js, PngIcon.js, JpgIcon.js) exist in the directory ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/. The import paths in the code are correct.

  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js
  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js
  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js
  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js
  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js
  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js
  • ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of newly added SVG components.

# Test: Check if the SVG component files exist. Expect: All files should exist.
fd --type f --name "Add.js" --name "Profile.js" --name "PdfIcon.js" --name "DocIcon.js" --name "XlsxIcon.js" --name "PngIcon.js" --name "JpgIcon.js" ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/

Length of output: 454


Script:

#!/bin/bash
# Description: Verify the existence of newly added SVG components.

# Test: Check if the SVG component files exist. Expect: All files should exist.
fd --type f --regex "(Add|Profile|PdfIcon|DocIcon|XlsxIcon|PngIcon|JpgIcon)\.js" ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/

Length of output: 997

@jagankumar-egov jagankumar-egov merged commit 210eb0e into develop Aug 23, 2024
2 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