reza added light mode

master
Reza 3 years ago
parent fcb57a8c66
commit 07ca5cf436
  1. BIN
      src/assets/icons/arrow-left-green.png
  2. 12
      src/components/Textarea/index.scss
  3. 20
      src/components/Textarea/index.tsx
  4. 75
      src/custom.scss
  5. 10
      src/views/Auth/Login/index.scss
  6. 19
      src/views/Auth/Login/index.tsx
  7. 105
      src/views/Auth/SignUp/index.scss
  8. 7
      src/views/Auth/SignUp/index.tsx
  9. 47
      src/views/Contact/index.scss
  10. 40
      src/views/Contact/index.tsx

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -1,11 +1,19 @@
.custom-textarea { .custom-textarea {
width: 100%; width: 100%;
padding: 10px 12px; padding: 10px 12px;
color: white;
border-radius: 10px; border-radius: 10px;
margin-top: 10px;
&-light {
border: 1px solid $green;
background-color: white;
color: $gray5;
}
&-dark {
border: 1px solid $gray2; border: 1px solid $gray2;
background-color: black; background-color: black;
margin-top: 10px; color: white;
}
&::placeholder { &::placeholder {
color: #a2a2a2; color: #a2a2a2;
} }

@ -1,9 +1,21 @@
import React from 'react'; import React from "react";
import _ from "lodash";
export default function Textarea({placeholder} : any) { export default function Textarea({ placeholder, theme }: any) {
const light = theme === "light";
return ( return (
<> <>
<textarea className="custom-textarea" rows={6} placeholder={placeholder} /> <textarea
className={_.join(
[
"custom-textarea",
light ? "custom-textarea-light" : "custom-textarea-dark",
],
" "
)}
rows={6}
placeholder={placeholder}
/>
</> </>
) );
} }

@ -33,10 +33,72 @@
.bg-black{ .bg-black{
background-color: black !important; background-color: black !important;
.MuiFormControl-root {
color: $gray7 !important;
label {
background: black !important;
color: #b5b5b5;
}
}
.MuiOutlinedInput-notchedOutline {
border-color: $gray4 !important;
color: green !important;
}
.MuiOutlinedInput-input {
color: $green4 !important;
&:focus {
border: 1px solid $green4 !important;
}
}
.MuiInputLabel-shrink {
background-color: black !important;
color: $green4 !important;
}
.Mui-focused {
color: rgba(0, 0, 0, 1) !important;
border-color: $green4 !important;
color: $green4 !important;
}
} }
.bg-white{ .bg-white{
background-color: white !important; background-color: white !important;
.MuiFormControl-root {
color: $gray7 !important;
label {
background: white !important;
color: #b5b5b5;
}
}
.MuiOutlinedInput-notchedOutline {
border-color: $green1 !important;
color: green !important;
background-color: white;
}
.MuiOutlinedInput-input {
color: $gray5 !important;
&:focus {
border: 1px solid $green4 !important;
}
}
.MuiInputLabel-shrink {
background-color: black !important;
color: $green4 !important;
}
.Mui-focused {
color: rgba(0, 0, 0, 1) !important;
border-color: $green4 !important;
color: $green4 !important;
}
} }
p { p {
@ -175,10 +237,8 @@ p {
} }
color: $gray7 !important; color: $gray7 !important;
label { label {
background: black !important;
width: fit-content; width: fit-content;
text-align: center; text-align: center;
color: #b5b5b5;
} }
} }
.MuiOutlinedInput-notchedOutline { .MuiOutlinedInput-notchedOutline {
@ -187,16 +247,13 @@ p {
.MuiOutlinedInput-notchedOutline { .MuiOutlinedInput-notchedOutline {
border-color: $gray4 !important; border-color: $gray4 !important;
border-width: 1px !important; border-width: 1px !important;
color: green !important;
border-radius: 10px !important; border-radius: 10px !important;
} }
.MuiOutlinedInput-input { .MuiOutlinedInput-input {
padding: 15px 14px !important; padding: 15px 14px !important;
font-family: numeralLight; font-family: numeralLight;
color: $green4 !important;
&:focus { &:focus {
border: 1px solid $green4 !important;
border-radius: 10px; border-radius: 10px;
transform: translateY(0px); transform: translateY(0px);
border-radius: 10px !important; border-radius: 10px !important;
@ -222,14 +279,6 @@ p {
transform: translate(0px, 0px) scale(0.85) !important; transform: translate(0px, 0px) scale(0.85) !important;
padding: 0px 10px !important; padding: 0px 10px !important;
z-index: 130 !important; z-index: 130 !important;
background-color: black !important;
color: $green4 !important;
}
.Mui-focused {
color: rgba(0, 0, 0, 1) !important;
border-color: $green4 !important;
color: $green4 !important;
} }
.MuiInputBase-input { .MuiInputBase-input {

@ -3,12 +3,12 @@
height: 100vh; height: 100vh;
position: relative; position: relative;
font-family: numeralLight; font-family: numeralLight;
&__light { &-light {
.MuiFormControl-root label{ .MuiFormControl-root label{
background-color: white !important; background-color: white !important;
} }
b{ b{
color: black !important; color: $gray5 !important;
} }
.login { .login {
&__back { &__back {
@ -17,16 +17,13 @@
} }
} }
&__options { &__options {
color: black; color: $gray9;
a { a {
color: $green4; color: $green4;
} }
} }
} }
} }
&__dark {
background-color: black;
}
&__options { &__options {
color: #b5b5b5; color: #b5b5b5;
a { a {
@ -252,6 +249,7 @@
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
} }
img { img {
width: 40px;
// transform: scale() // transform: scale()
} }
} }

@ -6,6 +6,7 @@ import CustomCheckbox from "../../../components/CustomCheckbox/index";
import CheckBoxOutlineBlankTwoToneIcon from "@mui/icons-material/CheckBoxOutlineBlankTwoTone"; import CheckBoxOutlineBlankTwoToneIcon from "@mui/icons-material/CheckBoxOutlineBlankTwoTone";
import CheckBoxRoundedIcon from "@mui/icons-material/CheckBoxRounded"; import CheckBoxRoundedIcon from "@mui/icons-material/CheckBoxRounded";
import arrowLeft from "../../../assets/icons/arrow-left.png"; import arrowLeft from "../../../assets/icons/arrow-left.png";
import arrowLeftGreen from "../../../assets/icons/arrow-left-green.png";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import arrow from "../../../assets/icons/dropdown.png"; import arrow from "../../../assets/icons/dropdown.png";
@ -35,7 +36,7 @@ function Login({ login, theme, ...props }: any) {
className={_.join( className={_.join(
[ [
"login d-flex flex-column align-items-center justify-content-center", "login d-flex flex-column align-items-center justify-content-center",
theme === "light" ? "login__light" : "login__dark", theme === "light" ? "login-light bg-white" : "login-dark bg-black",
], ],
" " " "
)} )}
@ -48,7 +49,11 @@ function Login({ login, theme, ...props }: any) {
بازگشت به صفحه قبل بازگشت به صفحه قبل
<img src={arrow} alt="" /> <img src={arrow} alt="" />
</div> </div>
{theme === "dark" ? (
<img className="mobile" src={arrowLeft} alt="" /> <img className="mobile" src={arrowLeft} alt="" />
) : (
<img className="mobile" src={arrowLeftGreen} alt="" />
)}
</Link> </Link>
</div> </div>
<b> <b>
@ -77,12 +82,20 @@ function Login({ login, theme, ...props }: any) {
<CustomCheckbox <CustomCheckbox
icon={ icon={
<CheckBoxOutlineBlankTwoToneIcon <CheckBoxOutlineBlankTwoToneIcon
style={{ color: "$gray4", fontSize: 30, padding: 0 }} style={{
color: theme === "dark" ? "#666" : "#81c342",
fontSize: 27,
padding: 0,
}}
/> />
} }
checkedIcon={ checkedIcon={
<CheckBoxRoundedIcon <CheckBoxRoundedIcon
style={{ color: "$green4", fontSize: 30, padding: 0 }} style={{
color: theme === "dark" ? "#84de56" : "#81c342",
fontSize: 27,
padding: 0,
}}
/> />
} }
/> />

@ -3,13 +3,68 @@
height: 100vh; height: 100vh;
position: relative; position: relative;
font-family: numeralLight; font-family: numeralLight;
&__light{ &__back{
background-color: white; img{
width: 40px;
}
}
&-light {
b { b {
color: black !important; color: $gray5 !important;
} }
input { input {
background-color: white !important; background-color: white;
border: 1px solid $green1;
color: $gray5;
&::placeholder {
color: $gray9;
}
&:focus {
border: 1px solid $green4;
&::placeholder {
color: $green4;
}
}
}
.signup {
&__info {
color: $gray5;
a {
color: $green4;
}
}
&__back {
a {
color: $gray5;
font-size: 13px;
}
}
}
}
&-dark {
input {
background-color: $gray8;
border: 1px solid $gray;
color: white;
&:focus {
border: 1px solid $green4;
&::placeholder {
color: $green4;
}
}
}
.signup {
&__info {
color: white;
a {
color: $green4;
}
}
&__back {
a {
color: white;
}
}
} }
} }
img { img {
@ -45,17 +100,12 @@
} }
input { input {
text-align: center; text-align: center;
background-color: $gray8;
border: 1px solid $gray;
border-radius: 8px; border-radius: 8px;
font-size: 20px; font-size: 20px;
padding: 8px 0px; padding: 8px 0px;
color: white;
direction: ltr; direction: ltr;
&:focus { &:focus {
border: 1px solid $green4;
&::placeholder { &::placeholder {
color: $green4;
opacity: 0.3; opacity: 0.3;
} }
} }
@ -69,16 +119,11 @@
width: 350px; width: 350px;
margin: 30px auto 0px; margin: 30px auto 0px;
text-align: center; text-align: center;
color: white;
font-size: 13px; font-size: 13px;
a {
color: $green4;
}
} }
&__back { &__back {
margin-bottom: 60px; margin-bottom: 60px;
a { a {
color: white;
font-size: 13px; font-size: 13px;
} }
.desktop { .desktop {
@ -110,17 +155,12 @@
} }
input { input {
text-align: center; text-align: center;
background-color: #2a2a2a;
border: 1px solid #a2a2a2;
border-radius: 8px; border-radius: 8px;
font-size: calc(100vw / 75); font-size: calc(100vw / 75);
padding: 8px 0px; padding: 8px 0px;
color: white;
direction: ltr; direction: ltr;
&:focus { &:focus {
border: 1px solid $green4;
&::placeholder { &::placeholder {
color: $green4;
opacity: 0.3; opacity: 0.3;
} }
} }
@ -134,16 +174,11 @@
width: 300px; width: 300px;
margin: 20px auto 0px; margin: 20px auto 0px;
text-align: center; text-align: center;
color: white;
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
a {
color: $green4;
}
} }
&__back { &__back {
margin-bottom: 50px; margin-bottom: 50px;
a { a {
color: white;
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
} }
.desktop { .desktop {
@ -162,7 +197,6 @@
@media screen and (min-width: 641px) and (max-width: 1007px) { @media screen and (min-width: 641px) and (max-width: 1007px) {
.signup { .signup {
background: black;
.footer { .footer {
display: none !important; display: none !important;
} }
@ -182,17 +216,12 @@
} }
input { input {
text-align: center; text-align: center;
background-color: #2a2a2a;
border: 1px solid #a2a2a2;
border-radius: 8px; border-radius: 8px;
font-size: calc(100vw / 30); font-size: calc(100vw / 30);
padding: 10px 14px; padding: 10px 14px;
color: $green4;
direction: ltr; direction: ltr;
&:focus { &:focus {
border: 1px solid $green4;
&::placeholder { &::placeholder {
color: $green4;
opacity: 0.3; opacity: 0.3;
} }
} }
@ -208,11 +237,7 @@
width: 400px; width: 400px;
margin: 20px auto 0px; margin: 20px auto 0px;
text-align: center; text-align: center;
color: white;
font-size: calc(100vw / 40); font-size: calc(100vw / 40);
a {
color: $green4;
}
} }
&__back { &__back {
position: fixed; position: fixed;
@ -220,7 +245,6 @@
left: 30px; left: 30px;
margin-bottom: 50px; margin-bottom: 50px;
a { a {
color: white;
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
} }
img { img {
@ -237,7 +261,6 @@
@media screen and (max-width: 640px) { @media screen and (max-width: 640px) {
.signup { .signup {
background: black;
section { section {
width: 90%; width: 90%;
max-width: 400px; max-width: 400px;
@ -254,17 +277,12 @@
} }
input { input {
text-align: center; text-align: center;
background-color: #2a2a2a;
border: 1px solid #a2a2a2;
border-radius: 8px; border-radius: 8px;
font-size: calc(100vw / 22); font-size: calc(100vw / 22);
padding: 10px 14px; padding: 10px 14px;
color: white;
direction: ltr; direction: ltr;
&:focus { &:focus {
border: 1px solid $green4;
&::placeholder { &::placeholder {
color: $green4;
opacity: 0.3; opacity: 0.3;
} }
} }
@ -281,12 +299,8 @@
width: 300px; width: 300px;
margin: 30px auto 0px; margin: 30px auto 0px;
text-align: center; text-align: center;
color: white;
font-size: calc(100vw / 30); font-size: calc(100vw / 30);
line-height: 1.5; line-height: 1.5;
a {
color: $green4;
}
} }
&__back { &__back {
position: fixed; position: fixed;
@ -294,7 +308,6 @@
left: 20px; left: 20px;
margin-bottom: 50px; margin-bottom: 50px;
a { a {
color: white;
font-size: calc(100vw / 110); font-size: calc(100vw / 110);
} }
} }

@ -7,6 +7,7 @@ import onInput from "../../../util/onInput";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import arrow from "../../../assets/icons/dropdown.png"; import arrow from "../../../assets/icons/dropdown.png";
import arrowLeft from "../../../assets/icons/arrow-left.png"; import arrowLeft from "../../../assets/icons/arrow-left.png";
import arrowLeftGreen from "../../../assets/icons/arrow-left-green.png";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { user } from "../../../redux/actions"; import { user } from "../../../redux/actions";
@ -95,7 +96,7 @@ function SignUp({ sendOtp, sendPhoneNumber, loginFlag, theme }: any) {
className={_.join( className={_.join(
[ [
"signup d-flex flex-column align-items-center justify-content-center", "signup d-flex flex-column align-items-center justify-content-center",
light ? "signup__light" : "signup__dark", light ? "signup-light bg-white" : "signup-dark bg-black",
], ],
" " " "
)} )}
@ -145,7 +146,11 @@ function SignUp({ sendOtp, sendPhoneNumber, loginFlag, theme }: any) {
بازگشت به صفحه قبل بازگشت به صفحه قبل
<img src={arrow} /> <img src={arrow} />
</div> </div>
{light ? (
<img className="mobile" src={arrowLeftGreen} alt="" />
) : (
<img className="mobile" src={arrowLeft} alt="" /> <img className="mobile" src={arrowLeft} alt="" />
)}
</Link> </Link>
</div> </div>
<b> <b>

@ -1,8 +1,48 @@
.contact{ .contact{
&-dark{
header{ header{
color: white; color: white;
border-bottom: 1px solid $gray7; border-bottom: 1px solid $gray7;
} }
.contact{
&__info{
&--data{
h2{
color: $green;
}
p{
color: $gray6;
}
}
&--map{
border-top: 1px solid $gray7;
}
}
}
}
&-light{
header{
color: $gray5;
border-bottom: none;
}
.contact{
&__info{
&--data{
h2{
color: $green5;
}
p{
color: $gray5;
}
}
&--map{
border-top: 1px solid $gray12;
}
}
}
}
&__form{ &__form{
&--name{ &--name{
width: 70%; width: 70%;
@ -12,19 +52,12 @@
&--data{ &--data{
margin-bottom: 30px; margin-bottom: 30px;
width: 48%; width: 48%;
h2{
color: $green;
}
p{
color: $gray6;
}
} }
&--map{ &--map{
width: 100%; width: 100%;
height: 300px; height: 300px;
position: relative; position: relative;
padding-top: 20px; padding-top: 20px;
border-top: 1px solid $gray7;
img { img {
transform: scale(0.4); transform: scale(0.4);
} }

@ -9,6 +9,7 @@ import Location from "../../components/Location";
import { connect } from "react-redux"; import { connect } from "react-redux";
import scroll from "../../util/scroll"; import scroll from "../../util/scroll";
import { publicApi } from "../../redux/actions"; import { publicApi } from "../../redux/actions";
import _ from "lodash";
interface FormData { interface FormData {
name?: string; name?: string;
@ -17,7 +18,13 @@ interface FormData {
text?: string; text?: string;
} }
function Contact({ departmans, selectedDepartman, contactData, getContactData }: any) { function Contact({
departmans,
selectedDepartman,
contactData,
getContactData,
theme,
}: any) {
const [formData, setFormData] = useState<FormData | undefined>(undefined); const [formData, setFormData] = useState<FormData | undefined>(undefined);
const [unit, setUnit] = useState("info"); const [unit, setUnit] = useState("info");
const onChange = (e: any) => { const onChange = (e: any) => {
@ -28,9 +35,17 @@ function Contact({ departmans, selectedDepartman, contactData, getContactData }:
scroll.goToTop(); scroll.goToTop();
getContactData(); getContactData();
}, []); }, []);
const light = theme === "light";
return ( return (
<div className="contact main d-flex flex-column"> <div
className={_.join(
[
"contact main d-flex flex-column",
light ? "contact-light bg-white" : "contact-dark bg-black",
],
" "
)}
>
<Navbar /> <Navbar />
<main className="d-flex flex-column"> <main className="d-flex flex-column">
<header> <header>
@ -38,7 +53,9 @@ function Contact({ departmans, selectedDepartman, contactData, getContactData }:
</header> </header>
<div className="mobile flex-column"> <div className="mobile flex-column">
<div className="d-flex contact__tab"> <div className="d-flex contact__tab">
<figure className={unit !== "info" ? "contact__tab--figureactive" : ""}></figure> <figure
className={unit !== "info" ? "contact__tab--figureactive" : ""}
></figure>
<button <button
className={unit === "info" ? "contact__tab--active" : ""} className={unit === "info" ? "contact__tab--active" : ""}
onClick={() => setUnit("info")} onClick={() => setUnit("info")}
@ -101,7 +118,10 @@ function Contact({ departmans, selectedDepartman, contactData, getContactData }:
label={"انتخاب دپارتمان"} label={"انتخاب دپارتمان"}
selectedOptions={selectedDepartman} selectedOptions={selectedDepartman}
/> />
<Textarea placeholder="متن پیام را اینجا تایپ کنید" /> <Textarea
theme={theme}
placeholder="متن پیام را اینجا تایپ کنید"
/>
<div className="d-flex justify-content-end py-4"> <div className="d-flex justify-content-end py-4">
<button className="submit submit-large">ارسال پیام</button> <button className="submit submit-large">ارسال پیام</button>
</div> </div>
@ -137,7 +157,7 @@ function Contact({ departmans, selectedDepartman, contactData, getContactData }:
label={"انتخاب دپارتمان"} label={"انتخاب دپارتمان"}
selectedOptions={selectedDepartman} selectedOptions={selectedDepartman}
/> />
<Textarea placeholder="متن پیام را اینجا تایپ کنید" /> <Textarea theme={theme} placeholder="متن پیام را اینجا تایپ کنید" />
<div className="d-flex justify-content-end py-4"> <div className="d-flex justify-content-end py-4">
<button className="submit submit-large">ارسال پیام</button> <button className="submit submit-large">ارسال پیام</button>
</div> </div>
@ -169,8 +189,12 @@ function Contact({ departmans, selectedDepartman, contactData, getContactData }:
); );
} }
export default connect((state: any) => ({ export default connect(
(state: any) => ({
departmans: state.publicApi.departmans, departmans: state.publicApi.departmans,
selectedDepartman: state.publicApi.selectedDepartman, selectedDepartman: state.publicApi.selectedDepartman,
contactData: state.publicApi.contactData, contactData: state.publicApi.contactData,
}), {getContactData : publicApi.getContactData})(Contact); theme: state.publicApi.theme,
}),
{ getContactData: publicApi.getContactData }
)(Contact);

Loading…
Cancel
Save