Skip to content

Commit

Permalink
Alert Color Ui
Browse files Browse the repository at this point in the history
  • Loading branch information
kichan05 committed Feb 16, 2024
1 parent ff218fe commit 38c7d68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/component/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ const AlertMessageStyle = styled.li`
background-color: ${p => p.theme.color.Gray1};
border: 1px solid ${p => p.theme.color.Gray4};
border-left: 5px solid ${p => p.theme.color.Blue5};
border-left: 5px solid ${p => {
if(p.color)
return p.color
else
return p.theme.color.Blue5
}};
border-radius: 0.25em;
padding: 12px;
margin-bottom: 8px;
Expand Down Expand Up @@ -72,13 +77,13 @@ const AlertMessage = ({state, message, timeout}) => {
}

useEffect(() => {
// const remove = setTimeout(() => {
// removeMessage(message.id)
// }, 5000)
const remove = setTimeout(() => {
removeMessage(message.id)
}, 5000)
}, [])

return (
<AlertMessageStyle state={state} timeout={timeout}>
<AlertMessageStyle state={state} timeout={timeout} color={message.color}>
<div className="title-wrap">
<div className="title">{message.title}</div>
<IconButton
Expand Down
4 changes: 3 additions & 1 deletion src/component/BusunessCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import edcanTypo from "./../assets/edcan_typo.svg"
import {SCoreDream} from "../style/Font";
import {UI_ACTION_TYPE, useUiDispatch} from "../context/UiReducer";
import {v4} from "uuid";
import {color} from "../style/theme";

const BusinessCardStyle = styled.div`
width: 300px;
Expand Down Expand Up @@ -181,7 +182,8 @@ export const BusinessCard = ({onMouseMove, onMouseOut, cardState}) => {
message: {
id: v4(),
title: "메일 주소 복사 완료",
message: "메일 주소를 복사했어요"
message: "메일 주소를 복사했어요",
color: color.Blue5,
}
})
})
Expand Down

0 comments on commit 38c7d68

Please sign in to comment.