Skip to content

refactor(site): make few ui changes on template insights #8774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const TemplateUsagePanel = ({
return (
<Panel {...panelProps}>
<PanelHeader>
<PanelTitle>App&lsquo;s & IDE usage</PanelTitle>
<PanelTitle>App & IDE Usage</PanelTitle>
<PanelSubtitle>Last 7 days</PanelSubtitle>
</PanelHeader>
<PanelContent>
Expand Down Expand Up @@ -244,7 +244,7 @@ const TemplateUsagePanel = ({
sx={{
fontSize: 13,
color: (theme) => theme.palette.text.secondary,
width: 200,
width: 120,
flexShrink: 0,
}}
>
Expand Down Expand Up @@ -339,13 +339,13 @@ function formatTime(seconds: number): string {
const minutes = Math.floor(seconds / 60)
return minutes + " minutes"
} else {
const hours = Math.floor(seconds / 3600)
const remainingMinutes = Math.floor((seconds % 3600) / 60)
if (remainingMinutes === 0) {
return hours + " hours"
} else {
return hours + " hours, " + remainingMinutes + " minutes"
const hours = seconds / 3600
const minutes = Math.floor(seconds % 3600)
if (minutes === 0) {
return hours.toFixed(0) + " hours"
}

return hours.toFixed(1) + " hours"
}
}

Expand Down