Skip to content

Commit

Permalink
Fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
codeAbinash committed Jun 29, 2023
1 parent 749861b commit 3b226f0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/assets/scss/common/_classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ button.btn-full-width.grey {

0%,
100% {
border-color: var(--accent);
border-color: $accent;
}

50% {
Expand Down Expand Up @@ -274,7 +274,7 @@ button.btn-full-width.grey {

&:focus,
&:active {
outline: 2px solid var(--accent);
outline: 2px solid $accent;
}
}

Expand All @@ -289,7 +289,7 @@ button.btn-full-width.grey {
}

.checkDiv.active {
background-color: var(--accent);
background-color: $accent;
color: white;
}

Expand All @@ -306,7 +306,7 @@ button.btn-full-width.grey {

&:focus,
&:active {
outline: 2px solid var(--accent);
outline: 2px solid $accent;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function Header(props: any) {
// console.log('Ok')
// inputRef.current?.scrollTo(-5,-5)
}}
onInput={oninput}
ref={inputRef}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function NavBar({ active }: { active: 'Home' | 'Routines' | 'Messages' | 'Calend
const activeBar = tabs[index]
return (
<div
className={`select-none tap tab flex-center flex-col gap-1 px-3 ${active == activeBar ? "" : "opacity-30 grayscale brightness-[0] dark:brightness-[3]"}`}
className={`select-none tap tab flex-center flex-col gap-1 px-3 ${active == activeBar ? "" : "opacity-[35%] grayscale brightness-[0] dark:brightness-[3]"}`}
key={index} onClick={df(() => { if (active === activeBar) return; navigate(links[index], { replace: true }) })}>
<img src={activeTabIcons[index]} className='h-[22px]' />
<p className={`title text-[0.7rem] text-accent ${activeBar == active ? 'font-[500]' : 'font-[500]'}`}>{activeBar}</p>
Expand Down
7 changes: 7 additions & 0 deletions src/lib/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,11 @@ export function getEmojiByDay(date: Date) {
return '🤔'
}

export function isSameDate(d1: Date, d2: Date) {
const year = d1.getFullYear() === d2.getFullYear()
const month = d1.getMonth() === d2.getMonth()
const date = d1.getDate() === d2.getDate()
return year && month && date
}

export default currentDate
4 changes: 3 additions & 1 deletion src/lib/dateMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type Routine = {
} | string | any,
startTime: Date,
endTime: Date,
status: string,
status: string | null,
percentage: number,
description: string,
emoji: string,
Expand Down Expand Up @@ -60,6 +60,8 @@ export function searchActiveRoutine(routines: Array<Routine | any>) {
const currentMS = date.getTime() - routine.startTime.getTime()
const percentage = Math.floor(currentMS * 100 / totalMS)
routine.percentage = percentage
}else {
routine.status = null
}
})

Expand Down
2 changes: 1 addition & 1 deletion src/pages/viewRoutine/RoutineView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function RoutineView({ show, routines, cb, index, expired = false
</div>

<div className="mt-7">
<button className="no-highlight text-sm tap99 w-full bg-accent text-white font-medium p-[1.1rem] rounded-[0.85rem]"
<button className="no-highlight text-sm tap99 w-full bg-accent text-white font-medium p-4 rounded-[0.85rem]"
onClick={df(() => { cb && cb[1] && cb[1]() }, 80)}
>OK</button>
</div>
Expand Down

0 comments on commit 3b226f0

Please sign in to comment.