mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14:40:50 +01:00
Add ItemCountView
This commit is contained in:
parent
93146541db
commit
e7dfb381ff
6
src/views/shared/item-count/ItemCountView.scss
Normal file
6
src/views/shared/item-count/ItemCountView.scss
Normal file
@ -0,0 +1,6 @@
|
||||
.nitro-item-count {
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
font-size: 8px;
|
||||
z-index: 1;
|
||||
}
|
9
src/views/shared/item-count/ItemCountView.tsx
Normal file
9
src/views/shared/item-count/ItemCountView.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import { FC } from 'react';
|
||||
import { ItemCountViewProps } from './ItemCountView.types';
|
||||
|
||||
export const ItemCountView: FC<ItemCountViewProps> = props =>
|
||||
{
|
||||
const { count = 0 } = props;
|
||||
|
||||
return <div className="position-absolute badge border bg-danger px-1 rounded-circle nitro-item-count">{ count }</div>
|
||||
}
|
4
src/views/shared/item-count/ItemCountView.types.ts
Normal file
4
src/views/shared/item-count/ItemCountView.types.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface ItemCountViewProps
|
||||
{
|
||||
count: number;
|
||||
}
|
Loading…
Reference in New Issue
Block a user