Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Primary40, Outlined36 컴포넌트 추가 및 수정, card hover 시 에니메이션 추가 외 #82

Merged
merged 10 commits into from
Mar 8, 2024
Merged
2 changes: 1 addition & 1 deletion src/components/common/Buttons/BackToPostButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function BackToPostButton({ moveLink, btnName }) {
const navigate = useNavigate();
Expand Down
66 changes: 0 additions & 66 deletions src/components/common/Buttons/ButtonStyle.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/common/Buttons/DeleteRecipientButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';
import { useNavigate, useParams } from 'react-router-dom';
import { deleteRecipient } from '../../../api/DeleteApi';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function DeleteRecipientButton() {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Buttons/EditButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { useNavigate, useParams } from 'react-router-dom';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function EditButton() {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Buttons/EditMessageButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { useNavigate, useParams } from 'react-router-dom';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function EditMessageButton({ messageID }) {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Buttons/PostButton.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function PostButton({ onSubmit, btnDisable }) {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Buttons/PutPatchButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function PutPatchButton({ onSubmit, btnDisable }) {
const navigate = useNavigate();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Buttons/movePageButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';
import { useNavigate } from 'react-router-dom';
import { Primary56 } from './ButtonStyle';
import { Primary56 } from '../../../styles/ButtonStyle';

function MovePageButton({ moveLink, btnName }) {
const navigate = useNavigate();
Expand Down
21 changes: 4 additions & 17 deletions src/components/common/Header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { Outlined40 } from '../../styles/ButtonStyle';

const StyledNav = styled.nav`
width: 100%;
Expand All @@ -25,20 +26,8 @@ const StyledHeader = styled.div`
}
`;

const ButtonContainer = styled.div`
button {
height: 40px;
border-radius: 6px;
padding: 8px 16px;
border: 1px solid #ccc;
background: #fff;
cursor: pointer;
font-size: 16px;
line-height: 26px;
letter-spacing: -0.16px;
text-align: center;
}
`;
const Button = styled(Outlined40)``;

const LogoURL = styled.a`
display: flex;
padding: 6px 0;
Expand All @@ -65,9 +54,7 @@ function Header({ showButton }) {
</LogoURL>
{showButton && (
<Link to="/post">
<ButtonContainer>
<button type="button">롤링 페이퍼 만들기</button>
</ButtonContainer>
<Button>롤링 페이퍼 만들기</Button>
</Link>
)}
</StyledHeader>
Expand Down
13 changes: 2 additions & 11 deletions src/components/common/ModalWindow.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useState, useEffect } from 'react';
import styled from 'styled-components';
import { Primary40 } from '../../styles/ButtonStyle';
// import { useKakaoShare } from './useKakaoShare';

const ModalBox = styled.div`
Expand All @@ -25,18 +26,8 @@ const ModalBody = styled.div`
transform: translate(-50%, -30%);
`;

const CloseBtn = styled.button`
display: flex;
const CloseBtn = styled(Primary40)`
width: 120px;
padding: 7px 16px;
align-items: center;
justify-content: center;
border-radius: 6px;
background: var(--purple600);
color: #fff;
font-size: 16px;
line-height: 26px; /* 162.5% */
letter-spacing: -0.16px;
position: absolute;
bottom: 40px;

Expand Down
1 change: 0 additions & 1 deletion src/components/modal/CardModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function CardModal({
}) {
const location = useLocation();
const isEditRoute = location.pathname.includes('/edit');
console.log(id, isEditRoute);

const createdDays = new Date(cardCreatedAt);
const fontClass = {
Expand Down
4 changes: 4 additions & 0 deletions src/components/post/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export const CardContentWrapper = styled.div`
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);

cursor: pointer;
transition: all 0.5s ease-out;
&:hover {
transform: translateY(-1.2rem);
}

@media (max-width: 1023px) {
width: 50%;
Expand Down
14 changes: 2 additions & 12 deletions src/components/post/SubHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ShareToggle from '../modal/ShareToggle';
import KakaoModal from '../modal/KakaoModal';
import ModalPortal from '../modal/ModalPortal';
import Toast from '../common/Toast';
import { Outlined36 } from '../../styles/ButtonStyle';
import { getAllMessages } from '../../api/GetApi';

const Text = css`
Expand All @@ -21,15 +22,6 @@ const FlexCenter = css`
align-items: center;
`;

const Button = css`
${FlexCenter}
padding: 6px 16px;
border-radius: 6px;
border: 1px solid var(--gray300);
background: var(--white);
gap: 10px;
`;

const SubHeaderWrapper = styled.div`
width: 100%;
background-color: var(--white);
Expand Down Expand Up @@ -147,9 +139,7 @@ const SplitBarVertical2 = styled(SplitBarVertical)`
margin: 0 13px;
`;

const ShareButton = styled.button`
${Button}

const ShareButton = styled(Outlined36)`
@media (max-width: 470px) {
padding: 6px 8px;
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/post/postmake/ColorSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const ColorOption = styled.div`
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.08);
cursor: pointer;

transition: all 0.4s ease-out;
&:hover {
transform: translateY(-1.2rem);
}
@media (max-width: 768px) {
width: 154px;
height: 154px;
Expand Down
5 changes: 4 additions & 1 deletion src/components/post/postmake/ImageSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ const ImageOption = styled.div`
height: 168px;
margin: 5px;
cursor: pointer;

transition: all 0.4s ease-out;
&:hover {
transform: translateY(-1.2rem);
}
@media (max-width: 768px) {
width: 154px;
height: 154px;
Expand Down
3 changes: 2 additions & 1 deletion src/components/post/postmake/ToggleButton.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import styled from 'styled-components';
import { Secondary } from '../../../styles/ButtonStyle';

function ToggleButton({ state, handler, text1, text2 }) {
return state ? (
Expand All @@ -20,7 +21,7 @@ const SelectToggle = styled.div`
margin-top: 24px;
`;

const BtnCommon = styled.button`
const BtnCommon = styled(Secondary)`
display: flex;
width: 122px;
height: 40px;
Expand Down
21 changes: 2 additions & 19 deletions src/components/post/subheader/EmojiDropDown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@ import { useState, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import { submitEmojiPost } from '../../../api/PostApi';
import { getEmojiData } from '../../../api/GetApi';
import { Outlined36 } from '../../../styles/ButtonStyle';

const FlexCenter = css`
display: flex;
justify-content: center;
align-items: center;
`;

const Button = css`
${FlexCenter}
padding: 6px 16px;
border-radius: 6px;
border: 1px solid var(--gray300);
background: var(--white);
gap: 10px;
`;

const EmojiGroup = styled.div`
display: flex;
gap: 8px;
Expand Down Expand Up @@ -93,17 +85,8 @@ const EmojiGroupInDropDown = styled(EmojiGroup)`
grid-template-columns: 63px 63px 63px 63px;
`;

const EmojiAddButton = styled.div`
${Button}
const EmojiAddButton = styled(Outlined36)`
position: relative;
cursor: pointer;

color: var(--gray-900, #181818);
font-family: Pretendard;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 24px;

@media (max-width: 470px) {
span {
Expand Down
4 changes: 4 additions & 0 deletions src/pages/PostId.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export const CardWrapper = styled.div`
const CardAdd = styled(CardContentWrapper)`
justify-content: center;
position: relative;
transition: all 0.5s ease-out;
&:hover {
transform: translateY(-1.2rem);
}
`;
// eslint-disable-next-line
const PlusIcon = styled.div`
Expand Down
Loading