Skip to content

Commit

Permalink
Merge pull request #1040 from seoyeon039/part3-양서연-week16
Browse files Browse the repository at this point in the history
[양서연] Week16
  • Loading branch information
yanggak12 authored Apr 29, 2024
2 parents 4b62adc + 81c111d commit e5cf308
Show file tree
Hide file tree
Showing 33 changed files with 434 additions and 262 deletions.
21 changes: 0 additions & 21 deletions components/AddLinkIcon.tsx

This file was deleted.

11 changes: 5 additions & 6 deletions components/FolderList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useState } from "react";
import { LinkCardData } from "@/types/type";
import Button from "./Button";
import styles from "@/styles/FolderList.module.css";
import plusIcon from "@/public/images/Icon_plus.svg";
import LinkList from "./LinkList";
import AddModal from "@/modal/addModal/AddModal";
import FolderMenu from "./FolderMenu";
import Image from "next/image";
import AddModal from "@/modal/addModal/AddModal";
import PlusIcon from "@/public/images/Icon_plus.svg";
import Button from "./Button";
import styles from "@/styles/FolderList.module.css";

const FIRST_SELECTED_FOLDER = "전체";

Expand Down Expand Up @@ -47,7 +46,7 @@ function FolderList({ keyword, linkData, folderNameList, currentId, folderName,
</div>
<button className={styles.addFolderBtn} type="button" onClick={openAddModal}>
폴더 추가
<Image src={plusIcon} alt="plus-Icon" />
<PlusIcon className={styles.addFolderBtnImg} />
</button>
<AddModal isOpenModal={isAddModalOpen} closeModal={closeAddModal}/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions components/FolderMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";
import shareIcon from "@/public/images/Icon_share.svg";
import editIcon from "@/public/images/Icon_edit.svg";
import deleteIcon from "@/public/images/Icon_delete.svg";
import ShareIcon from "@/public/images/Icon_share.svg";
import EditIcon from "@/public/images/Icon_edit.svg";
import DeleteIcon from "@/public/images/Icon_delete.svg";
import DeleteModal from "@/modal/deleteModal/DeleteModal";
import EditModal from "@/modal/editModal/EditModal";
import ShareModal from "@/modal/shareModal/ShareModal";
Expand Down Expand Up @@ -29,17 +29,17 @@ function FolderMenu({ placeholder }: Props) {
return (
<div className={styles.controlBtns}>
<button className={styles.shareBtn} type="button" onClick={openShareModal}>
<Image src={shareIcon} alt="share-Icon" />
<ShareIcon className={styles.folderMenuBtnImg} />
공유
</button>
<ShareModal isOpenModal={isShareModalOpen} closeModal={closeShareModal} />
<button className={styles.editBtn} type="button" onClick={openEditModal}>
<Image src={editIcon} alt="edit-Icon" />
<EditIcon className={styles.folderMenuBtnImg} />
이름 변경
</button>
<EditModal isOpenModal={isEditModalOpen} closeModal={closeEditModal} placeholder={placeholder}/>
<button className={styles.deleteBtn} type="button" onClick={openDeleteModal}>
<Image src={deleteIcon} alt="delete-Icon" />
<DeleteIcon className={styles.folderMenuBtnImg} />
삭제
</button>
<DeleteModal isOpenModal={isDeleteModalOpen} closeModal={closeDeleteModal}/>
Expand Down
16 changes: 8 additions & 8 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import facebook from '@/public/images/facebook.svg';
import twitter from '@/public/images/twitter.svg';
import youtube from '@/public/images/youtube.svg';
import instagram from '@/public/images/instagram.svg';
import Facebook from '@/public/images/facebook.svg';
import Twitter from '@/public/images/twitter.svg';
import Youtube from '@/public/images/youtube.svg';
import Instagram from '@/public/images/instagram.svg';
import styles from '@/styles/Footer.module.css';
import Link from 'next/link';
import Image from 'next/image';
Expand All @@ -17,16 +17,16 @@ function Footer() {
</div>
<div className={styles.snsLinks}>
<Link href="https://www.facebook.com/" target='_blank' rel='noreferrer'>
<Image src={facebook} width={20} height={20} alt="facebook" />
<Facebook className={styles.snsLinkImg} />
</Link>
<Link href="https://twitter.com/" target='_blank' rel='noreferrer'>
<Image src={twitter} width={20} height={20} alt="twitter" />
<Twitter className={styles.snsLinkImg} />
</Link>
<Link href="https://www.youtube.com/" target='_blank' rel='noreferrer'>
<Image src={youtube} width={20} height={20} alt="youtube" />
<Youtube className={styles.snsLinkImg} />
</Link>
<Link href="https://www.instagram.com/" target='_blank' rel='noreferrer'>
<Image src={instagram} width={20} height={20} alt="instagram" />
<Instagram className={styles.snsLinkImg} />
</Link>
</div>
</div>
Expand Down
10 changes: 8 additions & 2 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ interface Props {
name: string,
};
folderOwnerData:{
profileImageSource: string,
image_source: string,
name: string,
};
}

function Header({folderData, folderOwnerData}: Props) {
return (
<header className={styles.headerItems}>
<Image src={folderOwnerData.profileImageSource} width={64} height={64} alt="userProfile" />
<Image
src={folderOwnerData.image_source}
className={styles.headerItemImg}
width={64}
height={64}
alt="userProfile"
/>
<div className={styles.username}>{folderOwnerData.name}</div>
<div className={styles.folderName}>{folderData.name}</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion components/LinkAdd.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from 'react';
import styles from '@/styles/LinkAdd.module.css';
import AddLinkModal from '@/modal/addLinkModal/AddLinkModal';
import LinkIcon from './AddLinkIcon';
import LinkIcon from '@/public/images/Icon_link.svg';

function LinkAdd() {
const [isAddLinkModalOpen, setIsAddLinkModalOpen] = useState(false);
Expand Down
20 changes: 9 additions & 11 deletions components/LinkCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ import { MouseEvent, useState } from 'react';
import { LinkCardData } from '@/types/type';
import formatDate from '@/utils/formatDate';
import diffTime from '@/utils/diffTime';
import star from '@/public/images/Icon_star.svg';
import kebab from '@/public/images/Icon_kebab.svg'
import noImg from '@/public/images/noImg.svg';
import styles from '@/styles/LinkCard.module.css';
import Popover from './Popover';
import Image from 'next/image';
import Link from 'next/link';
import Star from '@/public/images/Icon_star.svg';
import Kebab from '@/public/images/Icon_kebab.svg'
import styles from '@/styles/LinkCard.module.css';


interface Props {
item: LinkCardData
}

function LinkCard({item: {url, id, imageSource, createdAt, description}}: Props) {
function LinkCard({item: {url, id, image_source, created_at, description}}: Props) {
const [isOpen, setIsOpen] = useState(false);

const handleClick = (e: MouseEvent<HTMLButtonElement>) => {
Expand All @@ -26,19 +24,19 @@ function LinkCard({item: {url, id, imageSource, createdAt, description}}: Props)
return (
<Link href={url} target='_blank'>
<div className={styles.card} key={id}>
<Image className={styles.star} src={star} alt='star' />
<Star className={styles.star} />
<div
className={styles.previewImg}
style={{ backgroundImage: imageSource ? `url(${imageSource})` : `url(${noImg.src})`}}
style={{ backgroundImage: image_source ? `url(${image_source})` : `url('/images/noImg.svg')`}}
/>
<div className={styles.linkContent}>
<button type='button' className={styles.kebab} onClick={handleClick}>
<Image src={kebab} alt='kebab' />
<Kebab />
</button>
<Popover isOpen={ isOpen } url={url} />
<p className={styles.updateTime}>{diffTime(createdAt)}</p>
<p className={styles.updateTime}>{diffTime(created_at)}</p>
<p className={styles.linkDescription}>{description}</p>
<p className={styles.linkCreatedDate}>{formatDate(createdAt)}</p>
<p className={styles.linkCreatedDate}>{formatDate(created_at)}</p>
</div>
</div>
</Link>
Expand Down
10 changes: 6 additions & 4 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import linkbraryLogo from '@/public/images/logo.svg';
import LinkbraryLogo from '@/public/images/logo.svg';
import styles from '@/styles/Navbar.module.css';
import Image from 'next/image';
import Link from 'next/link';
Expand All @@ -7,18 +7,20 @@ interface Props {
className: string;
profileData: {
email: string,
profileImageSource: string,
image_source: string,
};
isLoginStatus: boolean;
}

function NavigationBar({ className, profileData, isLoginStatus }: Props) {
return (
<nav className={`${styles.nav} ${styles[className]}`}>
<Link href='/'><Image src={linkbraryLogo} width={132} height={24} alt='logo'/></Link>
<Link href='/'>
<LinkbraryLogo width={133}/>
</Link>
{isLoginStatus ? (
<div className={styles.account}>
<Image src={profileData.profileImageSource} width={32} height={32} alt='profile' />
<Image src={profileData.image_source} width={32} height={32} alt='profile' />
<p>{profileData.email}</p>
</div>
)
Expand Down
8 changes: 4 additions & 4 deletions components/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeEvent, KeyboardEvent, MouseEvent } from 'react';
import styles from '@/styles/SearchBar.module.css';
import CloseIconImage from './CloseIconImage';
import SearchIconImage from './SearchIconImage';
import CloseIcon from '@/public/images/Icon_close.svg';
import SearchIcon from '@/public/images/Icon_search.svg';

interface Props {
inputValue: string;
Expand All @@ -28,7 +28,7 @@ function SearchBar({ inputValue, searchWord, onChange, onClick, onSubmit }: Prop
<form className={styles.container} onKeyDown={handleSubmit}>
<div className={styles.searchBar}>
<div className={styles.searchIcon}>
<SearchIconImage stroke={color}/>
<SearchIcon stroke={color}/>
</div>
<input
type="text"
Expand All @@ -43,7 +43,7 @@ function SearchBar({ inputValue, searchWord, onChange, onClick, onSubmit }: Prop
className={styles.closeBtn}
onClick={onClick}
>
<CloseIconImage fill={closeBtnBackground} stroke={closeBtnIcon}/>
<CloseIcon fill={closeBtnBackground} stroke={closeBtnIcon}/>
</button>
)
}
Expand Down
20 changes: 0 additions & 20 deletions components/SearchIconImage.tsx

This file was deleted.

7 changes: 3 additions & 4 deletions components/SignInput.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ChangeEvent, MouseEvent, useState } from 'react';
import styles from '@/styles/SignInput.module.css';
import eyeOff from '@/public/images/Icon_eye-off.svg';
import eyeOn from '@/public/images/Icon_eye-on.svg';
import Image from 'next/image';
import EyeOff from '@/public/images/Icon_eye-off.svg';
import EyeOn from '@/public/images/Icon_eye-on.svg';

interface Props {
item: {
Expand Down Expand Up @@ -36,7 +35,7 @@ function SignInput({ item, onChange, onBlur, errorMsg }: Props) {
placeholder={item.placeholder}/>
{item.type === "password" &&
<button className={styles.pwHiddenBtn} type="button" onClick={handleClick}>
<Image src={isHidden === "password" ? eyeOff : eyeOn} alt="eye-btn" />
{isHidden === "password" ? <EyeOff /> : <EyeOn />}
</button>
}
{errorMsg && <div className={styles.errorMessage}>{errorMsg}</div>}
Expand Down
8 changes: 4 additions & 4 deletions constants/folderlist_mock_data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const DATA = [
{folderName: '코딩팁', linkCount: 7,},
{folderName: '채용 사이트', linkCount: 12,},
{folderName: '유용한 글', linkCount: 30,},
{folderName: '나만의 장소', linkCount: 3,},
{id: 1, folderName: '코딩팁', linkCount: 7,},
{id: 2, folderName: '채용 사이트', linkCount: 12,},
{id: 3, folderName: '유용한 글', linkCount: 30,},
{id: 4, folderName: '나만의 장소', linkCount: 3,},
]
4 changes: 2 additions & 2 deletions constants/signInput_constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const SIGNIN = {
export const SIGN_IN_INIT_INFO = {
email: {
id: "email",
label: '이메일',
Expand All @@ -13,7 +13,7 @@ export const SIGNIN = {
},
}

export const SIGNUP = {
export const SIGN_UP_INIT_INFO = {
email: {
id: "email",
label: '이메일',
Expand Down
7 changes: 4 additions & 3 deletions modal/addLinkModal/AddLinkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { DATA } from "@/constants/folderList_mock_data";
import { ModalBaseProps } from "@/types/type";
import IconCheck from "@/public/images/Icon_check.svg";
import styles from "./AddLinkModal.module.css";
import Image from "next/image";

function AddLinkModal({ isOpenModal, closeModal }: ModalBaseProps) {
const [clickItem, setClickItem] = useState('');
Expand All @@ -28,7 +27,7 @@ function AddLinkModal({ isOpenModal, closeModal }: ModalBaseProps) {
<>
<button
type="button"
key={item.folderName}
key={item.id}
className={clickItem === item.folderName ? styles.folderClicked : styles.folder}
onClick={() => handleClick(item.folderName)}
>
Expand All @@ -40,7 +39,9 @@ function AddLinkModal({ isOpenModal, closeModal }: ModalBaseProps) {
</span>
<span className={styles.linkCount}>{item.linkCount}개 링크</span>
</div>
{clickItem === item.folderName && <Image src={IconCheck} width={14} height={14} alt="Icon-check" />}
{clickItem === item.folderName &&
<IconCheck />
}
</button>
</>
)
Expand Down
9 changes: 3 additions & 6 deletions modal/shareModal/ShareModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { useScript } from "@/utils/hooks/useScript";
import { useEffect, useState } from "react";
import { FacebookShareButton } from "react-share";
import ModalLayout from "@/modal/ModalLayout";
import IconKakao from "@/public/images/Icon_Kakao.svg";
import IconFacebook from "@/public/images/Icon_Facebook.svg";
import IconLink from "@/public/images/Icon_link.svg";
import styles from "./ShareModal.module.css";
import Image from "next/image";

Expand Down Expand Up @@ -58,14 +55,14 @@ function ShareModal({ isOpenModal, closeModal }: ModalBaseProps) {
className={styles.shareKakao}
type="button"
onClick={handleKakaoButton}>
<Image src={IconKakao} alt={IconKakao} />
<Image src='/images/Icon_Kakao.svg' width={18} height={18} alt='IconKakao' />
</button>
<p className={styles.linkButtonName}>카카오톡</p>
</div>
<FacebookShareButton url={currentUrl}>
<div className={styles.shareButton}>
<button className={styles.shareFacebook} type="button">
<Image src={IconFacebook} alt={IconFacebook} />
<Image src='/images/Icon_Facebook.svg' width={18} height={18} alt='IconFacebook' />
</button>
<p className={styles.linkButtonName}>페이스북</p>
</div>
Expand All @@ -75,7 +72,7 @@ function ShareModal({ isOpenModal, closeModal }: ModalBaseProps) {
className={styles.copyLink}
type="button"
onClick={() => handleCopyClipBoard(currentUrl)}>
<Image src={IconLink} alt={IconLink} />
<Image src='/images/Icon_link.svg' width={18} height={18} alt='IconLink' />
</button>
<p className={styles.linkButtonName}>링크 복사</p>
</div>
Expand Down
Loading

0 comments on commit e5cf308

Please sign in to comment.