This commit is contained in:
parent
1128a01e4c
commit
70a8e15be9
1 changed files with 6 additions and 8 deletions
|
@ -38,7 +38,7 @@ type StringRes = Record<
|
||||||
|
|
||||||
const Home: ParentComponent = (props) => {
|
const Home: ParentComponent = (props) => {
|
||||||
let panelList: HTMLDivElement;
|
let panelList: HTMLDivElement;
|
||||||
const [t] = createTranslator(
|
const [t, [stringRes]] = createTranslator(
|
||||||
(code) => import(`./i18n/${code}.json`) as Promise<{ default: StringRes }>,
|
(code) => import(`./i18n/${code}.json`) as Promise<{ default: StringRes }>,
|
||||||
);
|
);
|
||||||
const now = createTimeSource();
|
const now = createTimeSource();
|
||||||
|
@ -105,17 +105,15 @@ const Home: ParentComponent = (props) => {
|
||||||
|
|
||||||
const windowSize = useWindowSize();
|
const windowSize = useWindowSize();
|
||||||
createEffect((last) => {
|
createEffect((last) => {
|
||||||
if (last !== windowSize.width) {
|
const { width } = windowSize;
|
||||||
|
if (last !== width) {
|
||||||
requestRecalculateTabIndicator();
|
requestRecalculateTabIndicator();
|
||||||
}
|
}
|
||||||
|
return width;
|
||||||
});
|
});
|
||||||
|
|
||||||
const [inTransition] = useTransition();
|
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (!inTransition()) {
|
requestRecalculateTabIndicator();
|
||||||
requestAnimationFrame(recalculateTabIndicator);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const isTabFocus = (idx: number) => {
|
const isTabFocus = (idx: number) => {
|
||||||
|
@ -178,7 +176,7 @@ const Home: ParentComponent = (props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DocumentTitle>Timelines</DocumentTitle>
|
<DocumentTitle>Timelines</DocumentTitle>
|
||||||
<Scaffold
|
<Scaffold
|
||||||
topbar={
|
topbar={
|
||||||
<AppTopBar>
|
<AppTopBar>
|
||||||
|
|
Loading…
Add table
Reference in a new issue