From 14a24f7352eefc37baa2e09fc29a4f28d8f85406 Mon Sep 17 00:00:00 2001 From: obfuscatedgenerated <75035364+obfuscatedgenerated@users.noreply.github.com> Date: Thu, 2 Jun 2022 22:54:50 +0100 Subject: [PATCH] sfc is deprecated, lets use regular functions --- src/js/popup/Components.tsx | 110 +++++++++++++++++++++--------------- src/js/popup/Popup.tsx | 2 +- 2 files changed, 65 insertions(+), 47 deletions(-) diff --git a/src/js/popup/Components.tsx b/src/js/popup/Components.tsx index b1bd3fb..9bf94e2 100644 --- a/src/js/popup/Components.tsx +++ b/src/js/popup/Components.tsx @@ -1,53 +1,71 @@ import * as React from "react"; import { Flex, Box, Image, Text, Button } from "rebass"; -export const Page: React.SFC<{ - url: string; - moveUp: any; - moveDown: any; -}> = ({ url, moveUp, moveDown }) => ( - - - - - - {moveUp && ( - - ⬆️ - - )} - {moveDown && ( - - ⬇️ - - )} +interface PageParams { + url: any, + moveUp: any, + moveDown: any +} + +function Page({ url, moveUp, moveDown }: PageParams) { + return ( + + + + + + {moveUp && ( + + ⬆️ + + )} + {moveDown && ( + + ⬇️ + + )} + - -); + ) +}; -export const ResetButton: React.SFC<{ reset: any }> = ({ reset, children }) => ( - -); +interface ResetButtonParams { + reset: any, + children: any +} -export const Checkbox: React.SFC<{ - checked: boolean; - onChange: any; -}> = ({ checked, onChange, children }) => ( - -