Skip to content

Commit

Permalink
feat: show career options
Browse files Browse the repository at this point in the history
  • Loading branch information
tresabhi committed Oct 2, 2023
1 parent 3667fd8 commit b7b4035
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/embeds/session/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export default function SessionPage() {
since !== undefined &&
diff !== undefined && (
<Breakdown.Row
minimized={!session.showCareer}
title={`Since ${since.toLocaleString(undefined, {
hour: 'numeric',
minute: 'numeric',
Expand Down Expand Up @@ -280,6 +281,7 @@ export default function SessionPage() {
return (
<Breakdown.Row
key={stats.tank_id}
minimized={!session.showCareer}
title={tankopedia?.name ?? `Unknown tank ${stats.tank_id}`}
type="tank"
tankType={tankopedia?.type}
Expand Down
8 changes: 8 additions & 0 deletions src/app/tools/session/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ export default function Page() {
>
Show total
</DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={session.showCareer}
onCheckedChange={(checked) =>
useSession.setState({ showCareer: checked })
}
>
Show career
</DropdownMenu.CheckboxItem>
</DropdownMenu.Content>
</DropdownMenu.Root>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/stores/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Session = (
showDelta: boolean;
}[] & { length: 4 };
showTotal: boolean;
showCareer: boolean;
};

export const useSession = create<Session>()(
Expand All @@ -34,6 +35,7 @@ export const useSession = create<Session>()(
isTracking: false,
promptBeforeReset: true,
showTotal: true,
showCareer: true,

customColumns: [
{ display: 'battles', showDelta: false },
Expand Down

0 comments on commit b7b4035

Please sign in to comment.