-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/Giphy integration #63
base: dev
Are you sure you want to change the base?
Conversation
useEffect(() => { | ||
gifSearchInput.length > 2 && | ||
axios | ||
.get( | ||
`https://api.giphy.com/v1/gifs/search?api_key=0kVBw2UV1wx2rzelZSio79c1iKQqdZpt&q=${gifSearchInput}&limit=18&offset=0&rating=g&lang=en` | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code could be hook.
@voinar Rename PR and branch, add "feature/" prefix to both. |
); | ||
|
||
useEffect(() => { | ||
const getGifsList = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me there should be error handling. Because when no response (giphy is down or w/e) the response.data.data
will be probably null or undefined or error ocures because we want to acces to a property that doesn't exist. And there is expected type to be IGifWidget[].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He should create error handling for all requests, but he know about it ;)
47e3a0d
to
36a5ecb
Compare
<GifWidgetFooter> | ||
<span>Powered by</span> | ||
<img | ||
style={{ width: "5rem" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of inline style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only style which this img contain, i think this is good idea, i know to hold styles into css, but for that i think it's good, we have on users list loading also styled like this, if i must refactor that, then u also must refactor on users list, for hold every style into css files, in our case in styled component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do it.
} from "./GifWidget.styled"; | ||
import GiphyAttributionLogoImage from "assets/GiphyAttributionLogo.png"; | ||
|
||
type TGifWidget = { toggleGifWidgetVisibility: () => void }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use interface like everywhere
background-color: transparent; | ||
|
||
pointer-events: ${props => (props.gifWidgetVisible ? "none" : "auto")}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointer-events: ${props => (props.gifWidgetVisible ? "none" : "auto")}; | |
pointer-events: ${({gifWidgetVisible}) => gifWidgetVisible ? "none" : "auto"}; |
#2
foundation for giphy integration. features to be added: