mirror of
https://github.com/Steffo99/bluelib.git
synced 2024-12-22 19:44:21 +00:00
🔧 Add option to disable console logging of todos
This commit is contained in:
parent
fdeefa09d3
commit
91e5497ddf
4 changed files with 9 additions and 8 deletions
|
@ -8,8 +8,8 @@ import mergeClassNames from "classnames"
|
||||||
export interface BoxProps extends PanelProps {}
|
export interface BoxProps extends PanelProps {}
|
||||||
|
|
||||||
|
|
||||||
export function Box({todo, ...props}: BoxProps): JSX.Element {
|
export function Box({todo, warn = true, ...props}: BoxProps): JSX.Element {
|
||||||
if(todo) {
|
if(todo && warn) {
|
||||||
console.warn(`TODO: ${props.children}`)
|
console.warn(`TODO: ${props.children}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import mergeClassNames from "classnames"
|
||||||
export interface DialogProps extends PanelProps {}
|
export interface DialogProps extends PanelProps {}
|
||||||
|
|
||||||
|
|
||||||
export function Dialog({todo, ...props}: DialogProps): JSX.Element {
|
export function Dialog({todo, warn = true, ...props}: DialogProps): JSX.Element {
|
||||||
if(todo) {
|
if(todo && warn) {
|
||||||
console.warn(`TODO: ${props.children}`)
|
console.warn(`TODO: ${props.children}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,12 @@ import mergeClassNames from "classnames"
|
||||||
|
|
||||||
export interface PanelProps extends Types.BluelibHTMLProps<HTMLElement> {
|
export interface PanelProps extends Types.BluelibHTMLProps<HTMLElement> {
|
||||||
todo?: boolean,
|
todo?: boolean,
|
||||||
|
warn?: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function Panel({todo, ...props}: PanelProps): JSX.Element {
|
export function Panel({todo, warn = true, ...props}: PanelProps): JSX.Element {
|
||||||
if(todo) {
|
if(todo && warn) {
|
||||||
console.warn(`TODO: ${props.children}`)
|
console.warn(`TODO: ${props.children}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import mergeClassNames from "classnames"
|
||||||
export interface ParenthesisProps extends PanelProps {}
|
export interface ParenthesisProps extends PanelProps {}
|
||||||
|
|
||||||
|
|
||||||
export function Parenthesis({todo, ...props}: ParenthesisProps): JSX.Element {
|
export function Parenthesis({todo, warn = true, ...props}: ParenthesisProps): JSX.Element {
|
||||||
if(todo) {
|
if(todo && warn) {
|
||||||
console.warn(`TODO: ${props.children}`)
|
console.warn(`TODO: ${props.children}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue