Skip to content

Commit

Permalink
feat(SkeletonIcon): Add types for SkeletonIcon (#14801)
Browse files Browse the repository at this point in the history
* refactor: added TypeScript types to SkeletonIcon

* docs: adding myself to contributors list

* refactor: added propTypes definition

* refactor: using shorthand for className property

* fix(SkeletonIcon): move className outside object

---------

Co-authored-by: Taylor Jones <[email protected]>
Co-authored-by: TJ Egan <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2023
1 parent 612f8b9 commit 2b69c08
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,16 @@
"contributions": [
"code"
]
},
{
"login": "amanlajpal",
"name": "Aman Lajpal",
"avatar_url": "https://avatars.githubusercontent.com/u/42869088?v=4",
"profile": "https://github.com/amanlajpal",
"contributions": [
"code",
"doc"
]
}
],
"commitConvention": "none"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
<td align="center"><a href="https://github.com/cordesmj"><img src="https://avatars.githubusercontent.com/u/7409239?v=4?s=100" width="100px;" alt=""/><br /><sub><b>cordesmj</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=cordesmj" title="Code">💻</a></td>
<td align="center"><a href="https://med-aziz-chebbi.web.app/"><img src="https://avatars.githubusercontent.com/u/60013060?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aziz Chebbi</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=azizChebbi" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/misiekhardcore"><img src="https://avatars.githubusercontent.com/u/58469680?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Michał Konopski</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=misiekhardcore" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/amanlajpal"><img src="https://avatars.githubusercontent.com/u/42869088?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aman Lajpal</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=amanlajpal" title="Code">💻</a> <a href="https://github.com/carbon-design-system/carbon/commits?author=amanlajpal" title="Documentation">📖</a></td>
</tr>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import { usePrefix } from '../../internal/usePrefix';

const SkeletonIcon = ({ className, ...other }) => {
interface SkeletonIconProps {
/**
* Specify an optional className to add.
*/
className?: string;

/**
* The CSS styles.
*/
style?: React.CSSProperties;
}

const SkeletonIcon: React.FC<SkeletonIconProps> = ({ className, ...other }) => {
const prefix = usePrefix();

const skeletonIconClasses = classNames({
const skeletonIconClasses = classNames(className, {
[`${prefix}--icon--skeleton`]: true,
[className]: className,
});

return <div className={skeletonIconClasses} {...other} />;
Expand Down

0 comments on commit 2b69c08

Please sign in to comment.