Skip to content
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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Feature/Giphy integration #63

wants to merge 7 commits into from

Conversation

voinar
Copy link
Collaborator

@voinar voinar commented Mar 14, 2023

#2
foundation for giphy integration. features to be added:

  • click to close outside modal
  • pass url of gif selected by the user to the chat box

@voinar voinar requested a review from masterHAWK99 March 14, 2023 08:52
frontend/src/components/GifWidget/GifWidget.styled.ts Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.styled.ts Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
Comment on lines 52 to 57
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`
)
Copy link
Collaborator

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.

.prettierrc Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.styled.ts Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.styled.ts Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.styled.ts Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.tsx Outdated Show resolved Hide resolved
frontend/src/components/GifWidget/GifWidget.styled.ts Outdated Show resolved Hide resolved
frontend/src/components/chatInput/ChatInput.tsx Outdated Show resolved Hide resolved
frontend/src/components/chatInput/ChatInput.tsx Outdated Show resolved Hide resolved
frontend/src/components/chatInput/ChatInput.tsx Outdated Show resolved Hide resolved
@PatrykKuniczak
Copy link
Owner

@voinar Rename PR and branch, add "feature/" prefix to both.

);

useEffect(() => {
const getGifsList = async () => {
Copy link
Collaborator

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[].

Copy link
Owner

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 ;)

@PatrykKuniczak PatrykKuniczak changed the title Giphy integration Feature/Giphy integration Mar 18, 2023
@masterHAWK99 masterHAWK99 self-requested a review April 4, 2023 20:16
<GifWidgetFooter>
<span>Powered by</span>
<img
style={{ width: "5rem" }}
Copy link
Collaborator

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

Copy link
Owner

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it.

@PatrykKuniczak PatrykKuniczak self-assigned this Apr 7, 2023
@PatrykKuniczak PatrykKuniczak added the enhancement New feature or request label Apr 7, 2023
} from "./GifWidget.styled";
import GiphyAttributionLogoImage from "assets/GiphyAttributionLogo.png";

type TGifWidget = { toggleGifWidgetVisibility: () => void };
Copy link
Collaborator

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")};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pointer-events: ${props => (props.gifWidgetVisible ? "none" : "auto")};
pointer-events: ${({gifWidgetVisible}) => gifWidgetVisible ? "none" : "auto"};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants