From 3b8cc63fca2111d8a6e2689596cbaafd0f14917c Mon Sep 17 00:00:00 2001 From: yeon Date: Mon, 25 Nov 2019 11:11:09 +0900 Subject: [PATCH] =?UTF-8?q?[Merge]=20develop=20=EA=B3=BC=20merge=20#32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit why feed main 페이지를 보여주기 위해서 how 규종님이 작업하신 feed write 컨테이너 붙임 feed -> Feed 로 폴더이름 변경 --- .../__test__/components/WritingFeed.test.tsx | 2 +- client/src/composition/feed/Comment.tsx | 4 +- client/src/composition/feed/Feed.tsx | 15 ++++--- client/src/composition/feed/FeedContainer.tsx | 4 +- client/src/composition/feed/index.tsx | 14 ++++--- client/src/pages/Main/index.tsx | 4 +- client/src/pages/feed/FeedContainer.tsx | 41 ------------------- 7 files changed, 22 insertions(+), 62 deletions(-) delete mode 100644 client/src/pages/feed/FeedContainer.tsx diff --git a/client/src/__test__/components/WritingFeed.test.tsx b/client/src/__test__/components/WritingFeed.test.tsx index 205c7d62..c40dca38 100644 --- a/client/src/__test__/components/WritingFeed.test.tsx +++ b/client/src/__test__/components/WritingFeed.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import '@testing-library/jest-dom/extend-expect'; import { render, cleanup } from '@testing-library/react'; -import WritingFeed from '../../composition/feed/WritingFeed'; +import WritingFeed from '../../composition/Feed/WritingFeed'; import { ThemeProvider } from 'styled-components'; import theme from '../../style/theme'; diff --git a/client/src/composition/feed/Comment.tsx b/client/src/composition/feed/Comment.tsx index 2a369b30..4fbae3c3 100644 --- a/client/src/composition/feed/Comment.tsx +++ b/client/src/composition/feed/Comment.tsx @@ -1,5 +1,5 @@ -import React from "react"; -import styled from "styled-components"; +import React from 'react'; +import styled from 'styled-components'; interface ITest { size: string; diff --git a/client/src/composition/feed/Feed.tsx b/client/src/composition/feed/Feed.tsx index 283f8b0d..165e25bb 100644 --- a/client/src/composition/feed/Feed.tsx +++ b/client/src/composition/feed/Feed.tsx @@ -1,10 +1,9 @@ -import React from "react"; -import styled from "styled-components"; -import FeedHeader from "./FeedHeader"; -import FeedBody from "./FeedBody"; -import FeedFooter from "./FeedFooter"; -import Comment from "./Comment"; -import buttons from "../../image/buttons.png"; +import React from 'react'; +import styled from 'styled-components'; +import FeedHeader from './FeedHeader'; +import FeedBody from './FeedBody'; +import FeedFooter from './FeedFooter'; +import Comment from './Comment'; const FeedDiv = styled.div` ${props => props.theme.borders.feedBorder}; @@ -20,7 +19,7 @@ const FeedContentDiv = styled.div` const FeedEditDiv = styled.span` float: right; cursor: pointer; - background-image: url(${buttons}); + background-image: url('/images/buttons.png'); background-repeat: no-repeat; background-size: 64px 134px; background-position: 0 -66px; diff --git a/client/src/composition/feed/FeedContainer.tsx b/client/src/composition/feed/FeedContainer.tsx index a568e255..d203c332 100644 --- a/client/src/composition/feed/FeedContainer.tsx +++ b/client/src/composition/feed/FeedContainer.tsx @@ -1,11 +1,11 @@ import React from 'react'; import FeedPresentor from './FeedPresentor'; -import WritingFeed from '../../composition/feed/WritingFeed'; +import WritingFeedContainer from './WritingFeed'; const FeedContainer: React.FC = () => { return ( <> - + ); diff --git a/client/src/composition/feed/index.tsx b/client/src/composition/feed/index.tsx index 9bb2b606..41bd7e91 100644 --- a/client/src/composition/feed/index.tsx +++ b/client/src/composition/feed/index.tsx @@ -1,8 +1,9 @@ -import React, { useState, useMemo, useEffect } from "react"; -import Feed from "./Feed"; -import { useQuery } from "@apollo/react-hooks"; -import gql from "graphql-tag"; -import useScrollEnd from "../../hooks/useScrollEnd"; +import React, { useState, useMemo, useEffect } from 'react'; +import Feed from './Feed'; +import { useQuery } from '@apollo/react-hooks'; +import gql from 'graphql-tag'; +import useScrollEnd from '../../hooks/useScrollEnd'; +import WritingFeedContainer from './WritingFeed'; interface IFeed { content: string; @@ -29,7 +30,7 @@ interface FeedVars { const OFFSET = 2; const FeedContainer = () => { const [feeds, setFeeds] = useState([]); - const [cursor, setCursor] = useState("9999-12-31T09:29:26.050Z"); + const [cursor, setCursor] = useState('9999-12-31T09:29:26.050Z'); const checkEnd = useScrollEnd(); // hooks 에서 useQuery 1 부터 시작 @@ -73,6 +74,7 @@ const FeedContainer = () => { return ( <> + {feeds.map(feed => ( ))} diff --git a/client/src/pages/Main/index.tsx b/client/src/pages/Main/index.tsx index bdb253ad..90f7c3de 100644 --- a/client/src/pages/Main/index.tsx +++ b/client/src/pages/Main/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import Feed from '../../composition/feed'; +import FeedContainer from '../../composition/Feed'; const SignUp: React.FC = () => { - return ; + return ; }; export default SignUp; diff --git a/client/src/pages/feed/FeedContainer.tsx b/client/src/pages/feed/FeedContainer.tsx deleted file mode 100644 index 3e5b1756..00000000 --- a/client/src/pages/feed/FeedContainer.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React, { useEffect } from "react"; -import FeedPresentor from "./FeedPresentor"; -import { useQuery } from "@apollo/react-hooks"; -import gql from "graphql-tag"; - -interface ILanguages { - name: string; -} -interface RocketInventoryVars { - year: number; -} - -interface Languages { - languages: ILanguages[]; -} - -const TEST_QUERY = gql` - query languages { - languages { - name - } - } -`; - -const SignUpPresenter: React.FC = () => { - // tslint:disable-next-line: no-shadowed-variable - const { loading, data } = useQuery(TEST_QUERY, { - variables: {} - }); - - console.log(data); - return ( - <> - - - {data && data.languages.map(inventory => )} - - ); -}; - -export default SignUpPresenter;