diff --git a/public/assets/images/logo_PY1.png b/public/assets/images/logo_PY1.png new file mode 100644 index 0000000..1a817c6 Binary files /dev/null and b/public/assets/images/logo_PY1.png differ diff --git a/src/App.js b/src/App.js index df2dabc..60017a0 100644 --- a/src/App.js +++ b/src/App.js @@ -31,13 +31,13 @@ function App() {
- + + - ); diff --git a/src/_components/Header/HeaderCloud.js b/src/_components/Header/HeaderCloud.js index d2aadc7..a94b408 100644 --- a/src/_components/Header/HeaderCloud.js +++ b/src/_components/Header/HeaderCloud.js @@ -5,7 +5,7 @@ import { useSelector } from "react-redux"; function HeaderCloud() { const authentication = useSelector((state) => state.authentication); return ( -
+
{"Logo"} diff --git a/src/_components/Header/HeaderTS/HeaderTS.js b/src/_components/Header/HeaderLogoRegister/HeaderLogoRegister.js similarity index 52% rename from src/_components/Header/HeaderTS/HeaderTS.js rename to src/_components/Header/HeaderLogoRegister/HeaderLogoRegister.js index 688de66..a548cd3 100644 --- a/src/_components/Header/HeaderTS/HeaderTS.js +++ b/src/_components/Header/HeaderLogoRegister/HeaderLogoRegister.js @@ -3,19 +3,19 @@ import { Link } from "react-router-dom"; import { useSelector } from "react-redux"; import './headerTS.style.scss' -function HeaderTS() { - const authentication = useSelector((state) => state.authentication); +function HeaderLogoRegister({srcImg, name, color}) { return (
{"Logo"} - Cô Đặng Thu Hiền + {name.split('\n').map((str, index) => {str})} +
); } -export { HeaderTS }; +export { HeaderLogoRegister }; diff --git a/src/_components/Header/HeaderTS/headerTS.style.scss b/src/_components/Header/HeaderLogoRegister/headerTS.style.scss similarity index 93% rename from src/_components/Header/HeaderTS/headerTS.style.scss rename to src/_components/Header/HeaderLogoRegister/headerTS.style.scss index bfe9c35..625b611 100644 --- a/src/_components/Header/HeaderTS/headerTS.style.scss +++ b/src/_components/Header/HeaderLogoRegister/headerTS.style.scss @@ -25,12 +25,12 @@ } img { - width: 90px; + width: 120px; height: auto; margin-top: 0 !important; @media screen and (max-width: 768px) { - width: 50px; + width: 74px; } } @@ -38,7 +38,6 @@ font-size: 16px; font-weight: 700; margin-top: 4px; - color: #14375F; font-family: 'Barlow-Bold'; @media screen and (max-height: 800px) { diff --git a/src/_components/Header/index.js b/src/_components/Header/index.js index 493a046..3cc92f0 100644 --- a/src/_components/Header/index.js +++ b/src/_components/Header/index.js @@ -1,5 +1,5 @@ export * from "./HeaderCloud"; export * from "./HeaderCurve"; export * from "./HeaderSquare"; -export * from "./HeaderTS/HeaderTS"; +export * from "./HeaderLogoRegister/HeaderLogoRegister"; export { default as HeaderNews } from "./HeaderNews/HeaderNews"; diff --git a/src/_constants/register.js b/src/_constants/register.js new file mode 100644 index 0000000..b02366a --- /dev/null +++ b/src/_constants/register.js @@ -0,0 +1,17 @@ +export const registerValue = { + namdinh: { + province_alias: 'nam_dinh_', + district_alias: '', + organization: '', + represent_code: 'ND1' + }, + phucyen: { + province_alias: 'vinh_phuc', + district_alias: 'thanh_pho_phuc_yen', + organization: '', + represent_code: 'PY1', + logo: '/assets/images/logo_PY1.png', + name: 'Phòng Giáo dục thành phố\nPhúc Yên - Vĩnh Phúc', + color: '#3493B8' + } +} \ No newline at end of file diff --git a/src/_containers/RegisterPage/RegisterPage.js b/src/_containers/RegisterPage/RegisterPage.js index 9020a33..05d164f 100644 --- a/src/_containers/RegisterPage/RegisterPage.js +++ b/src/_containers/RegisterPage/RegisterPage.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import { HeaderCloud, HeaderTS } from "../../_components/Header"; +import { HeaderCloud, HeaderLogoRegister } from "../../_components/Header"; import { stepAuthConstants } from "../../_constants/auth"; import { apiCaller, history } from "../../_helpers"; import AccountType from "./components/AccountType"; @@ -15,7 +15,12 @@ import { isEmpty } from "lodash"; import AddClassName from "./components/AddClassName"; import './register.scss' import AddressStudying from "./components/AddressStudying"; +import { useParams } from "react-router-dom"; +import { registerValue } from "../../_constants/register"; function RegisterPage() { + const params = useParams() + const orgLevel = params?.orgLevel; + const [registerInfo, setRegisterInfo] = useState(registerValue?.[orgLevel] || undefined); const [step, setStep] = useState(stepAuthConstants.STEP_ADDRESS_STUDYING); const [dataAddressStudying, setDataAddressStudying] = useState({ province: '', @@ -137,6 +142,7 @@ function RegisterPage() { } else { const newData = { ...data, + class_nickname: dataClassName?.class_nickname, auto_active: 1 } apiCaller("/api_register/register", "POST", newData).then((res) => { @@ -183,7 +189,15 @@ function RegisterPage() { return (
- + {!!registerInfo && + (orgLevel === 'namdinh' ? + + : + )} {statusRegister.type !== "success" ? ( <>
{ grade, schoolType, }); - props.setStep(stepAuthConstants.STEP_UPDATE_ACCOUNT); + props.setStep(stepAuthConstants.STEP_ADD_CLASS_NAME); } }; diff --git a/src/_containers/RegisterPage/components/AccountType/index.scss b/src/_containers/RegisterPage/components/AccountType/index.scss index c58d6e7..1365026 100644 --- a/src/_containers/RegisterPage/components/AccountType/index.scss +++ b/src/_containers/RegisterPage/components/AccountType/index.scss @@ -99,11 +99,19 @@ $normal-class: #979797; box-shadow: 0px 1px 3px #cccccc; background-color: white; + @media screen and (max-width: 768px) { + height: 80px; + } + svg { position: absolute; left: 50%; top: 50%; transform: translate3d(-50%, -50%, 0); + + @media screen and (max-width: 768px) { + width: 50px; + } } .class_number { diff --git a/src/_containers/RegisterPage/components/AddClassName/index.js b/src/_containers/RegisterPage/components/AddClassName/index.js index 6a7aea2..1a3f7bf 100644 --- a/src/_containers/RegisterPage/components/AddClassName/index.js +++ b/src/_containers/RegisterPage/components/AddClassName/index.js @@ -133,7 +133,7 @@ export default function AddClassName(props) {

ĐĂNG KÝ TÀI KHOẢN

- {`3. ${role === 'student' ? "Chọn lớp" : "Tạo lớp"}`} + {`4. ${role === 'student' ? "Học lớp" : "Tạo lớp"}`}

{ - apiCaller(`/api_organization/get_represent_code?district_alias=${districtAlias}&represent_code=nd1`).then( + apiCaller(`/api_organization/get_represent_code?district_alias=${districtAlias}&represent_code=${props?.registerInfo?.represent_code}`).then( (res) => { if(res?.status) { setOrganizationList(res.data) @@ -129,9 +133,38 @@ export default function AddressStudying(props) { } useEffect(() => { - getDistrictList(province.value); + if(!props?.registerInfo) { + history.push('/namdinh') + return; + } + if(province.value) { + getDistrictList(province.value); + } + if (district.value) { + getOrganizationList(district.value); + } }, []); + useEffect(() => { + if(!!registerValue?.[orgLevel]?.represent_code) { + if(!!registerValue[orgLevel]?.province_alias) { + setProvince({ + title: '', + value: registerValue[orgLevel].province_alias + }) + getDistrictList(registerValue[orgLevel]?.province_alias); + } + if (!!registerValue[orgLevel]?.district_alias) { + setDistrict({ + title: '', + value: registerValue[orgLevel].district_alias + }) + getOrganizationList(registerValue[orgLevel]?.district_alias); + } + props.setRegisterInfo(registerValue[orgLevel]) + } + }, [orgLevel]) + return (
@@ -162,7 +195,7 @@ export default function AddressStudying(props) { errorAbsolute={true} bottomErr={true} /> */} - + />} { diff --git a/src/_containers/RegisterPage/components/RegisterSuccess/index.js b/src/_containers/RegisterPage/components/RegisterSuccess/index.js index 360a698..32b0222 100644 --- a/src/_containers/RegisterPage/components/RegisterSuccess/index.js +++ b/src/_containers/RegisterPage/components/RegisterSuccess/index.js @@ -1,6 +1,7 @@ import React from "react"; import { Link } from "react-router-dom"; import "./index.scss"; +import ButtonNews from "../../../../_components/Button/ButtonNews"; const RegisterSuccess = ({handleReset}) => { return ( @@ -30,8 +31,10 @@ const RegisterSuccess = ({handleReset}) => {
{/* */} - - {/* */} + +
diff --git a/src/_containers/RegisterPage/components/RegisterSuccess/index.scss b/src/_containers/RegisterPage/components/RegisterSuccess/index.scss index 4749da1..433dabc 100644 --- a/src/_containers/RegisterPage/components/RegisterSuccess/index.scss +++ b/src/_containers/RegisterPage/components/RegisterSuccess/index.scss @@ -2,19 +2,32 @@ .title_register { margin-bottom: 36px; } + .success_icon { text-align: center; margin-bottom: 44px; } + .success_message { text-align: center; + p { font-size: 18px; } } + .back_login { text-align: center; margin-top: 44px; + display: flex; + align-items: center; + gap: 32px; + + @media screen and (max-width: 768px) { + flex-direction: column-reverse; + gap: 16px; + } + button { width: 210px; height: 50px; @@ -23,4 +36,32 @@ font-size: 18px; } } -} + + .btn-back { + width: 100px; + background-image: none; + background: + linear-gradient(#F3FFFF, #F3FFFF) padding-box, + linear-gradient(to right, #00b9b7, #00e1a0) border-box; + height: 40px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border: 2px solid transparent; + border-radius: 10px; + + span { + font-size: 18px; + font-weight: 600; + background: -webkit-linear-gradient(#00b9b7, #00e1a0); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + width: 100%; + } + + :hover { + opacity: 0.6; + } + } +} \ No newline at end of file diff --git a/src/_containers/RegisterPage/components/UpdateInformation/index.js b/src/_containers/RegisterPage/components/UpdateInformation/index.js index 75b35d0..889991f 100644 --- a/src/_containers/RegisterPage/components/UpdateInformation/index.js +++ b/src/_containers/RegisterPage/components/UpdateInformation/index.js @@ -113,7 +113,7 @@ const UpdateInformation = (props) => {

ĐĂNG KÝ TÀI KHOẢN

- {`3. Cập nhật thông tin`} + {`5. Cập nhật thông tin`}

{props.popupMessageRegisterTeacher && ( @@ -325,7 +325,7 @@ const UpdateInformation = (props) => {

{ - props.setStep(stepAuthConstants.STEP_ACCOUNT_TYPE); + props.setStep(stepAuthConstants.STEP_ADD_CLASS_NAME); }} style={{ width: "fit-content", diff --git a/src/_containers/RegisterPage/register.scss b/src/_containers/RegisterPage/register.scss index 69bd1cd..edf1ac6 100644 --- a/src/_containers/RegisterPage/register.scss +++ b/src/_containers/RegisterPage/register.scss @@ -5,16 +5,29 @@ $bg-gg: #be1e2d; $bg-apple: #000000; $loading-color: #f8f8f8; -.bg-register .logo img { - width: 144px; - margin-top: 32px; - @media screen and (max-height: 800px) { - width: 120px; + +.bg-register .logo-nam-dinh { + a { + margin-left: 32px; + + @media screen and (max-width: 768px) { + margin-left: 16px; + } } - @media screen and (max-width: 768px) { - width: 96px; + img { + width: 173px; + margin-top: 32px; + + @media screen and (max-height: 800px) { + width: 163px; + margin-top: 16px; + } + + @media screen and (max-width: 768px) { + width: 128px; + } } }