Skip to content

Commit 41f35f8

Browse files
committed
fix(wc): fix typing, locale fetch and backgrounds
1 parent 14651f2 commit 41f35f8

File tree

6 files changed

+36
-26
lines changed

6 files changed

+36
-26
lines changed

src/components/web/AppWeb.ce.vue

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const AppView = lazyComponent(() => import('~/components/AppView.vue'));
3434
'Droid Sans',
3535
'Helvetica Neue',
3636
sans-serif;
37-
background: var(--color-background);
3837
transition:
3938
color 0.5s,
4039
background-color 0.5s;

src/index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import type { DefineComponent, WebComponents } from '~/views/web/define-component';
1+
import type { Component } from 'vue';
2+
import type { DefineComponent, WebComponents } from '~/web/define-component';
23

3-
const baseUrl = 'trakt-extension';
4+
export const baseUrl = 'trakt-extension';
45

56
type TraktExtension = {
7+
component: Component;
68
WebComponents: WebComponents;
79
defineComponent: DefineComponent;
810
default: DefineComponent;
911
};
1012

11-
export type { TraktExtension, DefineComponent };
12-
export { baseUrl };
13+
export type { TraktExtension, DefineComponent, WebComponents };

src/stores/i18n.store.ts

-8
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,10 @@ export const useI18nStore = defineStore('i18n', () => {
3030
}
3131
}
3232

33-
console.info({
34-
value,
35-
key,
36-
result,
37-
locale: locale.value,
38-
});
39-
4033
return result;
4134
};
4235

4336
const addLocale = (_locale: Locale, _lang = lang.value) => {
44-
console.info('adding local', { _lang, _locale });
4537
locales.value[_lang] = _locale;
4638
return locales.value;
4739
};

src/utils/i18n.utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const useI18n = (...roots: string[]): ReturnType<typeof chromeUseI18n> =>
88
if (!chrome?.i18n) {
99
const store = useI18nStore();
1010

11-
fetch(`${import.meta.env.BASE_URL}/_locales/${store.lang}/messages.json`)
11+
fetch(new URL(`./_locales/${store.lang}/messages.json`, new URL(import.meta.url).origin))
1212
.then(r => r.json())
1313
.then((locale: Locale) => store.addLocale(locale))
1414
.catch(err => console.error(`Failed to fetch locale '${store.lang}'`, err));

src/views/options/index.html

+18-9
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,23 @@
1212
</html>
1313

1414
<style>
15-
body {
16-
display: flex;
17-
margin: 0;
18-
}
15+
body {
16+
display: flex;
17+
margin: 0;
18+
background: #fff;
19+
transition:
20+
color 0.5s,
21+
background-color 0.5s;
22+
will-change: color, background-color;
1923

20-
wc-trakt-extension {
21-
display: flex;
22-
flex: 1 1 auto;
23-
flex-direction: column;
24+
@media (prefers-color-scheme: dark) {
25+
background: #181818;
2426
}
25-
</style>
27+
}
28+
29+
wc-trakt-extension {
30+
display: flex;
31+
flex: 1 1 auto;
32+
flex-direction: column;
33+
}
34+
</style>

src/views/popup/index.html

+12-3
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@
2626
font-size: 1rem;
2727
-webkit-font-smoothing: antialiased;
2828
-moz-osx-font-smoothing: grayscale;
29+
background: #fff;
30+
transition:
31+
color 0.5s,
32+
background-color 0.5s;
33+
will-change: color, background-color;
34+
35+
@media (prefers-color-scheme: dark) {
36+
background: #181818;
37+
}
2938
}
3039

3140
wc-trakt-extension {
32-
display: flex;
33-
flex: 1 1 auto;
34-
flex-direction: column;
41+
display: flex;
42+
flex: 1 1 auto;
43+
flex-direction: column;
3544
}
3645

3746
#app-popup {

0 commit comments

Comments
 (0)