add isActiveTab method

This commit is contained in:
ThatOneCalculator 2023-02-17 11:54:33 -08:00
parent 279354ed89
commit 4b74514250

View File

@ -132,6 +132,11 @@ function onTabClick(tab: Tab, ev: MouseEvent): void {
}
}
const isActiveTab = (index: number) => {
const activeTab = tabRefs[props.tab]?.value ?? 0;
return index === activeTab;
};
const calcBg = () => {
const rawBg = metadata?.bg || 'var(--bg)';
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);