diff --git a/components/common/atoms/Input.tsx b/components/common/atoms/Input.tsx
index 1451722f0..9d7e0fa7b 100644
--- a/components/common/atoms/Input.tsx
+++ b/components/common/atoms/Input.tsx
@@ -1,23 +1,23 @@
-import { ChangeEvent, ReactNode, useEffect, useRef, useState } from 'react';
-import { InputModule } from './inputStyle';
-import Button from './Button';
import { Relative } from '@/styles/commonStyle';
+import { ChangeEvent, ReactNode, useRef, useState } from 'react';
+import Button from './Button';
+import { InputModule } from './inputStyle';
interface IButtonModule {
- $id?: string;
- $type?: string;
- $inputClass?: string;
- $btnShow?: boolean;
- $placeholder?: string;
- $beforeBgIcon?: string;
- $btnClass?: string;
- $clickEvent?: string | undefined;
+ id?: string;
+ type?: string;
+ inputClass?: string;
+ btnShow?: boolean;
+ placeholder?: string;
+ $beforeIcon?: string;
+ btnClass?: string;
+ clickEventType?: string | undefined;
children?: ReactNode;
onclick?: () => void;
onchange?: (value: string) => void;
}
-function Input({ $id, $btnShow = false, $type = 'text', $inputClass, $placeholder, $beforeBgIcon = '', $btnClass = '', $clickEvent, children, onchange }: IButtonModule) {
+function Input({ id, btnShow = false, type = 'text', inputClass, placeholder, $beforeIcon = '', btnClass = '', clickEventType, children, onchange }: IButtonModule) {
const [value, setValue] = useState('');
const refInput = useRef(null);
@@ -44,19 +44,19 @@ function Input({ $id, $btnShow = false, $type = 'text', $inputClass, $placeholde
<>
- {$btnShow && $clickEvent && (
+ {btnShow && clickEventType && (
)}
diff --git a/components/common/atoms/LinkButton.tsx b/components/common/atoms/LinkButton.tsx
index 9e30554a8..84c4c45d9 100644
--- a/components/common/atoms/LinkButton.tsx
+++ b/components/common/atoms/LinkButton.tsx
@@ -1,17 +1,18 @@
import { LinkModule } from './LinkButtonStyle';
interface IButtonModule {
children: React.ReactNode;
- $link: string;
- $linkClass?: string;
- $target?: string;
+ href: string;
+ linkClass?: string;
+ target?: string;
}
-export default function LinkButton({ children, $link, $linkClass, $target = '_self' }: IButtonModule) {
+export default function LinkButton({ children, href, linkClass, target = '_self' }: IButtonModule) {
return (
+ href={href}
+ className={linkClass}
+ target={target}
+ scroll={false}>
{children}
);
diff --git a/components/common/atoms/LinkButtonStyle.ts b/components/common/atoms/LinkButtonStyle.ts
index 23e730851..1b9496f89 100644
--- a/components/common/atoms/LinkButtonStyle.ts
+++ b/components/common/atoms/LinkButtonStyle.ts
@@ -1,7 +1,7 @@
-import styled from 'styled-components';
+import { font24 } from '@/styles/commonStyle';
import { theme } from '@/styles/theme';
import Link from 'next/link';
-import { font24 } from '@/styles/commonStyle';
+import styled from 'styled-components';
export const LinkModule = styled(Link)`
position: relative;
@@ -40,7 +40,7 @@ export const LinkModule = styled(Link)`
line-height: 37px;
}
}
- &.mideum {
+ &.medium {
width: 80px;
font-size: 14px;
line-height: 37px;
diff --git a/components/common/atoms/buttonStyle.ts b/components/common/atoms/buttonStyle.ts
index e68b69124..b71bd69ae 100644
--- a/components/common/atoms/buttonStyle.ts
+++ b/components/common/atoms/buttonStyle.ts
@@ -2,8 +2,8 @@ import { theme } from '@/styles/theme';
import styled from 'styled-components';
export const ButtonModule = styled.button<{
- $afterButtonIcon: string;
- $BeforButtonIcon: string;
+ $afterIcon?: string;
+ $beforeIcon?: string;
}>`
&.button {
&--outlined {
@@ -28,13 +28,13 @@ export const ButtonModule = styled.button<{
&--icon-before {
display: inline-block;
padding-left: 22px;
- background: url(${({ $BeforButtonIcon }) => $BeforButtonIcon || ''}) no-repeat left center;
+ background: url(${({ $beforeIcon }) => $beforeIcon || ''}) no-repeat left center;
background-size: 18px 18px;
}
&--icon-after {
display: inline-block;
padding-right: 20px;
- background: url(${({ $afterButtonIcon }) => $afterButtonIcon || ''}) no-repeat right center;
+ background: url(${({ $afterIcon }) => $afterIcon || ''}) no-repeat right center;
background-size: 18px 18px;
}
&--gradient {
@@ -87,7 +87,7 @@ export const ButtonModule = styled.button<{
line-height: 37px;
}
}
- &.mideum {
+ &.medium {
font-size: 14px;
line-height: 37px;
font-weight: 600;
diff --git a/components/common/atoms/inputStyle.ts b/components/common/atoms/inputStyle.ts
index 8168f5c97..d0e075be0 100644
--- a/components/common/atoms/inputStyle.ts
+++ b/components/common/atoms/inputStyle.ts
@@ -1,7 +1,7 @@
import { theme } from '@/styles/theme';
import styled from 'styled-components';
-export const InputModule = styled.input<{ $beforeBgIcon: string }>`
+export const InputModule = styled.input<{ $beforeIcon: string }>`
padding: 0 15px;
width: 100%;
line-height: 58px;
@@ -26,7 +26,7 @@ export const InputModule = styled.input<{ $beforeBgIcon: string }>`
line-height: 54px;
color: ${theme.color.gray6};
border-radius: 0.625rem;
- background: #f5f5f5 url(${({ $beforeBgIcon }) => $beforeBgIcon || ''}) no-repeat left 1rem center;
+ background: #f5f5f5 url(${({ $beforeIcon }) => $beforeIcon || ''}) no-repeat left 1rem center;
background-size: 1rem 1rem;
box-sizing: border-box;
@media screen and (max-width: ${theme.screenSize.moLarge}) {
@@ -38,7 +38,7 @@ export const InputModule = styled.input<{ $beforeBgIcon: string }>`
width: 100%;
padding: 0 120px 0 52px;
line-height: 67px;
- background: #fff url(${({ $beforeBgIcon }) => $beforeBgIcon || ''}) no-repeat left 20px center;
+ background: #fff url(${({ $beforeIcon }) => $beforeIcon || ''}) no-repeat left 20px center;
border-radius: 15px;
@media screen and (max-width: ${theme.screenSize.moLarge}) {
padding: 0 100px 0 34px;
diff --git a/components/common/headerStyle.ts b/components/common/headerStyle.ts
index 6755c2fa7..4a147da66 100644
--- a/components/common/headerStyle.ts
+++ b/components/common/headerStyle.ts
@@ -1,7 +1,6 @@
-import { DFlaxAlignCenter, DFlaxAlignCenterBtw, dflexCenter } from '@/styles/commonStyle';
+import { DFlaxAlignCenterBtw, dflexCenter } from '@/styles/commonStyle';
import { theme } from '@/styles/theme';
import styled from 'styled-components';
-import Button from './atoms/Button';
export const HeaderWrap = styled.header<{ $position: boolean | undefined }>`
position: ${({ $position }) => ($position ? 'absolute' : 'fixed')};
diff --git a/components/folder/FolderButtonList.tsx b/components/folder/FolderButtonList.tsx
index 29503d0be..4fbc53c80 100644
--- a/components/folder/FolderButtonList.tsx
+++ b/components/folder/FolderButtonList.tsx
@@ -1,30 +1,30 @@
import { BookMarkBtnList } from '@/styles/folderStyle';
import { memo } from 'react';
import Button from '../common/atoms/Button';
-import { IFolderMenuButtonApi } from './interface';
+import { IFolderMenuButton } from './interface';
interface IButtonList {
- $menu: IFolderMenuButtonApi | null;
- $activeBtnId: number;
- onClick: (id: number) => void;
+ $menu?: IFolderMenuButton[];
+ $activeBtnId: string;
+ onClick: (id: string) => void;
}
function FolderButtonList({ $menu, $activeBtnId, onClick }: IButtonList) {
return (
{$menu &&
- $menu.data?.map((item) => (
+ $menu.map((item) => (
))}
diff --git a/components/folder/FolderContentControll.tsx b/components/folder/FolderContentControl.tsx
similarity index 75%
rename from components/folder/FolderContentControll.tsx
rename to components/folder/FolderContentControl.tsx
index bcf145e10..de4e59fd4 100644
--- a/components/folder/FolderContentControll.tsx
+++ b/components/folder/FolderContentControl.tsx
@@ -1,9 +1,9 @@
-import { memo } from 'react';
import { FontLS } from '@/styles/commonStyle';
-import { ShareBox } from '../share/shareStyle';
import { ShareListBtn } from '@/styles/folderStyle';
+import { memo } from 'react';
import Button from '../common/atoms/Button';
import LinkButton from '../common/atoms/LinkButton';
+import { ShareBox } from '../share/shareStyle';
const folderControlBtn = [
{
@@ -26,20 +26,20 @@ const folderControlBtn = [
},
];
-interface iControll {
- $title: string;
+interface iControl {
+ $title?: string;
onclick: (type: string) => void;
- $id?: number;
+ id?: string;
}
-function FolderContentControll({ $title, onclick, $id }: iControll) {
+function FolderContentControl({ $title, onclick, id }: iControl) {
const handleModalOpen = (type: string) => {
onclick(type);
};
return (
- {$id && $id === -1 ? (
+ {id && id === `전체` ? (
@@ -47,9 +47,9 @@ function FolderContentControll({ $title, onclick, $id }: iControll) {
) : (
+ href={`/shared/${id}`}
+ linkClass='link--title-text tab-title'
+ target='_blank'>
{$title}
)}
@@ -58,9 +58,9 @@ function FolderContentControll({ $title, onclick, $id }: iControll) {
{folderControlBtn.map((btn) => (
@@ -71,4 +71,4 @@ function FolderContentControll({ $title, onclick, $id }: iControll) {
);
}
-export default memo(FolderContentControll);
+export default memo(FolderContentControl);
diff --git a/components/folder/LinkAddHeader.tsx b/components/folder/LinkAddHeader.tsx
index 76585df63..11f833873 100644
--- a/components/folder/LinkAddHeader.tsx
+++ b/components/folder/LinkAddHeader.tsx
@@ -1,17 +1,17 @@
import { LinkAddHeadInner } from '@/styles/folderStyle';
-import Input from '../common/atoms/Input';
import { memo } from 'react';
+import Input from '../common/atoms/Input';
function LinkAddHeader({ $inputIconImg }: { $inputIconImg: string }) {
return (
+ inputClass={'input__link--add'}
+ placeholder={'링크를 추가해 보세요'}
+ $beforeIcon={$inputIconImg}
+ btnShow={true}
+ btnClass={'button--gradient medium'}>
추가하기
diff --git a/components/folder/PostCard.tsx b/components/folder/PostCard.tsx
index 96fd1e99f..97596d1b0 100644
--- a/components/folder/PostCard.tsx
+++ b/components/folder/PostCard.tsx
@@ -1,17 +1,16 @@
-import { useEffect, useMemo, useState } from 'react';
-import Link from 'next/link';
+import { instance } from '@/lib/axios';
+import { IModal } from '@/src/constant/modal.constant';
+import { calculateTimeAgo } from '@/src/utils/calcTilmAgo';
+import { DFlaxAlignCenterBtw, EllipsisLine } from '@/styles/commonStyle';
import Image from 'next/image';
+import Link from 'next/link';
+import { useEffect, useState } from 'react';
import Modal, { IModalInfo } from '../modal/Modal';
import { BookMarkBtn, CardMenu, CardWrap } from './PostCardStyle';
-import { DFlaxAlignCenterBtw, EllipsisLine } from '@/styles/commonStyle';
-import { calculateTimeAgo } from '@/src/utils/calcTilmAgo';
-import { IModal } from '@/src/constant/modal';
-import { instance } from '@/lib/axios';
import { IFolderContent } from './interface';
+import { LINKBRARY_LOGO } from '@/src/constant/image.constant';
-const EMPTY_IMAGE = '/assets/logo/logo.svg';
-
-type SelectedModalInfo = { $type: string } & Partial>;
+type SelectedModalInfo = { type: string } & Partial>;
export default function PostCard({ id, folder_id, image_source, description, created_at, url }: IFolderContent) {
const [isBookMark, setIsBookMark] = useState(false);
@@ -19,17 +18,17 @@ export default function PostCard({ id, folder_id, image_source, description, cre
const [isModalShow, setIsModalShow] = useState(false);
const [modalType, setModalType] = useState({
$card_Id: '',
- $type: '',
+ type: '',
});
const [modalData, setModalData] = useState>();
- const handelerBookMarkActive = () => setIsBookMark((prev) => !prev);
- const handelerCardDropdown = () => setIsCardMenu((prev) => !prev);
+ const handlerBookMarkActive = () => setIsBookMark((prev) => !prev);
+ const handlerCardDropdown = () => setIsCardMenu((prev) => !prev);
const handleModalOpen = (type: string) => {
// 미트볼메뉴-삭제하기
if (type === 'linkDelete') {
setModalType({
- $type: type,
+ type: type,
$card_Id: `${id}`,
$descText: url,
});
@@ -37,7 +36,7 @@ export default function PostCard({ id, folder_id, image_source, description, cre
// 미트볼메뉴-폴더에추가
if (type === 'folderInAdd') {
setModalType({
- $type: type,
+ type: type,
});
}
setIsModalShow(true);
@@ -47,13 +46,9 @@ export default function PostCard({ id, folder_id, image_source, description, cre
setIsModalShow(false);
};
- const date = useMemo(() => {
- return new Date(`${created_at}`);
- }, []);
-
const handleModalProps = async () => {
// 클릭한 link의 폴더명
- const resMenu = await instance.get(`/folders`);
+ const resMenu = await instance.get(`/users/1/folders`);
const folderName = resMenu.data.data;
if (folderName) setModalData(folderName);
};
@@ -67,7 +62,7 @@ export default function PostCard({ id, folder_id, image_source, description, cre
+ onClick={handlerBookMarkActive}>
북마크버튼
{description}
- {date.toLocaleString()}
+ {new Date(`${created_at}`).toLocaleString()}