Skip to content

Commit

Permalink
[ feat ] 상세 페이지 연결
Browse files Browse the repository at this point in the history
related to: #10
  • Loading branch information
eonseok-jeon committed Jan 1, 2024
1 parent 34c82f0 commit 2d1029b
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/pages/Search/components/Books.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
/** @jsxImportSource @emotion/react */

import { css } from '@emotion/react';
import styled from '@emotion/styled';
import { commonFlex } from '@styles/common';
import { Link } from 'react-router-dom';
import { Book } from 'types/books';

export default function Books(props: Book) {
const { authors, contents, title, thumbnail } = props;

return (
<Container>
<BookImg alt="책 표지" src={thumbnail} />
<SummaryContainer>
<Title>{title}</Title>
<Auther>{authors}</Auther>
<Summary>{contents}</Summary>
</SummaryContainer>
</Container>
<article>
<Link css={bookLink} to={`${title.replace(/\s/g, '')}`}>
<BookImg alt="책 표지" src={thumbnail} />
<SummaryContainer>
<Title>{title}</Title>
<Auther>{authors}</Auther>
<Summary>{contents}</Summary>
</SummaryContainer>
</Link>
</article>
);
}

const Container = styled.article`
const bookLink = css`
${commonFlex}
gap: 4rem;
cursor: pointer;
Expand Down

0 comments on commit 2d1029b

Please sign in to comment.