From 9d5057fa34831ae45be5573ea2cc997f34fd07e2 Mon Sep 17 00:00:00 2001 From: abhijithvijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Mon, 6 Jul 2020 03:43:56 +0530 Subject: [PATCH] refactor: delete unwanted files --- source/Options/OptionsForm.tsx | 18 +- source/Popup/Form.tsx | 31 ++- source/Popup/Popup.tsx | 12 +- source/Popup/ResponseBody.tsx | 3 +- source/Popup/index.tsx | 4 - source/Popup/refactor/Header.tsx | 142 ---------- source/Popup/refactor/Popup.tsx | 249 ------------------ source/Popup/refactor/PopupBody.tsx | 77 ------ source/Popup/refactor/PopupForm.tsx | 191 -------------- source/Popup/refactor/styles.scss | 136 ---------- .../index.tsx => BodyWrapper.tsx} | 0 source/components/Input/index.tsx | 102 ------- source/components/Input/styles.scss | 74 ------ source/components/Loader.tsx | 25 ++ source/components/Loader/index.tsx | 14 - source/components/Loader/styles.scss | 10 - source/styles/base/_components.scss | 53 ++++ 17 files changed, 124 insertions(+), 1017 deletions(-) delete mode 100644 source/Popup/refactor/Header.tsx delete mode 100644 source/Popup/refactor/Popup.tsx delete mode 100644 source/Popup/refactor/PopupBody.tsx delete mode 100644 source/Popup/refactor/PopupForm.tsx delete mode 100644 source/Popup/refactor/styles.scss rename source/components/{BodyWrapper/index.tsx => BodyWrapper.tsx} (100%) delete mode 100644 source/components/Input/index.tsx delete mode 100644 source/components/Input/styles.scss create mode 100644 source/components/Loader.tsx delete mode 100644 source/components/Loader/index.tsx delete mode 100644 source/components/Loader/styles.scss diff --git a/source/Options/OptionsForm.tsx b/source/Options/OptionsForm.tsx index 61f98c3..b2ecff3 100644 --- a/source/Options/OptionsForm.tsx +++ b/source/Options/OptionsForm.tsx @@ -2,7 +2,7 @@ import React, {useEffect} from 'react'; import 'twin.macro'; import { withFormik, - Field, + // Field, Form, FormikBag, FormikProps, @@ -20,7 +20,7 @@ import {isValidUrl} from '../util/tabs'; import messageUtil from '../util/mesageUtil'; import {ExtensionConfigProperties} from './Options'; import {CHECK_API_KEY} from '../Background/constants'; -import {TextField, CheckBox} from '../components/Input'; +// import {TextField, CheckBox} from '../components/Input'; import {updateExtensionSettings} from '../util/settings'; export type OptionsFormValuesProperties = { @@ -67,12 +67,12 @@ const InnerForm: React.FC> = ( return (
- + /> */}
- + {/* */}
- + /> */}
- {values.advanced && ( + {/* {values.advanced && ( - )} + )} */}
diff --git a/source/Popup/Form.tsx b/source/Popup/Form.tsx index 5c5b1b2..0463608 100644 --- a/source/Popup/Form.tsx +++ b/source/Popup/Form.tsx @@ -1,5 +1,5 @@ import {useFormState} from 'react-use-form-state'; -import tw from 'twin.macro'; +import tw, {css} from 'twin.macro'; import React from 'react'; import {useExtensionSettings} from '../contexts/extension-settings-context'; @@ -102,11 +102,18 @@ const Form: React.FC = ({handleFormSubmit}) => {
- {options.map( - ( - {option, value, disabled = false}: SelectFieldOptionPropeties, - index: number - ) => { - return ( - - ); - } - )} - -
- - {touched[field.name] && errors[field.name] && ( -
{errors[field.name]}
- )} - - ); -}; - -type TextFieldProperties = { - label: string; -}; - -export const TextField: React.FC = ({ - label, - field, - form: {touched, errors}, - ...props -}) => { - return ( - <> - - - - {touched[field.name] && errors[field.name] && ( -
{errors[field.name]}
- )} - - ); -}; - -type CheckBoxProperties = { - label: string; -}; - -export const CheckBox: React.FC = ({ - label, - field, - form, - ...props -}) => { - return ( - <> -