Skip to content

Commit 7c632b6

Browse files
leo-benzXiphe
authored andcommitted
feat: add today button in titlebar
closes #72
1 parent 66af0cd commit 7c632b6

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

src/views/Budget/Budget.module.scss

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
-webkit-app-region: no-drag;
1010
height: 1.5rem;
1111
position: relative;
12-
margin: 0.4rem auto;
12+
margin: 0.4rem;
13+
margin-left: auto;
1314
width: 70vw;
1415
max-width: 40rem;
1516
overflow: hidden;
@@ -69,3 +70,33 @@ button.unloadedMonthListEntry {
6970
left: 0;
7071
font-weight: 200;
7172
}
73+
.todayButton {
74+
-webkit-app-region: no-drag;
75+
display: inline-block;
76+
position: relative;
77+
height: 1.5rem;
78+
margin: 0.4rem;
79+
padding: 0rem 0.5rem;
80+
margin-right: auto;
81+
background: transparent;
82+
border: 1px solid var(--border-color);
83+
border-bottom: none;
84+
border-radius: 3px;
85+
color: var(--main-color);
86+
font-size: 0.9rem;
87+
line-height: 1.5rem;
88+
transition: border-color 1s;
89+
}
90+
button.todayButton {
91+
cursor: pointer;
92+
&:focus {
93+
outline: none;
94+
}
95+
&:global.focus-visible {
96+
z-index: 1;
97+
@include focusOutline();
98+
}
99+
&:active {
100+
background-color: rgba(var(--dim-colors), 0.2);
101+
}
102+
}

src/views/Budget/Header.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ export default function BudgetHeader({ scrollRef, onClick }: Props) {
119119
))}
120120
</div>
121121
</div>
122+
<button
123+
name={formatDateKey(new Date())}
124+
className={styles.todayButton}
125+
onClick={handleClick as any}
126+
>
127+
Today
128+
</button>
122129
</Header>
123130
);
124131
}

0 commit comments

Comments
 (0)