Skip to content

Commit

Permalink
update overview to fit both sankey and category spending
Browse files Browse the repository at this point in the history
  • Loading branch information
shaankhosla committed Oct 11, 2023
1 parent 6e6c25c commit f2a1c1a
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions packages/desktop-client/src/components/reports/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function SankeyCard({ categories }) {
const data = useReport('sankey', params);

return (
<Card flex={2} to="/reports/sankey">
<Card flex={1} to="/reports/sankey">
<View>
<View style={{ flexDirection: 'row', padding: 20 }}>
<View style={{ flex: 1 }}>
Expand Down Expand Up @@ -387,28 +387,21 @@ export default function Overview() {
<CashFlowCard />
</View>

{sankeyFeatureFlag && (
{(sankeyFeatureFlag || categorySpendingReportFeatureFlag) && (
<View
style={{
flex: '0 0 auto',
flexDirection: 'row',
}}
>
<SankeyCard categories={categories} />
<div style={{ flex: 1 }} />
<div style={{ flex: 1 }} />
</View>
)}
{categorySpendingReportFeatureFlag && (
<View
style={{
flex: '0 0 auto',
flexDirection: 'row',
}}
>
<CategorySpendingCard />
<div style={{ flex: 1 }} />
<div style={{ flex: 1 }} />
{categorySpendingReportFeatureFlag && <CategorySpendingCard />}
{sankeyFeatureFlag && <SankeyCard categories={categories} />}
{(!categorySpendingReportFeatureFlag || !sankeyFeatureFlag) && (
<>
<div style={{ flex: 1 }} />
<div style={{ flex: 1 }} />
</>
)}
</View>
)}
</View>
Expand Down

0 comments on commit f2a1c1a

Please sign in to comment.