fix(finance): shared treasury layout so tab switches stop jumping
Keep title and nav mounted in TreasuryLayout with stable header height, and finish Ant form chrome (MoneyInput, Jalali) on finance pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { inject, provide, ref, type InjectionKey, type Ref } from 'vue';
|
||||
|
||||
export type TreasuryChromeOverride = {
|
||||
title: string | null;
|
||||
description: string | null;
|
||||
};
|
||||
|
||||
type TreasuryChromeApi = {
|
||||
override: Ref<TreasuryChromeOverride>;
|
||||
set: (next: TreasuryChromeOverride) => void;
|
||||
clear: () => void;
|
||||
};
|
||||
|
||||
const KEY: InjectionKey<TreasuryChromeApi> = Symbol('treasuryPageChrome');
|
||||
|
||||
export function provideTreasuryPageChrome(): TreasuryChromeApi {
|
||||
const override = ref<TreasuryChromeOverride>({ title: null, description: null });
|
||||
const api: TreasuryChromeApi = {
|
||||
override,
|
||||
set(next) {
|
||||
override.value = next;
|
||||
},
|
||||
clear() {
|
||||
override.value = { title: null, description: null };
|
||||
},
|
||||
};
|
||||
provide(KEY, api);
|
||||
return api;
|
||||
}
|
||||
|
||||
export function useTreasuryPageChrome(): TreasuryChromeApi | null {
|
||||
return inject(KEY, null);
|
||||
}
|
||||
Reference in New Issue
Block a user