Skip to content

Commit

Permalink
[feat] 이슈 상태 변경/assignee 선택 버튼 조건부 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
harin0707 committed May 31, 2024
1 parent 15dee8e commit 2860ce4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions src/components/issue/InfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ interface InputProps {
infoType: string;
data: string;
patchData: UpdateIssueInfo;
isAssigned: number;
}

const InfoBox: React.FC<InputProps> = ({infoType, data, patchData}) => {
const InfoBox: React.FC<InputProps> = ({infoType, data, patchData, isAssigned}) => {
const [isVisible, setVisiable] = useRecoilState(modalState);
const [issueId, setIssueId] = useState<string|null>(null);
const patchStatus = usePatch('issues/status', issueId ? Number(issueId) : 0)
Expand Down Expand Up @@ -55,11 +56,11 @@ const InfoBox: React.FC<InputProps> = ({infoType, data, patchData}) => {
<DescBoxWrapper>
<div id='desc-container'>
<div>{infoType}</div>
{infoType=="State" &&
<div id="change" onClick={() => handleStatusUpdate()}>변경</div>}
{infoType=="Assignee" &&
<div id="change" onClick={handleAssignee}>변경</div>}
{isVisible&&(
{(infoType=="State" && isAssigned!==0) &&(
<div id="change" onClick={() => handleStatusUpdate()}>변경</div>)}
{(infoType==="Assignee" && isAssigned===0) && (
<div id="change" onClick={handleAssignee}>선택</div>)}
{isVisible&&(
<SelectAssignee />)}
</div>
<div className='forDesc'>
Expand Down
14 changes: 7 additions & 7 deletions src/pages/issue/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ const Issue = () => {
</BoardTopWrapper>

<DescWrapper>
<InfoBox infoType="State" data={data.status} patchData={updateIssueInfo} />
<InfoBox infoType="Priority" data={data.priority} patchData={updateIssueInfo} />
<InfoBox infoType="State" data={data.status} patchData={updateIssueInfo} isAssigned={Number(data.assignee)} />
<InfoBox infoType="Priority" data={data.priority} patchData={updateIssueInfo} isAssigned={Number(data.assignee)}/>
</DescWrapper>

<DescWrapper>
<InfoBox infoType="Reporter" data={data.reporter} patchData={updateIssueInfo} />
<InfoBox infoType="Reported Date" data={data.created_at} patchData={updateIssueInfo} />
<InfoBox infoType="Reporter" data={data.reporter} patchData={updateIssueInfo} isAssigned={Number(data.assignee)}/>
<InfoBox infoType="Reported Date" data={data.created_at} patchData={updateIssueInfo} isAssigned={Number(data.assignee)}/>
</DescWrapper>

<DescWrapper>
<InfoBox infoType="Assignee" data={data.assignee} patchData={updateIssueInfo} />
<InfoBox infoType="Fixer" data={data.fixer} patchData={updateIssueInfo}/>
<InfoBox infoType="Assignee" data={data.assignee} patchData={updateIssueInfo} isAssigned={Number(data.assignee)}/>
<InfoBox infoType="Fixer" data={data.fixer} patchData={updateIssueInfo} isAssigned={Number(data.assignee)}/>
</DescWrapper>

<DescWrapper>
<InfoBox infoType="Description" data={data.description} patchData={updateIssueInfo} />
<InfoBox infoType="Description" data={data.description} patchData={updateIssueInfo} isAssigned={Number(data.assignee)}/>
</DescWrapper>

<CommentWrapper>
Expand Down

0 comments on commit 2860ce4

Please sign in to comment.