mirror of
https://github.com/Steffo99/bluelib.git
synced 2024-12-22 11:34: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 function Box({todo, ...props}: BoxProps): JSX.Element {
|
||||
if(todo) {
|
||||
export function Box({todo, warn = true, ...props}: BoxProps): JSX.Element {
|
||||
if(todo && warn) {
|
||||
console.warn(`TODO: ${props.children}`)
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ import mergeClassNames from "classnames"
|
|||
export interface DialogProps extends PanelProps {}
|
||||
|
||||
|
||||
export function Dialog({todo, ...props}: DialogProps): JSX.Element {
|
||||
if(todo) {
|
||||
export function Dialog({todo, warn = true, ...props}: DialogProps): JSX.Element {
|
||||
if(todo && warn) {
|
||||
console.warn(`TODO: ${props.children}`)
|
||||
}
|
||||
|
||||
|
|
|
@ -7,11 +7,12 @@ import mergeClassNames from "classnames"
|
|||
|
||||
export interface PanelProps extends Types.BluelibHTMLProps<HTMLElement> {
|
||||
todo?: boolean,
|
||||
warn?: boolean,
|
||||
}
|
||||
|
||||
|
||||
export function Panel({todo, ...props}: PanelProps): JSX.Element {
|
||||
if(todo) {
|
||||
export function Panel({todo, warn = true, ...props}: PanelProps): JSX.Element {
|
||||
if(todo && warn) {
|
||||
console.warn(`TODO: ${props.children}`)
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ import mergeClassNames from "classnames"
|
|||
export interface ParenthesisProps extends PanelProps {}
|
||||
|
||||
|
||||
export function Parenthesis({todo, ...props}: ParenthesisProps): JSX.Element {
|
||||
if(todo) {
|
||||
export function Parenthesis({todo, warn = true, ...props}: ParenthesisProps): JSX.Element {
|
||||
if(todo && warn) {
|
||||
console.warn(`TODO: ${props.children}`)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue