1
Fork 0
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:
Steffo 2021-10-10 18:34:02 +02:00
parent fdeefa09d3
commit 91e5497ddf
Signed by: steffo
GPG key ID: 6965406171929D01
4 changed files with 9 additions and 8 deletions

View file

@ -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}`)
}

View file

@ -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}`)
}

View file

@ -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}`)
}

View file

@ -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}`)
}