-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/2 add badges #26
base: main
Are you sure you want to change the base?
Conversation
@aftabrehan please review. |
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.
Looks good to me. 👍
Just a minor changes. Good work. 💯
apps/views/pages/Badges.tsx
Outdated
import { Badge, PillBadges, ButtonBadges } from "kbs-core"; | ||
|
||
function Badges() { | ||
return ( | ||
<div> | ||
<Badge variant="primary" label="Primary" /> | ||
<Badge variant="Seconday" label="Badge" /> | ||
<Badge variant="Dark h1" label="Badge" /> | ||
<PillBadges variant="primary" label="Primary" /> | ||
<ButtonBadges buttonvariant="primary" labelvariant="light" label="2" /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Badges; |
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.
Move this in badge.ts
🙏
Use first letter capital only for components name, and just write your code in .ts
file. Thanks!
</span> | ||
); | ||
} | ||
export default PillBadges; |
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.
Rename this file as BadgePill.tsx
. 👉
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.
This makes much sense.
import React from "react"; | ||
import Badge from "./components/Badge"; | ||
import PillBadges from "./components/PillBadges"; | ||
import ButtonBadges from "./components/ButtonBadge"; | ||
export { Button, type ButtonProps } from "./Button"; |
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.
It's a good practice to have an empty line between imports & exports. 👍
export { Button, type ButtonProps } from "./Button"; | |
export { Button, type ButtonProps } from "./Button"; |
</button> | ||
); | ||
} | ||
export default ButtonBadges; |
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.
Can be it renamed as BadgeButton.tsx
.
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.
ok
@@ -0,0 +1,9 @@ | |||
function ButtonBadges(props: any) { | |||
return ( | |||
<button type="button" className={`btn btn-${props.buttonvariant}`}> |
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.
Use camelCase.
<button type="button" className={`btn btn-${props.buttonvariant}`}> | |
<button type="button" className={`btn btn-${props.buttonVariant}`}> |
return ( | ||
<button type="button" className={`btn btn-${props.buttonvariant}`}> | ||
Notifications | ||
<span className={`badge bg-${props.labelvariant}`}>{props.label}</span> |
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.
Again...
<span className={`badge bg-${props.labelvariant}`}>{props.label}</span> | |
<span className={`badge bg-${props.labelVariant}`}>{props.label}</span> |
Fixes #2