Merge pull request #122 from DeepDoge/master

Some changes
This commit is contained in:
kodxana 2022-07-01 23:13:02 +02:00 committed by GitHub
commit 66cb8ccccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 16 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.cache .cache
dist dist
build
node_modules node_modules
web-ext-artifacts web-ext-artifacts
yarn-error.log yarn-error.log

View file

@ -21,7 +21,7 @@
"build:v2": "npm run clear:dist ; npm run build:base && npm run pick:manifest:v2", "build:v2": "npm run clear:dist ; npm run build:base && npm run pick:manifest:v2",
"build:v3": "npm run clear:dist ; npm run build:base && npm run pick:manifest:v3", "build:v3": "npm run clear:dist ; npm run build:base && npm run pick:manifest:v3",
"build": "npm run build:v3", "build": "rm -r ./build ; mkdir ./build && npm run build:v2 && zip -r ./build/manifest-v2.zip ./dist && npm run build:v3 && zip -r ./build/manifest-v3.zip ./dist",
"watch:v2": "npm run clear:dist ; npm run pick:manifest:v2 && npm-run-all -l -p watch:parcel watch:assets", "watch:v2": "npm run clear:dist ; npm run pick:manifest:v2 && npm-run-all -l -p watch:parcel watch:assets",
"watch:v3": "npm run clear:dist ; npm run pick:manifest:v3 && npm-run-all -l -p watch:parcel watch:assets", "watch:v3": "npm run clear:dist ; npm run pick:manifest:v3 && npm-run-all -l -p watch:parcel watch:assets",

View file

@ -46,11 +46,6 @@ export function createDialogManager() {
} }
} }
interface DialogElement extends HTMLDivElement {
open: boolean
showModal(): void
}
export function Dialogs(params: { manager: ReturnType<typeof createDialogManager> }) { export function Dialogs(params: { manager: ReturnType<typeof createDialogManager> }) {
const alerts = params.manager.useAlerts() const alerts = params.manager.useAlerts()
let currentAlert = Object.values(alerts)[0] let currentAlert = Object.values(alerts)[0]
@ -60,7 +55,7 @@ export function Dialogs(params: { manager: ReturnType<typeof createDialogManager
let cancelled = false let cancelled = false
const dialog = useRef(null as any as DialogElement) const dialog = useRef(null as any as HTMLDialogElement)
useEffect(() => { useEffect(() => {
if (!dialog.current) return if (!dialog.current) return
if (!dialog.current.open) dialog.current.showModal() if (!dialog.current.open) dialog.current.showModal()

View file

@ -68,11 +68,14 @@ function WatchOnLbryPopup(params: { profile: Awaited<ReturnType<typeof getProfil
<a onClick={() => loads(generateProfileAndSetNickname(dialogManager)).then(() => renderPopup())} className={`button active`}> <a onClick={() => loads(generateProfileAndSetNickname(dialogManager)).then(() => renderPopup())} className={`button active`}>
Change Nickname Change Nickname
</a> </a>
<a onClick={async () => <a onClick={async () => {
await dialogManager.confirm("This will delete your keypair from this device.\nStill wanna continue?\n\nNOTE: Without keypair you can't purge your data online.\nSo if you wish to purge, please use purging instead.") if (!await dialogManager.confirm("This will delete your keypair from this device."
&& resetProfileSettings() + "\nStill wanna continue?"
&& renderPopup() + "\n\nNOTE: Without keypair you can't purge your data online."
} + "\nSo if you wish to purge, please use purging instead.")) return
resetProfileSettings()
renderPopup()
}}
className={`button`} className={`button`}
> >
Forget/Logout Forget/Logout

View file

@ -32,6 +32,8 @@ function WatchOnLbryButton({ targetPlatform, lbryPathname, time }: WatchOnLbryBu
gap: '12px', gap: '12px',
borderRadius: '2px', borderRadius: '2px',
backgroundColor: targetPlatform.theme, backgroundColor: targetPlatform.theme,
backgroundImage: targetPlatform.theme,
fontWeight: 'bold',
border: '0', border: '0',
color: 'whitesmoke', color: 'whitesmoke',
padding: '10px 16px', padding: '10px 16px',

View file

@ -77,7 +77,7 @@ export const targetPlatformSettings = {
'madiator.com': targetPlatform({ 'madiator.com': targetPlatform({
domainPrefix: 'https://madiator.com/', domainPrefix: 'https://madiator.com/',
displayName: 'Madiator.com', displayName: 'Madiator.com',
theme: '#075656', theme: 'linear-gradient(130deg, #499375, #43889d)',
button: { button: {
text: 'Watch on', text: 'Watch on',
icon: chrome.runtime.getURL('assets/icons/lbry/madiator-logo.svg'), icon: chrome.runtime.getURL('assets/icons/lbry/madiator-logo.svg'),
@ -90,7 +90,7 @@ export const targetPlatformSettings = {
odysee: targetPlatform({ odysee: targetPlatform({
domainPrefix: 'https://odysee.com/', domainPrefix: 'https://odysee.com/',
displayName: 'Odysee', displayName: 'Odysee',
theme: '#1e013b', theme: 'linear-gradient(130deg, #c63d59, #f77937)',
button: { button: {
text: 'Watch on Odysee', text: 'Watch on Odysee',
icon: chrome.runtime.getURL('assets/icons/lbry/odysee-logo.svg') icon: chrome.runtime.getURL('assets/icons/lbry/odysee-logo.svg')
@ -99,7 +99,7 @@ export const targetPlatformSettings = {
app: targetPlatform({ app: targetPlatform({
domainPrefix: 'lbry://', domainPrefix: 'lbry://',
displayName: 'LBRY App', displayName: 'LBRY App',
theme: '#075656', theme: 'linear-gradient(130deg, #499375, #43889d)',
button: { button: {
text: 'Watch on LBRY', text: 'Watch on LBRY',
icon: chrome.runtime.getURL('assets/icons/lbry/lbry-logo.svg') icon: chrome.runtime.getURL('assets/icons/lbry/lbry-logo.svg')