Skip to content

Commit

Permalink
Merge pull request #244 from mash-up-kr/develop
Browse files Browse the repository at this point in the history
Release v1.2.0 배포
  • Loading branch information
HaJunRyu authored Apr 5, 2023
2 parents 620ecfe + e02dee2 commit 4f3a1ae
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/assets/base64/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './mashong-coffee';
2 changes: 2 additions & 0 deletions src/assets/base64/mashong-coffee.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const mashongCoffeeBase64 =
'data:image/webp;base64,UklGRq4BAABXRUJQVlA4WAoAAAAQAAAANwAANgAAQUxQSDABAAARP6CobSM2VSLrxrsREfB3tgSca9uTNU/yQWd8dlgd1npXb1akbWYsz/8/sbe2R/R/AtC+1ZA/0KicSjdGcpjRPrMZapO0Km1HPoQuSbKUdEnShh69UdKRJHWKATCb3fYBtF0WNSqOtApqS5JWJd33cSZZPL+7AILjAFlzJAeOQRNqR+6ZvAohEnSRYeScFC9HjiI6spYwiI4lhjE4gSLhkLdC4mNeOaXicoxKwSGnheRjzhCoTOe1QJu5VlV2pG146yyWtiRpNYBjnnEeW0CF4gYYy1mFtRwL7L+hhMMvKb5FYy9ngbXcChjLtQA4sQsAG7EWgMpZygDAWMoqYOKkqNF2/IbNl7zCp9w78CY/+BYN3NxK1wGMZ7PZ7UywBn86kywQ7UrqWEdCxSpVQfzTVlA4IFgAAAAQAwCdASo4ADcAD8D+JaQAA3W99+WFyB1hBQGc87QnNQAA/uKbgdzJ8aRxbtunogA9rk3Jjm62LtGWd67D/z0a8KsOWZfubJ5TXXVBv2nfJ0oP6ATiAAAA';
36 changes: 22 additions & 14 deletions src/components/common/Modal/Modal.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,35 @@ const Modal = ({
'input, button, textarea, select, [href], [tabindex]',
);

if (focusableNodeList) {
const firstFocusableNode = focusableNodeList[0];
const lastFocusableNode = focusableNodeList[focusableNodeList.length - 1];

if (e.target === firstFocusableNode && e.shiftKey && e.key === 'Tab') {
e.preventDefault();
lastFocusableNode.focus();
}
if (e.target === lastFocusableNode && !e.shiftKey && e.key === 'Tab') {
e.preventDefault();
firstFocusableNode.focus();
}
if (!focusableNodeList) return;

const firstFocusableNode = focusableNodeList[0];
const lastFocusableNode = focusableNodeList[focusableNodeList.length - 1];

if (e.target === firstFocusableNode && e.shiftKey && e.key === 'Tab') {
e.preventDefault();
lastFocusableNode.focus();
}
if (e.target === lastFocusableNode && !e.shiftKey && e.key === 'Tab') {
e.preventDefault();
firstFocusableNode.focus();
}
};

if (escClose) window.addEventListener('keyup', handleCloseModalWithEscHandler);

if (mounted) {
dialogRef.current?.focus();
const focusableNodeList = dialogRef.current?.querySelectorAll<HTMLElement>(
'input, button, textarea, select, [href], [tabindex]',
);

if (focusableNodeList) {
const firstFocusableNode = focusableNodeList[0];

firstFocusableNode?.focus();

window.addEventListener('keydown', handleFocusTrap);
window.addEventListener('keydown', handleFocusTrap);
}
}

if (!mounted) setMounted(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Modal } from '@/components';
import mashong from '@/assets/images/mashong-coffee-3x-min.png';
import { Dispatch, SetStateAction } from 'react';
import Image from 'next/image';
import { mashongCoffeeBase64 } from '@/assets/base64';
import * as Styled from './NotRecruitmentPeriod.styled';

interface NotRecruitmentPeriodProps {
Expand All @@ -25,7 +26,14 @@ const NotRecruitmentPeriod = ({ setIsOpenModal }: NotRecruitmentPeriodProps) =>
</Styled.GoToOfficialPage>
<Styled.CloseButton onClick={handleCloseModal}>지난 모집 훑어보기</Styled.CloseButton>
<Styled.MashongWrapper>
<Image src={mashong.src} alt="" layout="fill" priority />
<Image
src={mashong.src}
alt=""
layout="fill"
placeholder="blur"
blurDataURL={mashongCoffeeBase64}
priority
/>
<Styled.SpeechBubble>
<Styled.Speech>현재 13기가 활발히 활동 중이에요</Styled.Speech>
<Styled.SpeechDotBig />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export const MashongWrapper = styled.div`
left: 50%;
width: 11.1rem;
height: 11rem;
overflow: hidden;
border-radius: 1rem;
transform: translate3d(-50%, 0, 0);
`;

Expand Down

0 comments on commit 4f3a1ae

Please sign in to comment.