Skip to content

Commit

Permalink
improved ui
Browse files Browse the repository at this point in the history
  • Loading branch information
codeAbinash committed Jun 28, 2023
1 parent e09e431 commit 54dc5e6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
6 changes: 1 addition & 5 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Emoji from 'emoji-store'
function Header(props: any) {
const navigate = useNavigate()
const headerTitle = useRef<HTMLParagraphElement>(null)
const inputRef = useRef<HTMLInputElement>(null)
// const inputRef = useRef<HTMLInputElement>(null)
const [isIntersecting, setIsIntersecting] = React.useState(true)
// { title, notiIcon, placeholder, onSearch }: { title: string, notiIcon: boolean, placeholder: string, onSearch: Function | any }
const title = props.title || 'Sample Title'
Expand Down Expand Up @@ -46,10 +46,6 @@ function Header(props: any) {
<img src={icons.search_black_48dp} className='h-[1.65rem] w-[1.65rem] dark:invert opacity-30' />
</div>
<input type="search" placeholder={placeholder}
onFocus={() => {
setTimeout(() => { inputRef.current?.scrollIntoView({ behavior: 'smooth', block : 'start', inline : 'start' }) }, 100);
}}
ref={inputRef}
className='search-full font-[470] bg-transparent placeholder:text-[#000]/30 dark:placeholder:text-[#fff]/30'
onInput={oninput}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ManageRoutine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function Routines({ deleteRoutine }: any) {
{
routines.length === 0
? <div className="min-h-[60dvh] justify-center items-center gap-5 flex flex-col">
<img src={icons.app_icon_transparent_256} className="w-[55%]" />
<img src={icons.app_icon_transparent_256} className="w-[55%] dark:grayscale dark:opacity-40" />
<p className="text-sm text-secondary text-center">
You haven't subscribed <br /> to any routine yet.
</p>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/NewRoutine.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Emoji from 'emoji-store';
import { useEffect, useMemo, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useNavigate, useParams } from 'react-router-dom';
import icons from '../assets/icons/icons';
import BackHeader from '../components/BackHeader';
import { MS_IN_DAY, day } from '../lib/date';
Expand All @@ -26,6 +26,7 @@ const routineOptions = [

function NewRoutine() {
const e = new Emoji();
const params = useParams()
const [routineName, setRoutineName] = useState('')
const [routineDescription, setRoutineDescription] = useState('')
const [routineEmoji, setRoutineEmoji] = useState('')
Expand Down
2 changes: 1 addition & 1 deletion src/pages/NewRoutinesLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function GetRoutines({ screenRoutines, allRoutines }: { screenRoutines: R
if (screenRoutines.length === 0)
return <div className='h-[50vh] flex flex-col items-center justify-center gap-3'>
<p className='text-[#777]/50 text-center text-sm font-medium'>No Routine <TextEmoji emoji='🤔' /></p>
<img src={icons.app_icon_transparent_256} className="w-[50%] dark:grayscale dark:opacity-30" />
<img src={icons.app_icon_transparent_256} className="w-[50%] dark:grayscale dark:opacity-40" />
<p className='text-xs text-center text-[#777]/50 font-medium'>Go to Routines tab to see all routines <TextEmoji emoji="💫" /></p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/pages/Routines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function Routines() {
// return AllRoutines(routines.holiday)
// }

function AllRoutines({ screenRoutines, allRoutines, expiredRoutines }: { screenRoutines: Routine[] | null, allRoutines: Routine[] | null, expiredRoutines : Routine[]}) {
function AllRoutines({ screenRoutines, allRoutines, expiredRoutines }: { screenRoutines: Routine[] | null, allRoutines: Routine[] | null, expiredRoutines: Routine[] }) {
// console.log(screenRoutines)
const navigate = useNavigate()
const [currentRoutineViewIndex, setCurrentRoutineViewIndex] = useState(0)
Expand All @@ -167,7 +167,7 @@ function AllRoutines({ screenRoutines, allRoutines, expiredRoutines }: { screenR
if (screenRoutines.length === 0) return (
<div className="flex flex-col gap-10 mt-10 min-h-[55vh] justify-center items-center">
<div className='flex flex-col gap-5 px-5 justify-center items-center'>
<img src={icons.app_icon_transparent_256} className="w-[55%]" />
<img src={icons.app_icon_transparent_256} className="w-[55%] dark:grayscale dark:opacity-40" />
<p className='text-center text-[#777]/70 text-base font-medium'>No Routine <TextEmoji emoji='🙄' />
</p>
<p className='text-center text-[#777]/50 text-xs font-[450] mb-5 '>You can create a new routine or apply a <br /> routine from the
Expand Down

0 comments on commit 54dc5e6

Please sign in to comment.