-
Notifications
You must be signed in to change notification settings - Fork 4
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
UI updates/ Launch Lessons page #12647
Changes from 1 commit
d4b14b0
7e69ac9
b736c48
f713e25
1bb2cd3
f61779d
2d43d4d
32fe205
f23bc1e
1868360
555d705
4d97cd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,11 @@ interface DataTableChipProps { | |
src: string | ||
}, | ||
label: string, | ||
link?: string | ||
link?: string, | ||
onClick?: () => void | ||
} | ||
|
||
export const DataTableChip = ({ color, icon, label, link }: DataTableChipProps) => { | ||
export const DataTableChip = ({ color, icon, label, link, onClick }: DataTableChipProps) => { | ||
if(link) { | ||
return( | ||
<a className={`data-table-chip ${color} focus-on-light`} href={link}> | ||
|
@@ -19,6 +20,14 @@ export const DataTableChip = ({ color, icon, label, link }: DataTableChipProps) | |
</a> | ||
) | ||
} | ||
if (onClick) { | ||
return ( | ||
<button className={`data-table-chip ${color} focus-on-light`} onClick={onClick}> | ||
{icon && <img alt={icon.alt} src={icon.src} />} | ||
<p>{label}</p> | ||
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. I think a 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. ok! I'll make that change. Thank you for the context |
||
</button> | ||
) | ||
} | ||
return ( | ||
<div className={`data-table-chip ${color}`}> | ||
{icon && <img alt={icon.alt} src={icon.src} />} | ||
|
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.
Probably need a button type declaration here for the linter, right?