From e829dc6484fb147bc747fdd7acffa091dfe1b23f Mon Sep 17 00:00:00 2001 From: mahdi Date: Wed, 25 May 2022 11:30:26 +0430 Subject: [PATCH] update 6 files --- src/components/ThemeColor/ColorCard.js | 59 ++++++++++++++++++++++++++ src/components/ThemeColor/index.js | 59 +------------------------- 2 files changed, 60 insertions(+), 58 deletions(-) create mode 100644 src/components/ThemeColor/ColorCard.js diff --git a/src/components/ThemeColor/ColorCard.js b/src/components/ThemeColor/ColorCard.js new file mode 100644 index 0000000..2011bff --- /dev/null +++ b/src/components/ThemeColor/ColorCard.js @@ -0,0 +1,59 @@ +import React from "react"; +import ItemColor from "./ItemColor"; + +const ColorCard = ({ theme, text, dark, light, item, setItem }) => { + return ( +
+
setItem(item)} + > + + {text && ( + { + e.stopPropagation(); + setItem(item + "Text"); + }} + /> + )} +
+
+ {" "} + {dark ? ( +
setItem(item + "Dark")} + > + +
+ ) : null} + {light ? ( +
setItem(item + "Light")} + > + +
+ ) : null} +
+
+ ); +}; diff --git a/src/components/ThemeColor/index.js b/src/components/ThemeColor/index.js index 55c1d0b..9334ae9 100644 --- a/src/components/ThemeColor/index.js +++ b/src/components/ThemeColor/index.js @@ -3,7 +3,7 @@ import SwitchDesign from "../SwitchDesign/Switch"; import putTheme from "./util/putTheme"; import defaultTheme from "./default"; import Picker from "./util/Picker"; -import ItemColor from "./ItemColor"; +import ColorCard from "./ColorCard"; const ThemeColor = () => { const [item, setItem] = useState(null); @@ -75,60 +75,3 @@ const ThemeColor = () => { }; export default ThemeColor; - -const ColorCard = ({ theme, text, dark, light, item, setItem }) => { - return ( -
-
setItem(item)} - > - - {text && ( - { - e.stopPropagation(); - setItem(item + "Text"); - }} - /> - )} -
-
- {" "} - {dark ? ( -
setItem(item + "Dark")} - > - -
- ) : null} - {light ? ( -
setItem(item + "Light")} - > - -
- ) : null} -
-
- ); -};