-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
seungju
committed
Jul 13, 2020
1 parent
ec2b5e9
commit 0c93b25
Showing
16 changed files
with
150 additions
and
45 deletions.
There are no files selected for viewing
Binary file not shown.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -11,6 +11,10 @@ export const ADD_COMMENT = gql` | |
addComment(postId: $postId, text: $text) { | ||
id | ||
text | ||
user { | ||
id | ||
username | ||
} | ||
} | ||
} | ||
`; |
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
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
import React from "react"; | ||
import { withRouter } from "react-router-dom"; | ||
import SearchPresenter from "./SearchPresenter"; | ||
import { useQuery } from "react-apollo-hooks"; | ||
import { SEARCH } from "./SearchQueries"; | ||
|
||
export default withRouter(({ location: { search } }) => { | ||
const term = search.split("=")[1]; | ||
const { data, loading } = useQuery(SEARCH, { | ||
skip: term === undefined, | ||
variables: { | ||
term | ||
} | ||
}); | ||
return <SearchPresenter searchTerm={term} loading={loading} data={data} />; | ||
}); |
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,15 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import FatText from "../../Components/FatText"; | ||
|
||
const Wrapper = styled.div` | ||
height: 50vh; | ||
text-align: center; | ||
`; | ||
|
||
const SearchPresenter = ({ searchTerm, loading }) => | ||
<Wrapper> | ||
{searchTerm === undefined && <FatText text={"Search for something"} />} | ||
</Wrapper>; | ||
|
||
export default SearchPresenter; |
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,18 @@ | ||
import { gql } from "apollo-boost"; | ||
|
||
export const SEARCH = gql` | ||
query search($term: String!) { | ||
searchPost(term: $term) { | ||
files { | ||
url | ||
} | ||
likeCount | ||
} | ||
searchUser(term: $term) { | ||
avatar | ||
username | ||
isFollowing | ||
isSelf | ||
} | ||
} | ||
`; |
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,2 @@ | ||
import SearchContainer from "./SearchContainer"; | ||
export default SearchContainer; |
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,9 @@ | ||
import { gql } from "apollo-boost"; | ||
|
||
export const ME = gql` | ||
{ | ||
me { | ||
username | ||
} | ||
} | ||
`; |