Skip to content

Commit

Permalink
refactor: updated wakatime:getTimeWithRange view function
Browse files Browse the repository at this point in the history
  • Loading branch information
sametcodes committed Apr 23, 2023
1 parent df70a13 commit fda703a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions platforms/wakatime/view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ export const getAllTimeSinceToday: ViewComponent = (result, config) => {
export const getTimeWithRange: ViewComponent = (result, config) => {
const subtitle = (config.queryConfig as any).range;
const points = result.data.map((day: any) => day.grand_total.total_seconds);
return (
<Line
leftTitle="Wakatime"
leftSubtitle={subtitle}
points={points}
rightTitle={result.cumulative_total.text}
/>
);

const lines = [
{
leftTitle: "Line",
leftSubtitle: subtitle,
points,
rightTitle: result.cumulative_total.text,
},
];
return <Line items={lines} />;
};

export const getMostUsedLanguages: ViewComponent = (result, config) => {
Expand Down

0 comments on commit fda703a

Please sign in to comment.