Skip to content

Commit

Permalink
Merge pull request #185 from Eldemarkki/176-fix-dashboard-impossible-…
Browse files Browse the repository at this point in the history
…state

fix(dashboard): show time range selector always, fixes #176
  • Loading branch information
Eldemarkki committed Jan 28, 2023
2 parents 525951a + cb87ddb commit c4d9d0b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .typesafe-i18n.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"adapter": "react",
"$schema": "https://unpkg.com/typesafe-i18n@5.18.1/schema/typesafe-i18n.json"
"$schema": "https://unpkg.com/typesafe-i18n@5.18.0/schema/typesafe-i18n.json"
}
50 changes: 20 additions & 30 deletions src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,36 +94,26 @@ export const Dashboard = ({ username, isFrontPage }: DashboardProps) => {
<Title mb={5}>{LL.dashboard.statistics()}</Title>
</>}
<Group align="end" position="apart" mt={10} mb={30}>
{projectNames.length !== 0 ? (
<>
<MultiSelect
label={LL.dashboard.projects()}
data={projectNames}
value={selectedProjects}
className={classes.multiSelect}
onChange={selectedProjectNames => setSelectedProjects(selectedProjectNames)}
clearable
placeholder={LL.dashboard.projectsFilter()}
/>
<SegmentedControl
data={[
{ label: LL.dashboard.timeFilters.week(), value: "week" },
{ label: LL.dashboard.timeFilters.month(), value: "month" },
{ label: LL.dashboard.timeFilters.all(), value: "all" }
]}
value={statisticsRange}
onChange={(value: DayRange) => setStatisticsRange(value)}
className={classes.segmentControl}
/>
</>
) : (
<MultiSelect
label={LL.dashboard.projects()}
data={projectNames}
placeholder={LL.dashboard.noProjects()}
disabled
/>
)}
<MultiSelect
label={LL.dashboard.projects()}
data={projectNames}
value={selectedProjects}
className={classes.multiSelect}
onChange={selectedProjectNames => setSelectedProjects(selectedProjectNames)}
clearable
placeholder={projectNames.length === 0 ? LL.dashboard.noProjects() : LL.dashboard.projectsFilter()}
disabled={projectNames.length === 0}
/>
<SegmentedControl
data={[
{ label: LL.dashboard.timeFilters.week(), value: "week" },
{ label: LL.dashboard.timeFilters.month(), value: "month" },
{ label: LL.dashboard.timeFilters.all(), value: "all" }
]}
value={statisticsRange}
onChange={(value: DayRange) => setStatisticsRange(value)}
className={classes.segmentControl}
/>
</Group>
{entries.length !== 0 ?
<>
Expand Down

2 comments on commit c4d9d0b

@vercel
Copy link

@vercel vercel bot commented on c4d9d0b Jan 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

testaustime – ./

testaustime-git-main-testaustime.vercel.app
testaustime.vercel.app
testaustime-testaustime.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c4d9d0b Jan 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.