From e38a13aeada68e7734622169fa8091a5ed751173 Mon Sep 17 00:00:00 2001 From: al Date: Sun, 19 Apr 2020 18:52:14 +0800 Subject: [PATCH] style(popup): disabled transparent background. --- .gitignore | 1 + main.js | 2 +- menu.js | 179 ---------------------------- package.json | 2 +- src/modules/popup/index.js | 5 +- src/modules/popup/style.module.scss | 4 + 6 files changed, 10 insertions(+), 183 deletions(-) delete mode 100644 menu.js diff --git a/.gitignore b/.gitignore index cc66bc9b..bc91d960 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules /build .DS_Store ._.* +yarn-error.log diff --git a/main.js b/main.js index 86952eb9..21503da5 100644 --- a/main.js +++ b/main.js @@ -91,7 +91,7 @@ const createPopupWindow = async () => { const popup = new BrowserWindow({ show: false, frame: false, - transparent: true, + // transparent: true, width: isDev ? 900 : 460, height: 600, x: isDev ? curDisplay.bounds.width / 2 : curDisplay.bounds.width - 500 - 140, diff --git a/menu.js b/menu.js deleted file mode 100644 index 5bb4c71f..00000000 --- a/menu.js +++ /dev/null @@ -1,179 +0,0 @@ - -const path = require('path'); -const { app, Menu, shell } = require('electron'); -const { - is, - appMenu, - aboutMenuItem, - openUrlMenuItem, - openNewGitHubIssue, - debugInfo, -} = require('electron-util'); -const config = require('./src/native/config'); - -const showPreferences = () => { - // Show the app's preferences here -}; - -const helpSubmenu = [ - openUrlMenuItem({ - label: 'Website', - url: 'https://github.com/sindresorhus/electron-boilerplate', - }), - openUrlMenuItem({ - label: 'Source Code', - url: 'https://github.com/sindresorhus/electron-boilerplate', - }), - { - label: 'Report an Issue…', - click() { - const body = ` - - - ---- - -${debugInfo()}`; - - openNewGitHubIssue({ - user: 'sindresorhus', - repo: 'electron-boilerplate', - body, - }); - }, - }, -]; - -if (!is.macos) { - helpSubmenu.push( - { - type: 'separator', - }, - aboutMenuItem({ - icon: path.join(__dirname, 'static', 'icon.png'), - text: 'Created by Your Name', - }), - ); -} - -const debugSubmenu = [ - { - label: 'Show Settings', - click() { - config.openInEditor(); - }, - }, - { - label: 'Show App Data', - click() { - shell.openItem(app.getPath('userData')); - }, - }, - { - type: 'separator', - }, - { - label: 'Delete Settings', - click() { - config.clear(); - app.relaunch(); - app.quit(); - }, - }, - { - label: 'Delete App Data', - click() { - shell.moveItemToTrash(app.getPath('userData')); - app.relaunch(); - app.quit(); - }, - }, -]; - -const macosTemplate = [ - appMenu([ - { - label: 'Preferences…', - accelerator: 'Command+,', - click() { - showPreferences(); - }, - }, - ]), - { - role: 'fileMenu', - submenu: [ - { - label: 'Custom', - }, - { - type: 'separator', - }, - { - role: 'close', - }, - ], - }, - { - role: 'editMenu', - }, - { - role: 'viewMenu', - }, - { - role: 'windowMenu', - }, - { - role: 'help', - submenu: helpSubmenu, - }, -]; - -// Linux and Windows -const otherTemplate = [ - { - role: 'fileMenu', - submenu: [ - { - label: 'Custom', - }, - { - type: 'separator', - }, - { - label: 'Settings', - accelerator: 'Control+,', - click() { - showPreferences(); - }, - }, - { - type: 'separator', - }, - { - role: 'quit', - }, - ], - }, - { - role: 'editMenu', - }, - { - role: 'viewMenu', - }, - { - role: 'help', - submenu: helpSubmenu, - }, -]; - -const template = process.platform === 'darwin' ? macosTemplate : otherTemplate; - -if (is.development) { - template.push({ - label: 'Debug', - submenu: debugSubmenu, - }); -} - -module.exports = Menu.buildFromTemplate(template); diff --git a/package.json b/package.json index bf05d688..c4796e8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "champ-r", - "version": "0.9.1", + "version": "0.9.3", "license": "MIT", "description": "Get champion items for lol, Windows only.", "productName": "ChampR", diff --git a/src/modules/popup/index.js b/src/modules/popup/index.js index 81ec36ab..0a10011e 100644 --- a/src/modules/popup/index.js +++ b/src/modules/popup/index.js @@ -120,7 +120,7 @@ export default function Popup() { return
loading...
; } - return <> + return
{ championDetail &&
@@ -140,6 +140,7 @@ export default function Popup() { TabContent: { style: () => { return { + paddingTop: 0, paddingLeft: 0, paddingRight: 0, paddingBottom: 0, @@ -165,7 +166,7 @@ export default function Popup() {
- ; +
; }; return diff --git a/src/modules/popup/style.module.scss b/src/modules/popup/style.module.scss index bbe6d527..ef4fa9e2 100644 --- a/src/modules/popup/style.module.scss +++ b/src/modules/popup/style.module.scss @@ -10,6 +10,10 @@ body { background-color: #ffffff; } +.main { + background-color: #ffffff; +} + .drag { display: flex; margin-bottom: 1ex;