Skip to content

Commit

Permalink
feat: className bug fix, version 1.0.4 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Yefee8 committed Sep 28, 2023
1 parent 4f31952 commit 88fbef7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yefee-ui",
"version": "1.0.3",
"version": "1.0.4",
"author": "yefee",
"license": "ISC",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ interface props {
[key: string]: any
}

export default function Alert (props: props) {
function isItUsable () {
const { children, color, width, height, style, ...restProps } = props
export default function Alert(props: props) {
function isItUsable() {
const { children, color, width, height, style, className, ...restProps } = props
return restProps
}

Expand All @@ -23,7 +23,7 @@ export default function Alert (props: props) {
height: props.height ? props.height : '',
...props.style
}}
className={`yefee-alert ${props.color ? props.color : 'primary'}-alert`} {...isItUsable()}
className={`${props.className} yefee-alert ${props.color ? props.color : 'primary'}-alert`} {...isItUsable()}
>
{props.children}
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/lib/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import React from 'react'
import './button.css'

interface props {
children: any
type?: 'rounded' | 'normal' | 'outlined' | 'rounded-outlined'
color?: 'primary' | 'success' | 'danger' | 'secondary' | 'white'
children: any;
type?: 'rounded' | 'normal' | 'outlined' | 'rounded-outlined';
color?: 'primary' | 'success' | 'danger' | 'secondary' | 'white';
[key: string]: any
}

export default function Button (props: props) {
function isItUsable () {
const { children, type, color, ...restProps } = props
export default function Button(props: props) {
function isItUsable() {
const { children, type, color, className, ...restProps } = props
return restProps
}

return (
<button
className={`yefee-button ${props.color ? props.color : 'primary'}-button
${props.type ? props.type === 'rounded-outlined' && 'rounded-button outlined' || props.type : 'normal'}-button`} {...isItUsable()}
${props.type ? props.type === 'rounded-outlined' && 'rounded-button outlined' || props.type : 'normal'}-button ${props.className}`} {...isItUsable()}
>
{props.children}
</button>
Expand Down
16 changes: 8 additions & 8 deletions src/lib/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import React, { useEffect, useState } from 'react'
import './dialog.css'

interface props {
color?: 'dark' | 'white'
children?: any
show: boolean
color?: 'dark' | 'white';
children?: any;
show: boolean;
[key: string]: any
}

export default function Dialog (props: props) {
export default function Dialog(props: props) {
const [firstTime, setFirstTime] = useState(0)
const [animationClass, setAnimationClass] = useState('dialog-none')

function DialogAnimationClass () {
function DialogAnimationClass() {
if (props.show) {
setAnimationClass('dialog-visible')
if (firstTime !== 2) {
Expand All @@ -35,14 +35,14 @@ export default function Dialog (props: props) {
DialogAnimationClass()
}, [props.show])

function isItUsable () {
const { color, children, ...restProps } = props
function isItUsable() {
const { color, children, className, ...restProps } = props
return restProps
}

return (
<div
className={`${props.color ? props.color : 'dark'}-dialog yefee-dialog-base ${animationClass}`}
className={`${props.className} ${props.color ? props.color : 'dark'}-dialog yefee-dialog-base ${animationClass}`}
{...isItUsable()}
>
{props.children}
Expand Down
10 changes: 5 additions & 5 deletions src/lib/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ interface props {
}>
setter: (change: any) => void
close: () => void
id?: string
id?: string;
[key: string]: any
}

export default function Dropdown (props: props) {
export default function Dropdown(props: props) {
const [showClass, setShowClass] = useState(props.show ? 'yefee-dropdown-visible' : 'yefee-dropdown-invisible')
const [firstTime, setFirstTime] = useState(0)

function isItUsable () {
const { color, show, items, ...restProps } = props
function isItUsable() {
const { color, show, items, className, ...restProps } = props
return restProps
}

Expand All @@ -40,7 +40,7 @@ export default function Dropdown (props: props) {
}, [props.show])

return (
<div className={`yefee-dropdown-items ${props.color ? props.color : 'dark'}-dropdown ${showClass === 'yefee-dropdown-invisible' && firstTime === 1 ? 'yefee-dropdown-first' : showClass}`} {...isItUsable()}>
<div className={`yefee-dropdown-items ${props.className} ${props.color ? props.color : 'dark'}-dropdown ${showClass === 'yefee-dropdown-invisible' && firstTime === 1 ? 'yefee-dropdown-first' : showClass}`} {...isItUsable()}>
{props.items.map((item) => {
return (
<div
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ interface props {

export default function Input (props: props) {
function isItUsable () {
const { type, ...restProps } = props
const { type, className, ...restProps } = props
return restProps
}

return (
<input className='yefee-input' type={props.type ? props.type : 'text'} {...isItUsable()} />
<input className={`${props.className} yefee-input`} type={props.type ? props.type : 'text'} {...isItUsable()} />
)
}
8 changes: 4 additions & 4 deletions src/lib/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ interface props {
[key: string]: any
}

export default function Tooltip (props: props) {
export default function Tooltip(props: props) {
const [showClass, setShowClass] = useState(props.show ? 'yefee-dropdown-visible' : 'yefee-dropdown-invisible')
const [firstTime, setFirstTime] = useState(0)

function isItUsable () {
const { color, show, ...restProps } = props
function isItUsable() {
const { color, show, className, ...restProps } = props
return restProps
}

Expand All @@ -36,7 +36,7 @@ export default function Tooltip (props: props) {
}, [props.show])

return (
<div className={`yefee-tooltip tooltip-${props.position ? props.position : 'bottom'} ${props.color ? props.color : 'dark'}-tooltip ${showClass === 'yefee-dropdown-invisible' && firstTime === 1 ? 'yefee-tooltip-first' : showClass}`} {...isItUsable()}>
<div className={`${props.className} yefee-tooltip tooltip-${props.position ? props.position : 'bottom'} ${props.color ? props.color : 'dark'}-tooltip ${showClass === 'yefee-dropdown-invisible' && firstTime === 1 ? 'yefee-tooltip-first' : showClass}`} {...isItUsable()}>
{props.children}
</div>
)
Expand Down

0 comments on commit 88fbef7

Please sign in to comment.