Skip to content

Commit

Permalink
๐ŸŽจ Style: Modal ์Šคํƒ€์ผ ํŒŒ์ผ ์ •๋ฆฌ (#204)
Browse files Browse the repository at this point in the history
[Style] Modal ์Šคํƒ€์ผ ํŒŒ์ผ ์ •๋ฆฌ
  • Loading branch information
whoisrey authored Jul 17, 2023
2 parents c3fe405 + 28494fb commit e5b2229
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 62 deletions.
31 changes: 6 additions & 25 deletions src/components/common/Modal/IconPostModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LogOut from '../Alert/LogOut';
import { useNavigate } from 'react-router-dom';
import { deletePost } from '../../../utils/Apis';
import { tokenAtom } from '../../../atoms/UserAtom';
import {Container, ButtonContainer} from '../Modal/IconPostModalStyle'

const IconPostModal = ({ topText, btmText, accountName, data, key, setIsPostDeleted,
comment, onClick }) => {
Expand Down Expand Up @@ -71,37 +72,17 @@ comment, onClick }) => {

return (
<>
<div>
<Separator />
<ModalButtons>
<Container>
<ButtonContainer>
<button onClick={deleteClick}>{topText}</button>
<button onClick={modifyClick}>{btmText}</button>
</ModalButtons>
</div>
</ButtonContainer>
</Container>
{showAlert && <Alert message={alertMessage} setIsPostDeleted={setIsPostDeleted}
onClose={handleAlertClose} done={alertDone} text={topText.replace("ํ•˜๊ธฐ","")} />}
{showLogOut && <LogOut message={alertMessage} onClose={handleLogOutClose} done={alertDone}/>}
</>
);
};

export default IconPostModal;

const Separator = styled.div`
width: 5rem;
height: 0.4rem;
background: ${({ theme }) => theme.colors.borderColor};
margin: 1.6rem 17rem;
border-radius: 0.5rem;
`;

const ModalButtons = styled.div`
display: flex;
flex-direction: column;
margin-top: 2rem;
button{
text-align: left;
font-size: 14px;
padding: 1.3rem 0rem 1.4rem 2.6rem;
}
`;
export default IconPostModal;
22 changes: 22 additions & 0 deletions src/components/common/Modal/IconPostModalStyle.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import styled from 'styled-components';

export const Container = styled.div`
`

export const ButtonContainer = styled.div`
&:before{
content: "";
width: 5rem;
height: 0.4rem;
background: ${({ theme }) => theme.colors.borderColor};
margin: 1.6rem 17rem;
border-radius: 0.5rem;
}
display: flex;
flex-direction: column;
button{
text-align: left;
font-size: 14px;
padding: 1.3rem 0rem 1.4rem 2.6rem;
}
`;
42 changes: 5 additions & 37 deletions src/components/common/Modal/PostModal.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import styled from 'styled-components';
import Alert from '../Alert/Alert';
import {Container, ButtonContainer} from '../Modal/PostModalStyle'

const PostModal = ({ text }) => {
const [showAlert, setShowAlert] = useState(false);
Expand All @@ -25,46 +25,14 @@ const PostModal = ({ text }) => {

return (
<>
<div>
<ModalContent>
<Separator />
<ModalButtons>
<Container>
<ButtonContainer>
<button onClick={handleClick}>{text}</button>
</ModalButtons>
</ModalContent>
</div>
</ButtonContainer>
</Container>
{showAlert && <Alert message={alertMessage} onClose={handleAlertClose} done={alertDone}/>}
</>
);
};

export default PostModal;

const ModalContent = styled.div`
width: 39rem;
height: 9.2rem;
background-color: ${({ theme }) => theme.colors.whiteText};
border-top-left-radius: 0.8rem;
border-top-right-radius: 0.8rem;
`;

const Separator = styled.div`
width: 5rem;
height: 0.4rem;
background: ${({ theme }) => theme.colors.borderColor};
margin: 1.6rem 17rem;
border-radius: 0.5rem;
`;

const ModalButtons = styled.div`
display: flex;
flex-direction: column;
margin-top: 2rem;
button{
text-align: left;
font-size: ${({ theme }) => theme.fontSize.medium};
padding: 1.3rem 0rem 1.4rem 2.6rem;
}
`;


25 changes: 25 additions & 0 deletions src/components/common/Modal/PostModalStyle.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import styled from 'styled-components';

export const Container = styled.div`
`;

export const ButtonContainer = styled.div`
&:before{
content:"";
width: 5rem;
height: 0.4rem;
background: ${({ theme }) => theme.colors.borderColor};
margin: 0 17rem;
border-radius: 0.5rem;
}
display: flex;
flex-direction: column;
margin-top: 2rem;
button{
text-align: left;
font-size: ${({ theme }) => theme.fontSize.medium};
padding: 1.3rem 2rem 2rem 2.6rem;
}
`;


0 comments on commit e5b2229

Please sign in to comment.