From f334ce72e22ccf766e0099583915ddd380aa4a85 Mon Sep 17 00:00:00 2001 From: sweetcola <838689894@qq.com> Date: Mon, 23 Nov 2020 14:25:22 +0800 Subject: [PATCH] Simplify the interface --- src/components/LanguageSelection/LSelect.js | 1 - .../MultipleTranslate/MtPopup/index.js | 36 +++---- .../MultipleTranslate/MtPopup/style.css | 11 +-- src/components/MultipleTranslate/index.js | 62 ++++++------ src/components/MultipleTranslate/style.css | 12 ++- .../CustomizeBoardDisplay/index.js | 94 +++++++++---------- .../CustomizeBoardOptions/index.js | 6 +- src/components/Popup/style.css | 7 +- src/components/PopupHeader/index.js | 2 +- src/components/PopupHeader/style.css | 4 +- src/components/RawText/style.css | 3 - src/components/ResultBox/index.js | 4 +- src/components/ResultBox/style.css | 11 +-- src/components/TsHistory/style.css | 4 +- src/constants/defaultStyleVars.js | 8 +- src/entry/background/install.js | 5 + 16 files changed, 130 insertions(+), 140 deletions(-) diff --git a/src/components/LanguageSelection/LSelect.js b/src/components/LanguageSelection/LSelect.js index de185cb1..5bdcbf34 100644 --- a/src/components/LanguageSelection/LSelect.js +++ b/src/components/LanguageSelection/LSelect.js @@ -24,7 +24,6 @@ const LSelect = ({ isFrom, onChange, disableSelect, from, to, options }) => { return (
-
- @@ -55,7 +53,6 @@ const CustomizeBoardDisplay = ({ styleVars }) => {
- @@ -98,11 +95,10 @@ const CustomizeBoardDisplay = ({ styleVars }) => {
- +
@@ -116,7 +112,6 @@ const CustomizeBoardDisplay = ({ styleVars }) => {
- @@ -125,56 +120,55 @@ const CustomizeBoardDisplay = ({ styleVars }) => {
-
-
-
-
-
- - - - - - - - -
-
-
[ˈwelkəm]
-
- ようこそ - +
+
+
+ + + + + + + + +
+
+
[ˈwelkəm]
+
+ ようこそ + +
+
名词: 歓迎, ウエルカム, 優待, 奉迎, 遠見, 接待
+
动词: 歓迎する
-
名词: 歓迎, ウエルカム, 優待, 奉迎, 遠見, 接待
-
动词: 歓迎する
-
-
-
-
- - - - - - - -
-
-
- ようこそ - +
+
+ + + + + + + + +
+
+
+ ようこそ + +
-
-
- +
+ +
{/* SourceSelector */} diff --git a/src/components/Options/CustomizeTheme/CustomizeBoardOptions/index.js b/src/components/Options/CustomizeTheme/CustomizeBoardOptions/index.js index 9386cb64..2c658bd9 100644 --- a/src/components/Options/CustomizeTheme/CustomizeBoardOptions/index.js +++ b/src/components/Options/CustomizeTheme/CustomizeBoardOptions/index.js @@ -4,14 +4,12 @@ import ColorSelector from './ColorSelector'; import './style.css'; const initChanging = { targetColor: '', saved: false, offsetColor: '' }; -const textKeyList = ['--text-normal', '--text-title', '--text-icon']; -const bgKeyList = ['--bg-content', '--bg-title', '--bg-total', '--bg-item-hover', '--bg-select-focus']; +const textKeyList = ['--text-normal', '--text-icon']; +const bgKeyList = ['--bg-content', '--bg-total', '--bg-item-hover', '--bg-select-focus']; const i18nMessage = { '--text-normal': 'Normal', - '--text-title': 'Title', '--text-icon': 'Icon', '--bg-content': 'Content', - '--bg-title': 'Title', '--bg-total': 'Total', '--bg-item-hover': 'Item hover', '--bg-select-focus': 'Select focus' diff --git a/src/components/Popup/style.css b/src/components/Popup/style.css index deab9665..f41856ea 100644 --- a/src/components/Popup/style.css +++ b/src/components/Popup/style.css @@ -5,10 +5,9 @@ height: fit-content; background: var(--bg-total); padding-bottom: 2px; + color: var(--text-normal) !important; } .content { - margin: 0 auto; - height: fit-content; - width: 240px; - color: var(--text-normal); + margin: 4px; + width: 242px; } \ No newline at end of file diff --git a/src/components/PopupHeader/index.js b/src/components/PopupHeader/index.js index 750799b3..88f0ddbe 100644 --- a/src/components/PopupHeader/index.js +++ b/src/components/PopupHeader/index.js @@ -59,7 +59,7 @@ const PopupHeader = () => { return (
-
{getI18nMessage('extName')}
+
Sc
{ className='ts-rb-head' onMouseDown={(e) => drag(e, pinPos, changePinPos, handlePosChange)} > -
{getI18nMessage('contentResult')}
+
Sc
@@ -158,7 +158,7 @@ const ResultBox = () => {
-
+
{ data.defaultAudioSource = sourceSwitch(data.defaultAudioSource); } + if (data.styleVarsList?.[0]?.styleVars) { + (data.styleVarsList[0].styleVars = defaultStyleVars); + } + chrome.storage.local.set({ ...defaultSet, ...data }); }); };