parent
7e532eb1b3
commit
1fe14bfd28
13 changed files with 184 additions and 23 deletions
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 123 KiB |
@ -1,17 +1,22 @@ |
||||
export const registerValue = { |
||||
namdinh: { |
||||
path: 'namdinh', |
||||
province_alias: 'nam_dinh_', |
||||
district_alias: '', |
||||
organization: '', |
||||
represent_code: 'ND1' |
||||
organization: 'Nam Định', |
||||
represent_code: 'ND1', |
||||
logo: '/assets/images/logo_ND.png', |
||||
name: 'Sở giáo dục và đào tạo Nam Định', |
||||
color: '#007FBF' |
||||
}, |
||||
phucyen: { |
||||
path: 'phucyen', |
||||
province_alias: 'vinh_phuc', |
||||
district_alias: 'thanh_pho_phuc_yen', |
||||
organization: '', |
||||
organization: 'Phúc Yên', |
||||
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' |
||||
} |
||||
}, |
||||
} |
@ -0,0 +1,13 @@ |
||||
import { useState } from "react" |
||||
import { registerValue } from "../../../../_constants/register" |
||||
|
||||
export const ChooseOrgLogic = () => { |
||||
const [organizationList, setOrganizationList] = useState(Object.values(registerValue)) |
||||
const [orgHover, setOrgHover] = useState(null) |
||||
|
||||
return { |
||||
organizationList, |
||||
orgHover, |
||||
setOrgHover |
||||
} |
||||
} |
@ -0,0 +1,98 @@ |
||||
@import "/src/_styles/mixin"; |
||||
|
||||
// .bg-register { |
||||
// max-height: 100vh; |
||||
// overflow-y: hidden; |
||||
|
||||
// @include screen_mobile { |
||||
// overflow: unset; |
||||
// max-height: unset; |
||||
// } |
||||
// } |
||||
|
||||
.choose-org-container { |
||||
width: 100%; |
||||
display: block; |
||||
padding: 5% 15% 0; |
||||
|
||||
@include screen_mobile { |
||||
padding: 10% 0; |
||||
} |
||||
} |
||||
|
||||
.choose-org-heading { |
||||
text-align: center; |
||||
font-size: 2rem; |
||||
font-weight: 600; |
||||
text-transform: uppercase; |
||||
|
||||
@include screen_mobile { |
||||
font-size: 1.6rem; |
||||
} |
||||
} |
||||
|
||||
.org-list-container { |
||||
margin-top: 94px; |
||||
display: flex; |
||||
justify-content: center; |
||||
overflow-y: auto; |
||||
|
||||
@include screen_mobile { |
||||
padding: 0 16px; |
||||
margin-top: 26px; |
||||
overflow-y: unset; |
||||
} |
||||
|
||||
@media screen and (max-height: 800px) { |
||||
margin-top: 40px; |
||||
} |
||||
} |
||||
|
||||
.org-list { |
||||
max-height: 64vh; |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
gap: 50px; |
||||
justify-content: center; |
||||
|
||||
@include screen_mobile { |
||||
max-height: unset; |
||||
gap: 32px; |
||||
} |
||||
} |
||||
|
||||
.org-item { |
||||
display: flex; |
||||
flex-direction: column; |
||||
gap: 8px; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.org-item-img { |
||||
display: flex; |
||||
justify-content: center; |
||||
|
||||
img { |
||||
width: 100px; |
||||
height: 100px; |
||||
border-radius: 50%; |
||||
object-fit: contain; |
||||
|
||||
@include screen_mobile { |
||||
width: 80px; |
||||
height: 80px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.org-item-name { |
||||
p { |
||||
font-size: 18px; |
||||
font-weight: 600; |
||||
text-align: center; |
||||
|
||||
@include screen_mobile { |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,34 @@ |
||||
import { history } from '../../../../_helpers' |
||||
import { ChooseOrgLogic } from './ChooseOrg.logic' |
||||
import './ChooseOrg.style.scss' |
||||
|
||||
export default function ChooseOrg() { |
||||
const {organizationList, orgHover,setOrgHover,} = ChooseOrgLogic() |
||||
return ( |
||||
<div className="bg-register rel"> |
||||
<div className="choose-org-container"> |
||||
<p className="choose-org-heading">Chọn tổ chức của bạn</p> |
||||
<div className='org-list-container scrollbar-custom'> |
||||
<div className='org-list'> |
||||
{organizationList.map(item => ( |
||||
<div |
||||
className='org-item' |
||||
key={item.path} |
||||
onMouseEnter={() => setOrgHover(item)} |
||||
onMouseLeave={() => setOrgHover(null)} |
||||
onClick={() => history.push(`/${item.path}`)} |
||||
> |
||||
<div className='org-item-img'> |
||||
<img src={item.logo} alt={item.path} /> |
||||
</div> |
||||
<div className='org-item-name'> |
||||
<p style={{color: orgHover?.path === item.path ? item.color : 'unset'}}>{item.organization}</p> |
||||
</div> |
||||
</div> |
||||
))} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
) |
||||
} |
Loading…
Reference in new issue