mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
refactor: rename webhook badge and make configurable
This commit is contained in:
parent
454d27f18c
commit
c33a1de54e
|
@ -7,6 +7,7 @@ import { IMenuItem, OperationModel } from '../../services';
|
|||
import { shortenHTTPVerb } from '../../utils/openapi';
|
||||
import { MenuItems } from './MenuItems';
|
||||
import { MenuItemLabel, MenuItemLi, MenuItemTitle, OperationBadge } from './styled.elements';
|
||||
import { l } from '../../services/Labels';
|
||||
|
||||
export interface MenuItemProps {
|
||||
item: IMenuItem;
|
||||
|
@ -91,7 +92,7 @@ export class OperationMenuItemContent extends React.Component<OperationMenuItemC
|
|||
ref={this.ref}
|
||||
>
|
||||
{item.isWebhook ? (
|
||||
<OperationBadge type="hook">hook</OperationBadge>
|
||||
<OperationBadge type="hook">{l('webhook')}</OperationBadge>
|
||||
) : (
|
||||
<OperationBadge type={item.httpVerb}>{shortenHTTPVerb(item.httpVerb)}</OperationBadge>
|
||||
)}
|
||||
|
|
|
@ -8,6 +8,7 @@ export interface LabelsConfig {
|
|||
nullable: string;
|
||||
recursive: string;
|
||||
arrayOf: string;
|
||||
webhook: string;
|
||||
}
|
||||
|
||||
export type LabelsConfigRaw = Partial<LabelsConfig>;
|
||||
|
@ -22,6 +23,7 @@ const labels: LabelsConfig = {
|
|||
nullable: 'Nullable',
|
||||
recursive: 'Recursive',
|
||||
arrayOf: 'Array of ',
|
||||
webhook: 'Event',
|
||||
};
|
||||
|
||||
export function setRedocLabels(_labels?: LabelsConfigRaw) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user