Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { RouterProvider } from 'react-router-dom'
import { AppRoutes } from './routes'
const queryClient = new QueryClient()

const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
},
},
})

function App() {
return (
Expand Down
10 changes: 5 additions & 5 deletions src/layouts/calendar/components/todos/todo-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ interface Prop {

export function TodoInput({ onAdd }: Prop) {
const [text, setText] = useState('')

const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
if (text.trim()) {
onAdd(text.trim())
setText('')
}
}

return (
<form onSubmit={handleSubmit} className="flex gap-2 mb-4">
<form onSubmit={handleSubmit} className="flex flex-col sm:flex-row gap-2 mb-4">
<input
type="text"
value={text}
onChange={(e) => setText(e.target.value)}
placeholder="یادداشت جدید..."
className="flex-1 px-3 py-2 text-gray-600 placeholder-gray-500 rounded-lg dark:placeholder-gray-500/80 dark:text-gray-300 bg-gray-300/50 dark:bg-gray-700/50 focus:outline-none focus:ring-2 focus:ring-blue-500 "
className="flex-1 px-3 py-2 text-gray-600 placeholder-gray-500 rounded-lg dark:placeholder-gray-500/80 dark:text-gray-300 bg-gray-300/50 dark:bg-gray-700/50 focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<button
type="submit"
className="px-4 py-2 text-white transition-colors bg-blue-500 rounded-lg hover:bg-blue-600"
className="px-4 py-2 text-white transition-colors bg-blue-500 rounded-lg hover:bg-blue-600 sm:w-auto w-full"
>
افزودن
</button>
Expand Down