-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edcc8bb
commit 643c310
Showing
90 changed files
with
525 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import * as React from 'react'; | ||
import { classNames } from '@vkontakte/vkjs'; | ||
import { HTMLAttributesWithRootRef } from '../../types'; | ||
import { RootComponent } from '../RootComponent/RootComponent'; | ||
import styles from './Badge.module.css'; | ||
|
||
const stylesMode = { | ||
new: styles['Badge--mode-new'], | ||
prominent: styles['Badge--mode-prominent'], | ||
}; | ||
|
||
export interface BadgeProps extends React.HTMLAttributes<HTMLElement> { | ||
export interface BadgeProps extends HTMLAttributesWithRootRef<HTMLSpanElement> { | ||
mode: 'new' | 'prominent'; | ||
} | ||
|
||
/** | ||
* @see https://vkcom.github.io/VKUI/#/Badge | ||
*/ | ||
export const Badge = ({ mode = 'new', className, ...restProps }: BadgeProps) => ( | ||
<span className={classNames(styles['Badge'], stylesMode[mode], className)} {...restProps} /> | ||
export const Badge = ({ mode = 'new', ...restProps }: BadgeProps) => ( | ||
<RootComponent | ||
Component="span" | ||
baseClassName={classNames(styles['Badge'], stylesMode[mode])} | ||
{...restProps} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.