-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/V1.0.1' into main
- Loading branch information
Showing
28 changed files
with
694 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pcot", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"private": true, | ||
"homepage": ".", | ||
"dependencies": { | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { PopupModal } from "@components/Modal"; | ||
import React, { Dispatch, SetStateAction, useEffect, useState } from "react"; | ||
import { useAlarm } from "@hooks/useAlarm"; | ||
|
||
import * as S from "./style"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
const AlarmModal = ({ | ||
active, | ||
setActive, | ||
}: { | ||
active: boolean; | ||
setActive?: Dispatch<SetStateAction<boolean>>; | ||
}) => { | ||
const { onGetAlarm, onPatchAlarm } = useAlarm(); | ||
const navigate = useNavigate(); | ||
const [alarmList, setAlarmList] = useState<Array<any>>([]); | ||
|
||
useEffect(() => { | ||
onGetAlarm(1) | ||
.then((res: any) => { | ||
const alarmList = res.map((list: any) => ( | ||
<div key={list.idx} style={{ textDecoration: "none" }}> | ||
{list.view === "Y" ? ( | ||
<S.grayFilter>{box(list)}</S.grayFilter> | ||
) : ( | ||
<S.box>{box(list)}</S.box> | ||
)} | ||
</div> | ||
)); | ||
setAlarmList(alarmList); | ||
}) | ||
.catch((err) => { | ||
console.log(err); | ||
}); | ||
}, []); | ||
|
||
const onClickBox = (list: any) => { | ||
onPatchAlarm(list.idx).then((res: any) => { | ||
console.log(res); | ||
}); | ||
navigate(`${list.path}`); | ||
}; | ||
|
||
const box = (list: any) => ( | ||
<S.content onClick={() => onClickBox(list)}> | ||
<S.title>{list.text}</S.title> | ||
<S.path>{list.path}</S.path> | ||
<S.time>{list.registerTime}</S.time> | ||
</S.content> | ||
); | ||
|
||
const renderAlarmList = () => { | ||
return <div>{alarmList}</div>; | ||
}; | ||
|
||
return ( | ||
<div> | ||
<PopupModal active={active} setActive={setActive}> | ||
<div> | ||
<S.modalType>Notification</S.modalType> | ||
<div>{renderAlarmList() ? renderAlarmList() : <div>알람을 찾을 수 없습니다!</div>}</div> | ||
</div> | ||
</PopupModal> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AlarmModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import styled from "styled-components"; | ||
|
||
export const modalType = styled.h2` | ||
font-size: 30px; | ||
width: 100%; | ||
height: 10%; | ||
color: black; | ||
text-align: center; | ||
`; | ||
|
||
export const box = styled.div` | ||
margin: auto; | ||
margin-top: 10px; | ||
width: 95%; | ||
height: 10%; | ||
border-radius: 10px; | ||
overflow-y: scroll; | ||
text-align: left; | ||
border: 1px solid blue; | ||
cursor: pointer; | ||
`; | ||
|
||
export const grayFilter = styled.div` | ||
margin: auto; | ||
margin-top: 10px; | ||
width: 95%; | ||
height: 10%; | ||
border-radius: 10px; | ||
overflow-y: scroll; | ||
text-align: left; | ||
border: 1px solid blue; | ||
cursor: pointer; | ||
background-color: rgb(230, 230, 230); | ||
`; | ||
|
||
export const content = styled.div` | ||
width: 97%; | ||
height: 10%; | ||
margin-top: 1.5%; | ||
margin-bottom: 1.5%; | ||
margin-left: 1.5%; | ||
margin-right: 1.5%; | ||
`; | ||
|
||
export const title = styled.h1` | ||
margin: auto; | ||
font-size: 25px; | ||
color: black; | ||
`; | ||
|
||
export const path = styled.h3` | ||
font-size: small; | ||
width: 50%; | ||
color: gray; | ||
`; | ||
|
||
export const time = styled.h3` | ||
font-size: small; | ||
/* float: right; */ | ||
margin-right: 5px; | ||
text-align: right; | ||
color: gray; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,9 @@ | ||
import styled from "styled-components"; | ||
|
||
export const box = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
overflow-y: scroll; | ||
text-align: left; | ||
`; | ||
|
||
export const content = styled.div` | ||
width: 100%; | ||
height: 20%; | ||
margin-bottom: 10%; | ||
`; | ||
|
||
export const title = styled.h1` | ||
font-size: small; | ||
color: black; | ||
`; | ||
|
||
export const path = styled.h3` | ||
font-size: small; | ||
width: 90%; | ||
color: gray; | ||
`; | ||
|
||
export const time = styled.h3` | ||
font-size: small; | ||
/* float: right; */ | ||
text-align: right; | ||
color: gray; | ||
`; | ||
|
||
export const AlarmBtn = styled.div` | ||
export const AlarmBtn = styled.img` | ||
border-radius: 50%; | ||
width: 5%; | ||
height: 10%; | ||
background-color: black; | ||
margin-top: 3px; | ||
width: 27px; | ||
height: 30px; | ||
right: 45px; | ||
`; |
Oops, something went wrong.