Skip to content

Commit

Permalink
Merge pull request #90 from osohyun0224/master
Browse files Browse the repository at this point in the history
✨ feat :: 메인 홈에 안내 팝업창
  • Loading branch information
osohyun0224 authored Aug 19, 2024
2 parents 0088649 + 7557d76 commit 386837b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 4 deletions.
62 changes: 62 additions & 0 deletions src/app/_component/atom/Popup/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react';
import styled from '@emotion/styled';

const ModalBackdrop = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
`;

const ModalContainer = styled.div`
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: 90%;
max-width: 500px;
text-align: center;
`;

const ModalHeader = styled.div`
margin-bottom: 20px;
font-size: 18px;
font-weight: bold;
`;

const ModalContent = styled.div`
margin-bottom: 20px;
`;

const CloseButton = styled.button`
padding: 10px 20px;
background-color: #f00;
color: #fff;
border: none;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
`;

function Popup({ onClose }) {
return (
<ModalBackdrop>
<ModalContainer>
<ModalHeader>공지 사항</ModalHeader>
<ModalContent>
현재 서비스는 자체 개발한 스크래핑 모듈을 통해 수집된 실제 사용자 데이터를 바탕으로 생성된 프로토타입입니다.
현재 백곰은 MVP(최소 기능 제품) 형태로 제공되고 있으며, 향후 앱 서비스로의 제공을 목표로 지속적으로 개선하고 있습니다.
</ModalContent>
<CloseButton onClick={onClose}>닫기</CloseButton>
</ModalContainer>
</ModalBackdrop>
);
}

export default Popup;
15 changes: 11 additions & 4 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { LocalStorage } from '@/hooks/useUtil';
import { getCertificate } from '../_lib/getCertificate';
import { Colors, fontGenerator } from '@/styles';
import { VaccineData } from '@/types/globalType';

import Popup from "@/app/_component/atom/Popup";
export const Container = styled.main`
min-height: 100vh;
width: 100%;
Expand Down Expand Up @@ -235,17 +235,24 @@ export default function Home() {
if (isLoading) return;
if (error) return <div>Error: {error}</div>;

const [showModal, setShowModal] = useState(true);

const handleModalClose = () => {
setShowModal(false);
};

return (
<>
{showModal && <Popup onClose={handleModalClose} />}
<Container>
<MainHeader title="홈" />
<GreetingContainer>
<UserName>{userName}님, </UserName>
<GreetingMessage>반가워요!</GreetingMessage>
</GreetingContainer>
<AlertContainer>
현재 서비스는 자체 개발한 스크래핑 모듈을 통해 수집된 실제 사용자 데이터를 바탕으로 생성된 프로토타입입니다. 현재 백곰은 MVP(최소 기능 제품) 형태로 제공되고 있으며, 향후 앱 서비스로의 제공을 목표로 지속적으로 개선하고 있습니다.
</AlertContainer>
<ImageContainer key={imageKey}>
<Image src={currentImage} alt="추천하는 이미지" />
</ImageContainer>
<div className="body_wrap">
<div className="content_head">
<MenuTitle
Expand Down

0 comments on commit 386837b

Please sign in to comment.