From 398bfa879e92319086bc5656ac4b8a3e538ad872 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 2 Feb 2023 20:23:47 -0600 Subject: [PATCH] Lint storybook sample code --- app/soapbox/utils/media.ts | 8 ++++---- stories/Button.stories.tsx | 2 +- stories/Button.tsx | 2 +- stories/Header.stories.tsx | 2 +- stories/Header.tsx | 26 +++++++++++++------------- stories/Page.stories.tsx | 3 ++- stories/Page.tsx | 22 +++++++++++----------- stories/button.css | 5 +++++ 8 files changed, 38 insertions(+), 32 deletions(-) diff --git a/app/soapbox/utils/media.ts b/app/soapbox/utils/media.ts index a9ffb88a1..9143061ff 100644 --- a/app/soapbox/utils/media.ts +++ b/app/soapbox/utils/media.ts @@ -62,11 +62,11 @@ const addAutoPlay = (html: string): string => { try { const document = domParser.parseFromString(html, 'text/html').documentElement; const iframe = document.querySelector('iframe'); - + if (iframe) { const url = new URL(iframe.src); const provider = new URL(iframe.src).host; - + if (provider === VideoProviders.RUMBLE) { url.searchParams.append('pub', '7a20'); url.searchParams.append('autoplay', '2'); @@ -75,9 +75,9 @@ const addAutoPlay = (html: string): string => { url.searchParams.append('auto_play', '1'); iframe.allow = 'autoplay'; } - + iframe.src = url.toString(); - + // DOM parser creates html/body elements around original HTML fragment, // so we need to get innerHTML out of the body and not the entire document return (document.querySelector('body') as HTMLBodyElement).innerHTML; diff --git a/stories/Button.stories.tsx b/stories/Button.stories.tsx index c331bd485..70d075835 100644 --- a/stories/Button.stories.tsx +++ b/stories/Button.stories.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { ComponentStory, ComponentMeta } from '@storybook/react'; +import React from 'react'; import { Button } from './Button'; diff --git a/stories/Button.tsx b/stories/Button.tsx index c33be6ec5..7fcdd4f1e 100644 --- a/stories/Button.tsx +++ b/stories/Button.tsx @@ -37,7 +37,7 @@ export const Button = ({ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; return (