From bb58b9a5f6920d71a5f9ee6c5907a66a954f70e5 Mon Sep 17 00:00:00 2001 From: mahdi andalib Date: Wed, 11 May 2022 16:03:55 +0430 Subject: [PATCH] update 2 files and delete 4 files --- src/components/Navbar/HeaderDesign2/index.js | 2 +- src/components/Switch/index.css | 57 ------------------- src/components/Switch/index.css.map | 9 --- src/components/Switch/index.scss | 0 .../{ => SwitchDesign}/Switch/index.js | 2 - src/components/SwitchDesign/index.js | 25 ++++++++ src/redux/data.js | 11 ++++ 7 files changed, 37 insertions(+), 69 deletions(-) delete mode 100644 src/components/Switch/index.css delete mode 100644 src/components/Switch/index.css.map delete mode 100644 src/components/Switch/index.scss rename src/components/{ => SwitchDesign}/Switch/index.js (95%) create mode 100644 src/components/SwitchDesign/index.js diff --git a/src/components/Navbar/HeaderDesign2/index.js b/src/components/Navbar/HeaderDesign2/index.js index 2c0112c..511223c 100644 --- a/src/components/Navbar/HeaderDesign2/index.js +++ b/src/components/Navbar/HeaderDesign2/index.js @@ -1,5 +1,5 @@ import React from "react"; -import Switch from "../../Switch"; +import Switch from "../../SwitchDesign/Switch"; import Search from "../../SearchDesign/Search"; const HeaderDesign2 = ({ username, userJob, menuItems }) => { diff --git a/src/components/Switch/index.css b/src/components/Switch/index.css deleted file mode 100644 index 819be75..0000000 --- a/src/components/Switch/index.css +++ /dev/null @@ -1,57 +0,0 @@ -.switch { - position: relative; -} - -.switch input[type="checkbox"] { - visibility: hidden; - position: absolute; -} - -.switch input[type="checkbox"]:checked + label { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - background-color: #000; -} - -.switch input[type="checkbox"]:checked + label:before { - -webkit-transform: translateX(35.5px); - transform: translateX(35.5px); - background-color: #fff; -} - -.switch label { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - width: 70px; - height: 34px; - border: 3px solid; - border-radius: 99em; - position: relative; - -webkit-transition: -webkit-transform 0.3s ease-in-out; - transition: -webkit-transform 0.3s ease-in-out; - transition: transform 0.3s ease-in-out; - transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out; - -webkit-transform-origin: 50% 50%; - transform-origin: 50% 50%; - cursor: pointer; -} - -.switch label:before { - -webkit-transition: -webkit-transform 0.3s ease; - transition: -webkit-transform 0.3s ease; - transition: transform 0.3s ease; - transition: transform 0.3s ease, -webkit-transform 0.3s ease; - -webkit-transition-delay: 0s; - transition-delay: 0s; - content: ""; - display: block; - position: absolute; - width: 24px; - height: 24px; - background-color: #000; - border-radius: 50%; - top: 2px; - left: 3px; -} -/*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/src/components/Switch/index.css.map b/src/components/Switch/index.css.map deleted file mode 100644 index 3260584..0000000 --- a/src/components/Switch/index.css.map +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 3, - "mappings": "AAWA,AAAA,OAAO,CAAC;EACP,QAAQ,EAAE,QAAQ;CAuClB;;AAxCD,AAEE,OAFK,CAEL,KAAK,CAAA,AAAA,IAAC,CAAK,UAAU,AAAf,EAAiB;EACrB,UAAU,EAAE,MAAM;EACrB,QAAQ,EAAG,QAAQ;CASjB;;AAbH,AAKI,OALG,CAEL,KAAK,CAAA,AAAA,IAAC,CAAK,UAAU,AAAf,CAGH,QAAQ,GAAG,KAAK,CAAC;EAChB,SAAS,EAAE,YAAY;EACvB,gBAAgB,EAAE,IAAI;CAKvB;;AAZL,AAQM,OARC,CAEL,KAAK,CAAA,AAAA,IAAC,CAAK,UAAU,AAAf,CAGH,QAAQ,GAAG,KAAK,AAGd,OAAO,CAAC;EACP,SAAS,EAAE,kBAAkB;EAC7B,gBAAgB,EAAE,IAAI;CACvB;;AAXP,AAeE,OAfK,CAeL,KAAK,CAAC;EACJ,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,MAAM,EAAE,SAAS;EACjB,aAAa,EAAE,IAAI;EACnB,QAAQ,EAAE,QAAQ;EAClB,UAAU,EAAE,0BAA0B;EACtC,gBAAgB,EAAE,OAAO;EACzB,MAAM,EAAE,OAAO;CAehB;;AAvCH,AA0BI,OA1BG,CAeL,KAAK,AAWF,OAAO,CAAC;EACP,UAAU,EAAE,mBAAmB;EAC/B,gBAAgB,EAAE,EAAE;EACpB,OAAO,EAAE,EAAE;EACX,OAAO,EAAE,KAAK;EACd,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,gBAAgB,EAAE,IAAI;EACtB,aAAa,EAAE,GAAG;EAClB,GAAG,EAAE,GAAG;EACR,IAAI,EAAE,GAAG;CACV", - "sources": [ - "index.scss" - ], - "names": [], - "file": "index.css" -} \ No newline at end of file diff --git a/src/components/Switch/index.scss b/src/components/Switch/index.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/Switch/index.js b/src/components/SwitchDesign/Switch/index.js similarity index 95% rename from src/components/Switch/index.js rename to src/components/SwitchDesign/Switch/index.js index 3b0db97..3c34c19 100644 --- a/src/components/Switch/index.js +++ b/src/components/SwitchDesign/Switch/index.js @@ -1,7 +1,5 @@ // it has style inside index.scss ---> // Start Switch && end Switch - import React from "react"; -import "./index.scss"; const Switch = () => { return ( diff --git a/src/components/SwitchDesign/index.js b/src/components/SwitchDesign/index.js new file mode 100644 index 0000000..8028d98 --- /dev/null +++ b/src/components/SwitchDesign/index.js @@ -0,0 +1,25 @@ +import React, { useState } from "react"; + +import Switch from "./Switch"; + +function SwitchDesign() { + const list = { + 1: , + }; + const [type, setType] = useState(1); + return ( +
+ + {list[type]} +
+ ); +} + +export default SwitchDesign; diff --git a/src/redux/data.js b/src/redux/data.js index ede3c20..c9cf179 100644 --- a/src/redux/data.js +++ b/src/redux/data.js @@ -20,6 +20,7 @@ import FooterDesign from "../components/FooterDesign"; import Input from "../components/Input"; import Navbar from "../components/Navbar"; import SearchDesign from "../components/SearchDesign"; +import SwitchDesign from "../components/SwitchDesign"; // mini components import MiniComponents from "../components/MiniComponents"; @@ -533,6 +534,16 @@ const components = [ code: null, }, }, + { + name: "Switch Design", + author: "Andalib/Ashrafi", + props: [], + content: { + name: "Switch Design", + component: , + code: null, + }, + }, // mini components { name: "Mini Components",