major refactor of the dashboard and react-openapi integration #1
@@ -1,11 +1,11 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
export type DashboardMode = "expense" | "income";
|
export type DashboardMode = "expense" | "income";
|
||||||
export type DashboardPeriod = "rolling" | "calendar";
|
export type DashboardPeriodType = "rolling" | "calendar";
|
||||||
|
|
||||||
export interface DashboardState {
|
export interface DashboardState {
|
||||||
mode: DashboardMode;
|
mode: DashboardMode;
|
||||||
period: DashboardPeriod;
|
periodType: DashboardPeriodType;
|
||||||
comparison: boolean;
|
comparison: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { DashboardProps, DashboardState } from "./Dashboard.models";
|
|||||||
export default function Dashboard(props: DashboardProps) {
|
export default function Dashboard(props: DashboardProps) {
|
||||||
const [state, setState] = React.useState<DashboardState>({
|
const [state, setState] = React.useState<DashboardState>({
|
||||||
mode: "expense",
|
mode: "expense",
|
||||||
period: "rolling",
|
periodType: "rolling",
|
||||||
comparison: false,
|
comparison: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ export default function DashboardView({
|
|||||||
title={section.title}
|
title={section.title}
|
||||||
accentColor={colors.primary}
|
accentColor={colors.primary}
|
||||||
colorScheme={colors}
|
colorScheme={colors}
|
||||||
period={period}
|
periodType={period}
|
||||||
onPeriodChange={(p: any) => setState(prev => ({ ...prev, period: p }))}
|
onPeriodTypeChange={(p: any) => setState(prev => ({ ...prev, period: p }))}
|
||||||
comparison={comparison}
|
comparison={comparison}
|
||||||
setComparison={(c: any) => setState(prev => ({ ...prev, comparison: c }))}
|
setComparison={(c: any) => setState(prev => ({ ...prev, comparison: c }))}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user