-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
241 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import Button from "./lib/Button/Button"; | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import Button from './lib/Button/Button' | ||
|
||
const App = () => { | ||
return ( | ||
<div> | ||
<Button> | ||
Yo! | ||
</Button> | ||
</div> | ||
) | ||
}; | ||
return ( | ||
<div> | ||
<Button> | ||
Yo! | ||
</Button> | ||
</div> | ||
) | ||
} | ||
|
||
ReactDOM.render(<App />, document.getElementById("root")); | ||
ReactDOM.render(<App />, document.getElementById('root')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import React from 'react'; | ||
import './alert.css'; | ||
import React from 'react' | ||
import './alert.css' | ||
|
||
interface props { | ||
children: any; | ||
color?: "primary" | "success" | "danger" | "secondary" | "white"; | ||
width?: string | number; | ||
height?: string | number; | ||
style?: object; | ||
[key: string]: any; | ||
children: any | ||
color?: 'primary' | 'success' | 'danger' | 'secondary' | 'white' | ||
width?: string | number | ||
height?: string | number | ||
style?: object | ||
[key: string]: any | ||
} | ||
|
||
export default function Alert(props: props) { | ||
export default function Alert (props: props) { | ||
function isItUsable () { | ||
const { children, color, width, height, style, ...restProps } = props | ||
return restProps | ||
} | ||
|
||
function isItUsable() { | ||
let { children, color, width, height, style, ...restProps } = props; | ||
return restProps; | ||
} | ||
|
||
return ( | ||
<div | ||
style={{ | ||
width: props.width ? props.width : "", | ||
height: props.height ? props.height : "", | ||
...props.style | ||
}} | ||
className={`yefee-alert ${props.color ? props.color : 'primary'}-alert`} {...isItUsable()}> | ||
{props.children} | ||
</div> | ||
); | ||
return ( | ||
<div | ||
style={{ | ||
width: props.width ? props.width : '', | ||
height: props.height ? props.height : '', | ||
...props.style | ||
}} | ||
className={`yefee-alert ${props.color ? props.color : 'primary'}-alert`} {...isItUsable()} | ||
> | ||
{props.children} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import React from 'react'; | ||
import './button.css'; | ||
import React from 'react' | ||
import './button.css' | ||
|
||
interface props { | ||
children: any; | ||
type?: "rounded" | "normal" | "outlined" | "rounded-outlined"; | ||
color?: "primary" | "success" | "danger" | "secondary" | "white"; | ||
[key: string]: any; | ||
children: any | ||
type?: 'rounded' | 'normal' | 'outlined' | 'rounded-outlined' | ||
color?: 'primary' | 'success' | 'danger' | 'secondary' | 'white' | ||
[key: string]: any | ||
} | ||
|
||
export default function Button(props: props){ | ||
export default function Button (props: props) { | ||
function isItUsable () { | ||
const { children, type, color, ...restProps } = props | ||
return restProps | ||
} | ||
|
||
function isItUsable() { | ||
let { children, type, color, ...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.children} | ||
</button> | ||
); | ||
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.children} | ||
</button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,51 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import './dialog.css'; | ||
import React, { useEffect, useState } from 'react' | ||
import './dialog.css' | ||
|
||
interface props { | ||
color?: "dark" | "white"; | ||
children?: any; | ||
show: boolean; | ||
[key: string]: any; | ||
color?: 'dark' | 'white' | ||
children?: any | ||
show: boolean | ||
[key: string]: any | ||
} | ||
|
||
export default function Dialog(props: props) { | ||
const [firstTime, setFirstTime] = useState(0); | ||
const [animationClass, setAnimationClass] = useState('dialog-none'); | ||
export default function Dialog (props: props) { | ||
const [firstTime, setFirstTime] = useState(0) | ||
const [animationClass, setAnimationClass] = useState('dialog-none') | ||
|
||
function DialogAnimationClass() { | ||
if (props.show) { | ||
setAnimationClass("dialog-visible"); | ||
if (firstTime !== 2) { | ||
setFirstTime(2); | ||
} | ||
} | ||
|
||
else { | ||
if (firstTime === 0) { | ||
setAnimationClass("dialog-none"); | ||
setFirstTime(2); | ||
} | ||
else { | ||
setAnimationClass("dialog-invisible"); | ||
setTimeout(() => { | ||
setAnimationClass("dialog-none"); | ||
}, 300) | ||
} | ||
} | ||
function DialogAnimationClass () { | ||
if (props.show) { | ||
setAnimationClass('dialog-visible') | ||
if (firstTime !== 2) { | ||
setFirstTime(2) | ||
} | ||
} else { | ||
if (firstTime === 0) { | ||
setAnimationClass('dialog-none') | ||
setFirstTime(2) | ||
} else { | ||
setAnimationClass('dialog-invisible') | ||
setTimeout(() => { | ||
setAnimationClass('dialog-none') | ||
}, 300) | ||
} | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
DialogAnimationClass(); | ||
}, [props.show]) | ||
useEffect(() => { | ||
DialogAnimationClass() | ||
}, [props.show]) | ||
|
||
function isItUsable() { | ||
let { color, children, ...restProps } = props; | ||
return restProps; | ||
} | ||
function isItUsable () { | ||
const { color, children, ...restProps } = props | ||
return restProps | ||
} | ||
|
||
return ( | ||
<div className={`${props.color ? props.color : "dark"}-dialog yefee-dialog-base ${animationClass}`} | ||
{...isItUsable()}> | ||
{props.children} | ||
</div> | ||
); | ||
return ( | ||
<div | ||
className={`${props.color ? props.color : 'dark'}-dialog yefee-dialog-base ${animationClass}`} | ||
{...isItUsable()} | ||
> | ||
{props.children} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import './dropdown.css'; | ||
import React, { useEffect, useState } from 'react' | ||
import './dropdown.css' | ||
|
||
interface props { | ||
color?: "dark" | "white"; | ||
show: boolean; | ||
items: { | ||
name: string, | ||
change: string | ||
}[]; | ||
setter: (change: any) => void; | ||
close: () => void; | ||
id?: string; | ||
[key: string]: any; | ||
color?: 'dark' | 'white' | ||
show: boolean | ||
items: Array<{ | ||
name: string | ||
change: string | ||
}> | ||
setter: (change: any) => void | ||
close: () => void | ||
id?: string | ||
[key: string]: any | ||
} | ||
|
||
export default function Dropdown(props: props) { | ||
const [showClass, setShowClass] = useState(props.show ? 'yefee-dropdown-visible' : 'yefee-dropdown-invisible') | ||
const [firstTime, setFirstTime] = useState(0); | ||
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() { | ||
let { color, show, items, ...restProps } = props; | ||
return restProps; | ||
} | ||
function isItUsable () { | ||
const { color, show, items, ...restProps } = props | ||
return restProps | ||
} | ||
|
||
useEffect(() => { | ||
if (props.show) { | ||
setShowClass('yefee-dropdown-visible') | ||
if (firstTime >= 0) { | ||
setFirstTime(-1); | ||
} | ||
} | ||
else { | ||
setShowClass('yefee-dropdown-invisible'); | ||
if (firstTime === 0) { | ||
setFirstTime(1) | ||
} | ||
else if (firstTime === 1) { | ||
setFirstTime(2); | ||
} | ||
} | ||
}, [props.show]) | ||
useEffect(() => { | ||
if (props.show) { | ||
setShowClass('yefee-dropdown-visible') | ||
if (firstTime >= 0) { | ||
setFirstTime(-1) | ||
} | ||
} else { | ||
setShowClass('yefee-dropdown-invisible') | ||
if (firstTime === 0) { | ||
setFirstTime(1) | ||
} else if (firstTime === 1) { | ||
setFirstTime(2) | ||
} | ||
} | ||
}, [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()}> | ||
{props.items.map((item) => { | ||
return ( | ||
<div onClick={() => { | ||
props.setter(item.change) | ||
return props.close(); | ||
}} className="yefee-dropdown-item"> | ||
{item.name} | ||
</div> | ||
) | ||
})} | ||
</div> | ||
); | ||
return ( | ||
<div className={`yefee-dropdown-items ${props.color ? props.color : 'dark'}-dropdown ${showClass === 'yefee-dropdown-invisible' && firstTime === 1 ? 'yefee-dropdown-first' : showClass}`} {...isItUsable()}> | ||
{props.items.map((item) => { | ||
return ( | ||
<div | ||
onClick={() => { | ||
props.setter(item.change) | ||
return props.close() | ||
}} className='yefee-dropdown-item' | ||
> | ||
{item.name} | ||
</div> | ||
) | ||
})} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import React from 'react'; | ||
import './dropdown.css'; | ||
import React from 'react' | ||
import './dropdown.css' | ||
|
||
interface props { | ||
children: any; | ||
className?: string; | ||
[key: string]: any; | ||
children: any | ||
className?: string | ||
[key: string]: any | ||
} | ||
|
||
export default function DropdownBase(props: props) { | ||
function isItUsable() { | ||
let { children, className, ...restProps } = props; | ||
return restProps; | ||
} | ||
export default function DropdownBase (props: props) { | ||
function isItUsable () { | ||
const { children, className, ...restProps } = props | ||
return restProps | ||
} | ||
|
||
return ( | ||
<div className={`yefee-dropdown-base ${props.className ? props.className : ""}`} {...isItUsable()}> | ||
{props.children} | ||
</div> | ||
); | ||
return ( | ||
<div className={`yefee-dropdown-base ${props.className ? props.className : ''}`} {...isItUsable()}> | ||
{props.children} | ||
</div> | ||
) | ||
} |
Oops, something went wrong.