Skip to content

Commit

Permalink
Fix ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Nov 2, 2019
1 parent 099519f commit 505c888
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AdaptiveCardRenderer = ({
adaptiveCard,
adaptiveCardHostConfig,
disabled,
language,
performCardAction,
renderMarkdown,
tapAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import AdaptiveCardRenderer from './AdaptiveCardRenderer';
const { useStyleOptions } = hooks;

const OAuthCardAttachment = ({ adaptiveCardHostConfig, adaptiveCards, attachment: { content } = {} }) => {
const [styleOptions] = useStyleOptions();

const builtCard = useMemo(() => {
if (content) {
const builder = new AdaptiveCardBuilder(adaptiveCards, useStyleOptions);
const builder = new AdaptiveCardBuilder(adaptiveCards, styleOptions);

builder.addCommonHeaders(content);
builder.addButtons((content || {}).buttons, true);

return builder.card;
}
}, [adaptiveCards, content, useStyleOptions]);
}, [adaptiveCards, content, styleOptions]);

return <AdaptiveCardRenderer adaptiveCard={builtCard} adaptiveCardHostConfig={adaptiveCardHostConfig} />;
};
Expand All @@ -29,9 +31,6 @@ OAuthCardAttachment.propTypes = {
content: PropTypes.shape({
buttons: PropTypes.array
}).isRequired
}).isRequired,
styleSet: PropTypes.shape({
options: PropTypes.any.isRequired
}).isRequired
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import CommonCard from './CommonCard';

const { useStyleSet } = hooks;

const SignInCardAttachment = ({ adaptiveCardHostConfig, adaptiveCards, attachment, styleSet }) => {
const SignInCardAttachment = ({ adaptiveCardHostConfig, adaptiveCards, attachment }) => {
const [{ animationCardAttachment: animationCardAttachmentStyleSet }] = useStyleSet();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const VideoCardAttachment = ({
adaptiveCardHostConfig,
adaptiveCards,
attachment,
attachment: { content: { media, autostart, autoloop, image: { url: imageURL } = {} } = {} } = {},
styleSet
attachment: { content: { media, autostart, autoloop, image: { url: imageURL } = {} } = {} } = {}
}) => {
const [{ audioCardAttachment: audioCardAttachmentStyleSet }] = useStyleSet();

Expand Down Expand Up @@ -52,10 +51,6 @@ VideoCardAttachment.propTypes = {
})
)
})
}).isRequired,
styleSet: PropTypes.shape({
audioCardAttachment: PropTypes.any.isRequired,
options: PropTypes.any.isRequired
}).isRequired
};

Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/Activity/CarouselFilmStrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ WebChatCarouselFilmStrip.propTypes = {
timestampClassName: PropTypes.string
};

const ConnectedCarouselFilmStrip = connectCarouselFilmStrip(({ avatarInitials, language, styleSet }) => ({
const ConnectedCarouselFilmStrip = connectCarouselFilmStrip(({ avatarInitials, language }) => ({
avatarInitials,
language
}))(WebChatCarouselFilmStrip);
Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/Activity/Timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import RelativeTime from '../Utils/RelativeTime';
import useStyleOptions from '../hooks/useStyleOptions';
import useStyleSet from '../hooks/useStyleSet';

const Timestamp = ({ activity: { timestamp }, className, styleSet }) => {
const Timestamp = ({ activity: { timestamp }, className }) => {
const [{ timestampFormat }] = useStyleOptions();
const [{ timestamp: timestampStyleSet }] = useStyleSet();

Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/Attachment/ImageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CroppedImage from '../Utils/CroppedImage';

import useStyleOptions from '../hooks/useStyleOptions';

const ImageContent = ({ alt, src, styleSet }) => {
const ImageContent = ({ alt, src }) => {
const [{ bubbleImageHeight }] = useStyleOptions();

return <CroppedImage alt={alt} height={bubbleImageHeight} src={src} width="100%" />;
Expand Down
2 changes: 1 addition & 1 deletion packages/component/src/SendBox/Assets/TypingAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import ScreenReaderText from '../../ScreenReaderText';
import useStyleSet from '../../hooks/useStyleSet';

const TypingAnimation = ({ 'aria-label': ariaLabel, styleSet }) => {
const TypingAnimation = ({ 'aria-label': ariaLabel }) => {
const [{ typingAnimation: typingAnimationStyleSet }] = useStyleSet();

return (
Expand Down

0 comments on commit 505c888

Please sign in to comment.