Skip to content

Commit

Permalink
Fe/dev2 (#106)
Browse files Browse the repository at this point in the history
* WIP: 깃허브 로그인 중

* WIP: 깃허브 로그인

* feat: 로컬 스토리지 토큰 읽어오기

* feat: authorization 추가

* fix: authorization 변수에 할당하여 지정

* feat: credentials 헤더  속성 추가

* refactor: strict 모드 주석 해제

* style: 주석 제거 및 margin추가

* feat: header 에 origin 추가

* style: 주석 제거 및 로딩스피너 추가

* design: 깃허브 아이콘 추가

* feat: input 엔터 키다운 이벤트

* fix: props 복원

* refactor: 열린, 닫힌 이슈 개수

* style: 따옴표 제거

* feat: 마일스톤 페이지에 갯수 표시
  • Loading branch information
minjeongHEO authored May 31, 2024
1 parent 9ddd102 commit e1868b0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
11 changes: 10 additions & 1 deletion FE/src/components/issues/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const initFetched = {
};
const resetListData = { id: null, title: null, createDate: null, milestoneName: null, author: null, assignees: null, labels: null };

const initIssueCount = {
isOpen: 0,
isClosed: 0,
};

export default function Main() {
const navigate = useNavigate();
const { state: selectedFilters, dispatch } = useFilterContext();
Expand All @@ -81,6 +86,7 @@ export default function Main() {
const [hasFetched, setHasFetched] = useState(initFetched);
const [labelCount, setLabelCount] = useState(0);
const [milestoneCount, setMilestoneCount] = useState(0);
const [issueCount, setIssueCount] = useState(initIssueCount);

const { data: countData } = useLabelMilestoneCountData();
const { data: issueList, isLoading: issueListIsLoading } = usefilteredIssueData();
Expand Down Expand Up @@ -205,6 +211,7 @@ export default function Main() {
const newIsOpenCount = issueListCount.openedIssueCount;
const newIsClosedCount = issueListCount.closedIssueCount;

setIssueCount({ isOpen: issueList.count.openedCount, isClosed: issueList.count.closedCount });
const newIssueList = issueList.filteredIssues;
setIssueDatas((prev) => ({ ...prev, count: { ...prev.count, isOpen: newIsOpenCount } }));
setIssueDatas((prev) => ({ ...prev, count: { ...prev.count, isClosed: newIsClosedCount } }));
Expand Down Expand Up @@ -276,14 +283,16 @@ export default function Main() {
/>
) : (
<NavFilterType
issueCount={issueDatas.count}
issueCount={issueCount}
dispatchTypeByFilterContents={dispatchTypeByFilterContents}
imageTypeItems={filterItemsByType.members}
labelTypeItems={filterItemsByType.labels}
milestoneTypeItems={filterItemsByType.milestones}
dispatch={dispatch}
ischecked={selectedFilters.issues.isClosed}
handleMouseEnter={handleMouseEnter}
labelCount={labelCount}
milestoneCount={milestoneCount}
/>
)}
</StyledBoxHeader>
Expand Down
4 changes: 2 additions & 2 deletions FE/src/components/labels/LabelEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ export default function LabelEditor({ isNew = true, togglePlusLabelState, toggle
{isNew ? (
<>
<PlusOutlined />
'완료'
완료
</>
) : (
<>
<IconEdit />
'편집 완료'
편집 완료
</>
)}
</CustomButton>
Expand Down
21 changes: 16 additions & 5 deletions FE/src/components/milestones/Main.jsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import Header from '../header/Header';
import { FlexRow, IndexContainer, MainContainer } from '../../styles/theme';
import { TagsOutlined, PlusOutlined } from '@ant-design/icons';
import { CustomButton } from '../../assets/CustomButton';
import { IconMilestone } from '../../assets/icons/IconMilestone';
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';
import { useLabelMilestoneCountData } from '../../hooks/useLabelData';

export default function MilestoneMain() {
const naivgate = useNavigate();
const clickMileStone = () => naivgate('/milestones');
const clickLabel = () => naivgate('/labels');

const { data: countData } = useLabelMilestoneCountData();
const [labelCount, setLabelCount] = useState(0);
const [milestoneCount, setMilestoneCount] = useState(0);

useEffect(() => {
if (!countData) return;
setLabelCount(countData.labelCount.count);
setMilestoneCount(countData.milestoneCount.isOpened + countData.milestoneCount.isClosed);
}, [countData]);

return (
<IndexContainer>
<Header />
<MainContainer>
<NavContainer>
<NavBtnContainer>
<StyledLabelBtn type={'container'} size={'large'} isDisabled={false} onClick={clickLabel}>
<StyledLabelBtn type={'outline'} size={'large'} isDisabled={false} onClick={clickLabel}>
<TagsOutlined />
레이블(0)
레이블({labelCount})
</StyledLabelBtn>
<StyledMilestoneBtn type={'outline'} size={'large'} isDisabled={false} onClick={clickMileStone}>
<StyledMilestoneBtn type={'container'} size={'large'} isDisabled={false} onClick={clickMileStone}>
<IconMilestone />
마일스톤(0)
마일스톤({milestoneCount})
</StyledMilestoneBtn>
</NavBtnContainer>
<CustomButton type={'container'} size={'large'} isDisabled={false}>
Expand Down

0 comments on commit e1868b0

Please sign in to comment.