Skip to content

Commit

Permalink
hotfix: #130 상세 페이지 내 페이지 이동 버튼 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
misung-dev committed Jul 12, 2024
1 parent 5acd220 commit d1781d4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/pages/EventDetail/AttendanceList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const AttendanceList = () => {
const response = await axiosInstance.get(
`/api/v1/events/attendanceList/${USER_ID}/${EVENT_ID}`,
);
const parsedStudents = response.data[0].attendanceListResponseDtos.map(
const parsedStudents = response.data[1].attendanceListResponseDtos.map(
(student) => ({
name: student.studentName,
number: student.studentNumber,
Expand Down
11 changes: 7 additions & 4 deletions src/pages/EventDetail/EventDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const EventDetailPage = () => {
console.log('EVENT_ID:', EVENT_ID);
const fetchData = async () => {
try {
const response = await axiosInstance.get(
const { data } = await axiosInstance.get(
`/api/v1/events/${USER_ID}/${EVENT_ID}`,
);
const eventData = response.data;
const eventData = data.eventSchedules[1];
if (eventData) {
const parsedEvent = {
title: eventData.eventTitle,
Expand Down Expand Up @@ -100,9 +100,12 @@ const EventDetailPage = () => {
{parsedEvents.detail}
</S.EventContentDescription>
</S.EventContent>
<S.SendButtonWrapper>
<S.ButtonWrapper>
<S.SendButton onClick={handleEmail}>출석 명단 전송</S.SendButton>
</S.SendButtonWrapper>
<S.GotoAttendancePageLink to="/attendance/student-id">
출석체크 페이지로 이동
</S.GotoAttendancePageLink>
</S.ButtonWrapper>
</S.EventSection>
</S.DetailWrapper>
)}
Expand Down
29 changes: 23 additions & 6 deletions src/pages/EventDetail/EventDetailPage.style.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';
import { BREAKPOINTS } from '../../styles';
import { Link } from 'react-router-dom';

export const Background = styled.div`
display: flex;
Expand Down Expand Up @@ -148,24 +149,40 @@ export const EventContentDescription = styled.p`
font-size: 16px;
`;

export const SendButtonWrapper = styled.div`
export const ButtonWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
margin: 20px 0px;
margin: 20px 0;
gap: 6px;
`;

export const SendButton = styled.button`
const buttonStyle = css`
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 40px;
border: none;
border-radius: 4px;
background-color: #0075ff;
color: white;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;
`;

export const SendButton = styled.button`
${buttonStyle};
background-color: #0075ff;
color: white;
&:hover {
background-color: #0167cd;
}
`;

export const GotoAttendancePageLink = styled(Link)`
${buttonStyle}
background-color: #ffffff;
color: #383636;
border: 2px solid #0075ff;
`;

0 comments on commit d1781d4

Please sign in to comment.