Skip to content

Commit

Permalink
DEAR-130 add some basic patterns, insight summary
Browse files Browse the repository at this point in the history
  • Loading branch information
smuefsmuef committed Jul 30, 2024
1 parent 1e5af5c commit ee9e5db
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
22 changes: 22 additions & 0 deletions app/(main)/insights/components/InsightsSummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use client';

import { Card, CardContent } from '@components/ui/Card/Card';

export default function InsightsSummary() {
return (
<Card>
<CardContent>
<div className="flex w-full items-start gap-2 text-sm">
<div className="grid gap-2">
<div className="flex items-center gap-2">
<p className="font-semibold">Know Your Happiness Patterns</p>
</div>
<div className="flex items-center text-xs font-light">happiness down, productivity down</div>
<div className="flex items-center text-xs font-light">most happiness influencing worktype..</div>
<div className="flex items-center text-xs font-light">correlations..</div>
</div>
</div>
</CardContent>{' '}
</Card>
);
}
7 changes: 4 additions & 3 deletions app/(main)/insights/components/WorkkindRadarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const chartData = [
];

const chartConfig = {
quantity: {
userAverage: {
label: 'Quantity',
color: '#E94B68',
},
Expand All @@ -35,15 +35,16 @@ export default function WorkkindRadarChart() {
<ChartTooltip cursor={false} content={<ChartTooltipContent />} />
<PolarAngleAxis dataKey="workkind" />
<PolarGrid />
<Radar dataKey="quantity" fill="var(--color-quantity)" fillOpacity={0.4} />
<Radar dataKey="userAverage" fill="var(--color-quantity)" fillOpacity={0.4} />
<Radar dataKey="teamAverage" fill="var(--color-quantity)" fillOpacity={0.9} />
</RadarChart>
</ChartContainer>
</CardContent>
<CardFooter>
<div className="flex w-full items-start gap-2 text-sm">
<div className="grid gap-2">
<div className="flex items-center gap-2">
<p className="font-semibold">Trackings per work type</p>
<p className="font-semibold">Happiness per work type - Personal vs. team</p>
</div>
<div className="flex items-center text-xs font-light">Showing number of tracked worktypes this year</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion app/(main)/insights/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export interface Sprint {
endDate: string;
}

function InsightsSummary() {
return null;
}

const InsightsPage: React.FC = () => {
const { user } = useAuth();
const { getInsightsByTeam } = useInsightsClient();
Expand Down Expand Up @@ -125,6 +129,8 @@ const InsightsPage: React.FC = () => {
document.body.removeChild(link);
};

// todo

return (
<div className="print-content">
{user && selectedTeam && data && sprints ? (
Expand Down Expand Up @@ -175,7 +181,7 @@ const InsightsPage: React.FC = () => {
</div>
<div className="grid grid-cols-2 gap-4">
<WorkkindBarChart />
<WorkkindRadarChart />
<InsightsSummary />
</div>
<div className="grid grid-cols-2 gap-4">
<WorkkindRadarChart />
Expand Down

0 comments on commit ee9e5db

Please sign in to comment.