Skip to content

Commit

Permalink
Merge pull request #437 from Chaem03/feature/#349
Browse files Browse the repository at this point in the history
🎨 Design: 블러이미지 추가
  • Loading branch information
Chaem03 authored Aug 6, 2024
2 parents db9de06 + eed1e4f commit c69beee
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/assets/blur.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions src/components/DateRangeCalendar/DateRangeCalendar.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useState, forwardRef, useImperativeHandle } from "react";
import * as S from "./styled";
import {
routineStart,
Expand All @@ -12,7 +12,7 @@ import { postRoutineRegister } from "../../apis/register";
import { format } from "date-fns";
import { addHours } from "date-fns";

const DateRangeCalendar = () => {
const DateRangeCalendar = forwardRef((ref) => {
const [currentDate, setCurrentDate] = useState(new Date());
const [selectedStartDate, setSelectedStartDate] =
useRecoilState(routineStart);
Expand All @@ -21,6 +21,15 @@ const DateRangeCalendar = () => {
const [, setIsCheckVisible] = useRecoilState(CheckVisible);
const id = useRecoilValue(registerID);

const resetCalendar = () => {
setStartDate(null);
setEndDate(null);
};

useImperativeHandle(ref, () => ({
resetCalendar,
}));

const timeZone = "Asia/Seoul";
const getZonedDate = (date) => addHours(new Date(date), 9);

Expand Down Expand Up @@ -165,6 +174,6 @@ const DateRangeCalendar = () => {
<S.ConfirmButton onClick={handleConfirm}>확인</S.ConfirmButton>
</S.CalendarContainer>
);
};
});

export default DateRangeCalendar;
7 changes: 5 additions & 2 deletions src/pages/RandomDice/RandomDice.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React, { useState, useEffect, useRef } from "react";
import * as S from "./styled";
import { Header } from "../../components/common/Header/Header";
import DiceBackground from "@/assets/DiceBackground.svg";
Expand Down Expand Up @@ -36,7 +36,7 @@ export const RandomDice = () => {
alignItems: "center",
});
const [clickCalendarButton, setClickCalendarButton] = useState(false);

const calendarRef = useRef(null);
// 화면 크기 조정에 따른 스타일 변경
useEffect(() => {
const handleResize = () => {
Expand Down Expand Up @@ -107,6 +107,9 @@ export const RandomDice = () => {
setRolling(true);
setShowContent(false);
setClickCalendarButton(false);
if (calendarRef.current) {
calendarRef.current.resetCalendar(); // 캘린더 초기화 함수 호출
}
};

const handleAddCalendar = () => {
Expand Down
19 changes: 10 additions & 9 deletions src/pages/Share/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const BannerImage = styled.img`
export const BlurImage = styled.img`
position: absolute;
z-index: 5;
bottom: 2px;
bottom: 0.1px;
left: 0;
width: 100%;
height: 90px;
Expand Down Expand Up @@ -103,13 +103,13 @@ export const ClearMain = styled.div`
}
.textOverlay {
position: absolute;
top: 50%;
top: 47%;
left: 50%;
z-index: 5;
font-weight: bold;
text-align: center;
color: white;
font-size: 1.5rem;
font-size: 2rem;
transform: translate(-50%, -50%);
}
Expand All @@ -128,19 +128,20 @@ export const shareBtn = styled.button`
flex-direction: row;
justify-content: center;
align-items: center;
gap: 12px;
width: 200px;
gap: 5px;
width: 260px;
height: 40px;
color: black;
color: white;
background-color: #78a1b5;
border-radius: 19px;
border: 1.228px solid #c4d9e2;
background: rgba(196, 217, 226, 0.5);
padding: 6px;
.ImgSave {
display: flex;
color: white;
background-color: #78a1b5;
font-size: 1rem;
justify-content: center;
align-items: center;
Expand Down
1 change: 1 addition & 0 deletions src/pages/SubCategoryPage/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const Layout = styled.div`
justify-content: flex-start;
gap: 40px;
height: 640px;
margin-bottom: 5rem;
}
`;

Expand Down

0 comments on commit c69beee

Please sign in to comment.