reza added mobile home light mode

master
Reza 3 years ago
parent ad5487f722
commit 952355c1cd
  1. BIN
      src/assets/icons/searchBlack.png
  2. BIN
      src/assets/icons/voice-black.png
  3. 18
      src/components/GradeFilter/index.scss
  4. 36
      src/components/HomeSearchBox/index.tsx
  5. 3
      src/components/Navbar/index.scss
  6. 14
      src/components/Navbar/index.tsx
  7. 25
      src/components/NavbarDrawer/NavbarDrawer.scss
  8. 23
      src/components/NavbarDrawer/NavbarDrawer.tsx
  9. 2
      src/custom.scss
  10. 2
      src/views/Home/Courses/index.tsx

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

@ -13,8 +13,16 @@
background-color: $gray13; background-color: $gray13;
border: none; border: none;
.grade-filter__list{ .grade-filter__list{
background-color: white; backdrop-filter: blur(5px);
border: 1px solid black; background-color: rgba($gray12, 0.85);
li{
border-color: $gray11 !important;
color: $gray5 !important;
}
// border: 1px solid black;
}
.grade-filter__box{
background-color: $gray12 !important;
} }
} }
h1{ h1{
@ -164,11 +172,11 @@
position: relative; position: relative;
h1{ h1{
font-size: calc(100vw / 30); font-size: calc(100vw / 30);
background-color: $green; background-color: $green5;
box-shadow: 0px 0px 2px $green; box-shadow: 0px 0px 2px $green;
border-top-right-radius: 8px; border-top-right-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
padding: 12px 15px; padding: 13px 15px;
color: white; color: white;
} }
&__box{ &__box{
@ -178,6 +186,8 @@
align-items: center; align-items: center;
position: relative; position: relative;
height: 42px; height: 42px;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
& img{ & img{
position: absolute; position: absolute;
left: 5px; left: 5px;

@ -3,7 +3,9 @@ import { connect } from "react-redux";
import _ from "lodash"; import _ from "lodash";
import { book } from "../../redux/actions"; import { book } from "../../redux/actions";
import search from "../../assets/icons/search.png"; import search from "../../assets/icons/search.png";
import searchBlack from "../../assets/icons/searchBlack.png";
import voice from "../../assets/icons/voice.png"; import voice from "../../assets/icons/voice.png";
import voiceBlack from "../../assets/icons/voice-black.png";
function HomeSearchBox({ function HomeSearchBox({
lastItems, lastItems,
@ -22,14 +24,14 @@ function HomeSearchBox({
const submitSort = (value: any) => { const submitSort = (value: any) => {
sortFilter({ search: inputValue, sort: value }); sortFilter({ search: inputValue, sort: value });
}; };
const light = theme === "light";
return ( return (
<section <section
className={_.join( className={_.join(
[ [
"home-search-box d-flex flex-column align-items-center", "home-search-box d-flex flex-column align-items-center",
theme === "light" theme === "light" ? "home-search-box-light" : "home-search-box-dark",
? "home-search-box-light"
: "home-search-box-dark",
], ],
" " " "
)} )}
@ -47,19 +49,31 @@ function HomeSearchBox({
> >
<img src={search} alt="" /> <img src={search} alt="" />
</button> </button>
{light ? (
<img <img
className="mobile home-search-box__searchIcon" className="mobile home-search-box__searchIcon"
src={search} src={searchBlack}
onClick={() => sortFilter({ search: inputValue, sort: selectedSort })} onClick={() =>
alt="" sortFilter({ search: inputValue, sort: selectedSort })
/> }
alt=""
/>
) : (
<img
className="mobile home-search-box__searchIcon"
src={search}
onClick={() =>
sortFilter({ search: inputValue, sort: selectedSort })
}
alt=""
/>
)}
<button <button
className="home-search-box__voice" className="home-search-box__voice"
onClick={() => setVocal(true)} onClick={() => setVocal(true)}
> >
<img src={voice} alt="" /> {light ? <img src={voiceBlack} alt="" /> : <img src={voice} alt="" />}
</button> </button>
</form> </form>
<footer className="desktop"> <footer className="desktop">

@ -1,7 +1,7 @@
.nav{ .nav{
width: 100%; width: 100%;
height: 60px; height: 60px;
padding: 0px 10px; padding: 0px;
position: fixed !important; position: fixed !important;
top: 0px !important; top: 0px !important;
left: 0px; left: 0px;
@ -26,6 +26,7 @@
&__container{ &__container{
width: 100%; width: 100%;
font-family: numeralLight; font-family: numeralLight;
padding : 0px 5px;
a{ a{
color: white; color: white;
} }

@ -59,6 +59,7 @@ function Navbar(props: any) {
user={props.user} user={props.user}
logout={props.logout} logout={props.logout}
needUpdate={props.needUpdate} needUpdate={props.needUpdate}
theme={theme}
/> />
</div> </div>
); );
@ -66,10 +67,13 @@ function Navbar(props: any) {
const userStatus = proxy.status(); const userStatus = proxy.status();
return ( return (
<nav <nav
className={_.join([ className={_.join(
"nav align-items-center justify-content-center", [
theme === "light" ? "nav-light" : "nav-dark", "nav align-items-center justify-content-center",
], " ")} theme === "light" ? "nav-light" : "nav-dark",
],
" "
)}
> >
<div className="nav__container d-flex align-items-center justify-content-between"> <div className="nav__container d-flex align-items-center justify-content-between">
<ul className="nav__container--links desktop align-items-center"> <ul className="nav__container--links desktop align-items-center">
@ -85,7 +89,7 @@ function Navbar(props: any) {
</ul> </ul>
<MenuRoundedIcon <MenuRoundedIcon
className="mobile" className="mobile"
style={{ color: theme === "dark" ? "white" : "black", fontSize: 40 }} style={{ color: theme === "dark" ? "white" : "#555", fontSize: 40 }}
onClick={toggleDrawer("right", true)} onClick={toggleDrawer("right", true)}
/> />
<ul className="nav__container--buttons d-flex align-items-center"> <ul className="nav__container--buttons d-flex align-items-center">

@ -1,8 +1,23 @@
.MuiDrawer-paperAnchorRight { .navbar-drawer-light{
background: rgb(28, 28, 28) !important; .MuiDrawer-paperAnchorRight {
&::-webkit-scrollbar { background: white !important;
display: none !important; &::-webkit-scrollbar {
width: 0px !important; display: none !important;
width: 0px !important;
}
}
h1, div{
color: $gray5;
}
}
.navbar-drawer-dark{
.MuiDrawer-paperAnchorRight {
background: rgb(28, 28, 28) !important;
&::-webkit-scrollbar {
display: none !important;
width: 0px !important;
}
} }
} }
.navbar-drawer { .navbar-drawer {

@ -21,8 +21,9 @@ import mobileProfile from "../../assets/icons/mobileProfile.svg";
import mobileDanger from "../../assets/icons/mobileDanger.svg"; import mobileDanger from "../../assets/icons/mobileDanger.svg";
import mobileLogout from "../../assets/icons/mobileLogout.svg"; import mobileLogout from "../../assets/icons/mobileLogout.svg";
import proxy from "../../redux/proxy"; import proxy from "../../redux/proxy";
import _ from "lodash";
const NavbarDrawer = ({ status, logout }: any) => { const NavbarDrawer = ({ status, logout, theme }: any) => {
const [dropdown, setDropdown] = useState(false); const [dropdown, setDropdown] = useState(false);
const links = [ const links = [
{ {
@ -71,28 +72,28 @@ const NavbarDrawer = ({ status, logout }: any) => {
message: "", message: "",
}, },
{ {
name : 'یوتیوب', name: "یوتیوب",
link: "/video-tube", link: "/video-tube",
icon: <img src={mobileHome} alt="صفحه اصلی" />, icon: <img src={mobileHome} alt="صفحه اصلی" />,
toast: "", toast: "",
message: "", message: "",
}, },
{ {
name : 'خریداشتراک', name: "خریداشتراک",
link: "/subscribe", link: "/subscribe",
icon: <img src={mobileHome} alt="صفحه اصلی" />, icon: <img src={mobileHome} alt="صفحه اصلی" />,
toast: "", toast: "",
message: "", message: "",
}, },
{ {
name : 'سوالات متداول', name: "سوالات متداول",
link: "/faq", link: "/faq",
icon: <img src={mobileHome} alt="صفحه اصلی" />, icon: <img src={mobileHome} alt="صفحه اصلی" />,
toast: "", toast: "",
message: "", message: "",
}, },
{ {
name : 'صفحه محصول', name: "صفحه محصول",
link: "/courses/1", link: "/courses/1",
icon: <img src={mobileHome} alt="صفحه اصلی" />, icon: <img src={mobileHome} alt="صفحه اصلی" />,
toast: "", toast: "",
@ -178,9 +179,17 @@ const NavbarDrawer = ({ status, logout }: any) => {
]; ];
const statusx = proxy.status(); const statusx = proxy.status();
let score = 2; let score = 2;
const light = theme === "light";
return ( return (
<div className="navbar-drawer d-flex flex-column"> <div
className={_.join(
[
"navbar-drawer d-flex flex-column",
light ? "navbar-drawer-light" : "navbar-drawer-dark",
],
" "
)}
>
{statusx ? ( {statusx ? (
<div className="navbar-drawer__header d-flex align-items-center"> <div className="navbar-drawer__header d-flex align-items-center">
<> <>

@ -115,7 +115,7 @@ p {
padding-top: 60px; padding-top: 60px;
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
padding-bottom: 100px; padding-bottom: 20px;
font-family: numeralLight; font-family: numeralLight;
&__light{ &__light{
background: white; background: white;

@ -26,7 +26,7 @@ function Courses({ number, courses, selectedSort, theme }: any) {
light ? "home-courses-light" : "home-courses-dark", light ? "home-courses-light" : "home-courses-dark",
], " ")} ], " ")}
> >
<header className="d-flex justify-content-between"> <header className="d-flex justify-content-between align-items-center">
<div className="d-flex flex-column"> <div className="d-flex flex-column">
<h1>{selectedSort}</h1> <h1>{selectedSort}</h1>
{/* <span>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.</span> */} {/* <span>در این قسمت شاید یک متن جهت زیباسازی قرار بگیرد.</span> */}

Loading…
Cancel
Save