summaryrefslogtreecommitdiff
path: root/src/components/Button.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Button.js')
-rw-r--r--src/components/Button.js18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/components/Button.js b/src/components/Button.js
index d9bcd22..ce83153 100644
--- a/src/components/Button.js
+++ b/src/components/Button.js
@@ -6,10 +6,11 @@ const noop = () => {};
const { memo, forwardRef } = React;
-function Button({ children, label, onClick = noop }, ref) {
+function Button({ children, label, text, start, onClick = noop }, ref) {
return (
<button className={s0.btn} ref={ref} onClick={onClick}>
- {children || label}
+ {start ? <span className={s0.btnStart}>{start}</span> : null}
+ {children || label || text}
</button>
);
}
@@ -22,17 +23,4 @@ export function ButtonPlain({ children, label, onClick = noop }) {
);
}
-function WithIcon({ text, icon, onClick = noop }, ref) {
- return (
- <button className={s0.btn} ref={ref} onClick={onClick}>
- <div className={s0.withIconWrapper}>
- {icon}
- <span className={s0.txt}>{text}</span>
- </div>
- </button>
- );
-}
-
-export const ButtonWithIcon = memo(forwardRef(WithIcon));
-
export default memo(forwardRef(Button));