From c28ae6b82860693b8e6b012a939fb8a3dd320e23 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 21 Sep 2020 16:08:44 +0900 Subject: Introduce styled-components on settings ui --- src/settings/components/site.scss | 8 +-- src/settings/components/ui/AddButton.scss | 13 ----- src/settings/components/ui/AddButton.tsx | 31 +++++++----- src/settings/components/ui/DeleteButton.scss | 13 ----- src/settings/components/ui/DeleteButton.tsx | 30 ++++++----- src/settings/components/ui/Input.scss | 29 ----------- src/settings/components/ui/Radio.tsx | 59 +++++++++------------ src/settings/components/ui/Text.tsx | 70 ++++++++++++++----------- src/settings/components/ui/TextArea.tsx | 76 ++++++++++++++++------------ 9 files changed, 145 insertions(+), 184 deletions(-) delete mode 100644 src/settings/components/ui/AddButton.scss delete mode 100644 src/settings/components/ui/DeleteButton.scss delete mode 100644 src/settings/components/ui/Input.scss (limited to 'src/settings/components') diff --git a/src/settings/components/site.scss b/src/settings/components/site.scss index c0c4f9e..e8415e8 100644 --- a/src/settings/components/site.scss +++ b/src/settings/components/site.scss @@ -1,12 +1,6 @@ .vimvixen-settings-form { padding: 2px; - - textarea[name=json] { - font-family: monospace; - width: 100%; - min-height: 64ex; - resize: vertical; - } + font-family: system-ui; fieldset { margin: 0; diff --git a/src/settings/components/ui/AddButton.scss b/src/settings/components/ui/AddButton.scss deleted file mode 100644 index beb5688..0000000 --- a/src/settings/components/ui/AddButton.scss +++ /dev/null @@ -1,13 +0,0 @@ -.ui-add-button { - border: none; - padding: 4; - display: inline; - background: none; - font-weight: bold; - color: green; - cursor: pointer; - - &:hover { - color: darkgreen; - } -} diff --git a/src/settings/components/ui/AddButton.tsx b/src/settings/components/ui/AddButton.tsx index c15a732..8cf4300 100644 --- a/src/settings/components/ui/AddButton.tsx +++ b/src/settings/components/ui/AddButton.tsx @@ -1,19 +1,24 @@ -import "./AddButton.scss"; import React from "react"; +import styled from "styled-components"; -type Props = React.AllHTMLAttributes; +const Button = styled.input` + border: none; + padding: 4; + display: inline; + background: none; + font-weight: bold; + color: green; + cursor: pointer; -class AddButton extends React.Component { - render() { - return ( - - ); + &:hover { + color: darkgreen; } -} +`; + +type Props = React.InputHTMLAttributes; + +const AddButton: React.FC = (props) => ( +