This repository has been archived by the owner on Mar 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MERGE #10] from TheDevLuffy/feature/ZENHUB-3
[#3] 장서 관리 페이지 생성
- Loading branch information
Showing
14 changed files
with
314 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from "react"; | ||
import AppBarContainer from "../../src/components/organisms/containers/AppBarContainer"; | ||
import ContentContainer from "../../src/components/organisms/containers/ContentContainer"; | ||
import {Card} from "react-bootstrap"; | ||
import {useRouter} from "next/router"; | ||
|
||
const Index = () => { | ||
const router = useRouter(); | ||
const {id} = router.query; | ||
|
||
return ( | ||
<AppBarContainer isLoggedIn={true}> | ||
<ContentContainer> | ||
<Card> | ||
<Card.Header as="h5">장서 상세 정보</Card.Header> | ||
조회 할 책 id - {id} | ||
</Card> | ||
</ContentContainer> | ||
</AppBarContainer> | ||
); | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as React from "react"; | ||
|
||
const Divider = () => ( | ||
<div style={{backgroundColor: '#DFDFDF', height: '1px'}}/> | ||
); | ||
|
||
export default Divider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {useRouter} from "next/router"; | ||
import {Button, Card} from "react-bootstrap"; | ||
import * as React from "react"; | ||
|
||
const LibraryBookCardHeader = () => { | ||
const router = useRouter(); | ||
|
||
const enrollButtonClickHandler = () => { | ||
router.push("/books/create"); | ||
}; | ||
|
||
return ( | ||
<Card.Header as="h5"> | ||
<div style={{display: 'flex', flexDirection: 'row'}}> | ||
<div style={{flex: 13, display: 'flex', flexDirection: 'column', justifyContent: 'center'}}> | ||
<div style={{width: 'fit-content'}}> | ||
장서 목록 | ||
</div> | ||
</div> | ||
<div style={{flex: 1}}> | ||
<Button variant="primary" size="sm" onClick={enrollButtonClickHandler}>새 책 등록</Button> | ||
</div> | ||
</div> | ||
</Card.Header> | ||
); | ||
}; | ||
|
||
export default LibraryBookCardHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {Image} from "react-bootstrap"; | ||
import * as React from "react"; | ||
import {ILibraryBook} from "../../models/interfaces"; | ||
|
||
interface IProps { | ||
libraryBook: ILibraryBook; | ||
} | ||
|
||
const Content = ({flex, children}: any) => ( | ||
<div style={{flex: `${flex}`, display: 'flex', flexDirection: 'column', justifyContent: 'center', textAlign: 'center'}}> | ||
{children} | ||
</div> | ||
); | ||
|
||
const LibraryBookElement = ({libraryBook}: IProps) => ( | ||
<div style={{display: 'flex', flexDirection: 'row'}}> | ||
<div style={{flex: 1, display: 'flex', flexDirection: 'row', justifyContent: 'center'}}> | ||
<Image src={libraryBook.image} thumbnail/> | ||
</div> | ||
<Content flex={2}> | ||
{libraryBook.title} | ||
</Content> | ||
<Content flex={1}> | ||
{libraryBook.author} | ||
</Content> | ||
<Content flex={1}> | ||
{libraryBook.publisher} | ||
</Content> | ||
<Content flex={1}> | ||
{libraryBook.hasMany} 부 | ||
</Content> | ||
</div> | ||
); | ||
|
||
export default LibraryBookElement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import LibraryBookPageContext from "../../contexts/LibraryBookPageContext"; | ||
import {Button, ButtonGroup} from "react-bootstrap"; | ||
import * as React from "react"; | ||
|
||
const LibraryBookPageButtons = () => { | ||
return ( | ||
<LibraryBookPageContext.Consumer> | ||
{({page, onPageDown, onPageUp}) => ( | ||
<div style={{height: '40px', display: 'flex', flexDirection: 'row', justifyContent: 'center'}}> | ||
<ButtonGroup aria-label="Basic example"> | ||
<Button variant="primary" onClick={onPageDown}>이전</Button> | ||
<Button disabled>{page}</Button> | ||
<Button variant="primary" onClick={onPageUp}>다음</Button> | ||
</ButtonGroup> | ||
</div> | ||
)} | ||
</LibraryBookPageContext.Consumer> | ||
) | ||
}; | ||
|
||
export default LibraryBookPageButtons; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {ListGroup} from "react-bootstrap"; | ||
import {ILibraryBook} from "../../models/interfaces"; | ||
import LibraryBookElement from "../molecules/LibraryBookElement"; | ||
import * as React from "react"; | ||
import "./mouseover.css"; | ||
|
||
const LibraryBookCardBody = ({books, onClick}) => ( | ||
<div style={{overflow: 'scroll'}}> | ||
<ListGroup variant="flush" style={{height: '700px'}}> | ||
{books.map((libraryBook: ILibraryBook, i: number) => ( | ||
<ListGroup.Item className="library-book-item" | ||
key={i} style={{height: '150px', cursor: 'pointer'}} | ||
onClick={onClick(libraryBook.id)}> | ||
<LibraryBookElement libraryBook={libraryBook}/> | ||
</ListGroup.Item>))} | ||
</ListGroup> | ||
</div> | ||
); | ||
|
||
export default LibraryBookCardBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import LibraryBookPageContext from "../../contexts/LibraryBookPageContext"; | ||
import LibraryBookPageButtons from "../molecules/LibraryBookPageButtons"; | ||
import * as React from "react"; | ||
|
||
|
||
const LibraryBookCardFooter = ({page, onPageDown, onPageUp}) => ( | ||
<LibraryBookPageContext.Provider value={{page, onPageDown, onPageUp}}> | ||
<LibraryBookPageButtons/> | ||
</LibraryBookPageContext.Provider> | ||
); | ||
|
||
export default LibraryBookCardFooter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.library-book-item:hover { | ||
box-shadow: 4px 3px 10px 0 rgba(0, 0, 0, 0.5); | ||
z-index: 10000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as React from "react"; | ||
|
||
const LibraryBookPageContext = React.createContext({ | ||
page: 1, | ||
onPageDown: () => { | ||
|
||
}, | ||
onPageUp: () => { | ||
|
||
}, | ||
}); | ||
|
||
export default LibraryBookPageContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters