Skip to content

Commit

Permalink
[milzipmoza-developers#2] refactor - 대시보드 리펙토링
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevLuffy committed Feb 5, 2020
1 parent 10a1cd6 commit de9e6f0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
32 changes: 32 additions & 0 deletions components/templates/DashBoardTemplate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ContentContainer from "../organisms/containers/ContentContainer";
import {Col, Row} from "react-bootstrap";
import LongTermRentHistoryCard from "../organisms/LongTermRentHistoryCard";
import LoginUserProfileCard from "../organisms/LoginUserProfileCard";
import WishBookSummaryCard from "../organisms/WishBookSummaryCard";
import * as React from "react";
import {IHistory, IWishBook} from "../../pages/dashboard";

interface IProps {
histories: IHistory[];
wishBooks: IWishBook[];
}

const DashBoardTemplate = ({histories, wishBooks}: IProps) => (
<ContentContainer>
<Row>
<Col sm={8}>
<LongTermRentHistoryCard histories={histories}/>
</Col>
<Col sm={4}>
<LoginUserProfileCard userName="루피" userEmail="[email protected]"/>
</Col>
</Row>
<Row style={{marginTop: '24px'}}>
<Col sm={12}>
<WishBookSummaryCard wishBooks={wishBooks}/>
</Col>
</Row>
</ContentContainer>
);

export default DashBoardTemplate;
22 changes: 2 additions & 20 deletions pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import * as React from "react";
import AppBarContainer from "../../components/organisms/containers/AppBarContainer";
import ContentContainer from "../../components/organisms/containers/ContentContainer";
import {Col, Row} from "react-bootstrap";
import LongTermRentHistoryCard from "../../components/organisms/LongTermRentHistoryCard";
import LoginUserProfileCard from "../../components/organisms/LoginUserProfileCard";
import WishBookSummaryCard from "../../components/organisms/WishBookSummaryCard";
import DashBoardTemplate from "../../components/templates/DashBoardTemplate";

const longTerms: IHistory[] = [
{
Expand Down Expand Up @@ -91,21 +87,7 @@ export interface IWishBook {
const Index = () => {
return (
<AppBarContainer isLoggedIn={true}>
<ContentContainer>
<Row>
<Col sm={8}>
<LongTermRentHistoryCard histories={longTerms}/>
</Col>
<Col sm={4}>
<LoginUserProfileCard userName="루피" userEmail="[email protected]"/>
</Col>
</Row>
<Row style={{marginTop: '24px'}}>
<Col sm={12}>
<WishBookSummaryCard wishBooks={wishBooks}/>
</Col>
</Row>
</ContentContainer>
<DashBoardTemplate histories={longTerms} wishBooks={wishBooks}/>
</AppBarContainer>
);
};
Expand Down

0 comments on commit de9e6f0

Please sign in to comment.