-
Notifications
You must be signed in to change notification settings - Fork 1
Staging #159
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
Staging #159
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,36 @@ | ||
| import "./styles.css"; | ||
|
|
||
| const ActionButton = ({ backgroundColor, color, text, width, onClick, margin }) => { | ||
| const buttonStyle = { | ||
| backgroundColor: backgroundColor || "#000000", | ||
| color: color || "#FFFFFF", | ||
| borderRadius: "6px", | ||
| padding: "10px 20px", | ||
| fontWeight: 500, | ||
| fontSize: "20px", | ||
| border: "none", | ||
| cursor: "pointer", | ||
| width: width || "auto", | ||
| margin: margin || "0px", | ||
| }; | ||
| const ActionButton = ({ | ||
| backgroundColor, | ||
| color, | ||
| text, | ||
| width, | ||
| onClick, | ||
| margin, | ||
| className = "", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Defaulting className to an empty string may cause confusion. Default className to undefined and only append it when truthy to avoid empty class attributes and expose missing class names. |
||
| }) => { | ||
| const useInlineStyles = !className; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: The logic for useInlineStyles may not work as intended if className is an empty string. With className defaulting to '', !className is always true, so inline styles always apply. Check for a non-empty string instead. |
||
|
|
||
| return <button style={buttonStyle} onClick={onClick}>{text}</button>; | ||
| const buttonStyle = useInlineStyles | ||
| ? { | ||
| backgroundColor: backgroundColor || "#000000", | ||
| color: color || "#FFFFFF", | ||
| borderRadius: "6px", | ||
| padding: "10px 20px", | ||
| fontWeight: 500, | ||
| fontSize: "20px", | ||
| border: "none", | ||
| cursor: "pointer", | ||
| width: width || "auto", | ||
| margin: margin || "0px", | ||
| } | ||
| : { width, margin }; | ||
|
|
||
| return ( | ||
| <button className={`${className}`} style={buttonStyle} onClick={onClick}> | ||
| {text} | ||
| </button> | ||
| ); | ||
| }; | ||
|
|
||
| export default ActionButton; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Consider standardizing diagram image filename.
The '2.0' suffix isn’t needed unless you’re tracking versions for display. Rename to
Component Diagram.pngto match other filenames likeERD.pngandFlow Diagram.png.