Skip to content

Commit

Permalink
feat: responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
warmachine028 committed Oct 25, 2024
1 parent 1be8376 commit 14a4e6d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { BrowserRouter } from 'react-router-dom'
import { AppRouter } from '@/components'
import { AppRouter, Navbar } from '@/components'
import { ThemeProvider } from '@/providers'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import Navbar from './components/Navbar'

const ReactQueryDemoApp = () => {
return (
<BrowserRouter>
<Navbar />
<AppRouter />
<ReactQueryDevtools initialIsOpen={false} />
</BrowserRouter>
)
}
Expand All @@ -21,7 +21,6 @@ const App = () => {
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
<ReactQueryDemoApp />
</ThemeProvider>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/CreatePost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const CreatePost = () => {
})
handleReset()
}

const handleReset = () => {
setPost(initialData)
if (fileInputRef.current) {
Expand All @@ -66,7 +67,7 @@ const CreatePost = () => {
}

return (
<Card className="shadow-lg">
<Card className="border-0 shadow-lg sm:border">
<CardHeader>
<CardTitle>Create New Post</CardTitle>
<CardDescription className="text-destructive h-5 text-center">{error}</CardDescription>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Navbar = () => {

return (
<nav className="bg-background/80 sticky top-0 z-50 w-full border border-b backdrop-blur-md">
<div className="container mx-auto">
<div className="container mx-auto px-4">
<div className="flex h-16 items-center justify-between">
<div className="flex items-center">
<Link to="/" className="text-foreground flex items-center text-xl font-bold">
Expand All @@ -70,7 +70,7 @@ const Navbar = () => {
alt="Brand"
className="mr-2 size-7 animate-spin [animation-duration:10s]"
/>
<span>React Query Demo</span>
<span className="hidden sm:block">React Query Demo</span>
</Link>
</div>

Expand Down
1 change: 1 addition & 0 deletions client/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as AppRouter } from './AppRouter'
export { default as Post } from './Post'
export { default as CreatePost } from './CreatePost'
export { default as Navbar } from './Navbar'
6 changes: 3 additions & 3 deletions client/src/pages/Posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const PostsCard = () => {
}, [inView, hasNextPage, query, fetchNextPage])

return (
<Card className="shadow-lg">
<Card className="border-0 shadow-lg sm:border">
<CardHeader className="bg-primary text-primary-foreground">
<div className="flex flex-col items-center justify-between xl:flex-row">
<div className="flex flex-col items-center justify-between gap-2 xl:flex-row">
<div>
<CardTitle className="text-2xl font-bold">Posts</CardTitle>
<CardTitle className="text-center text-2xl font-bold">Posts</CardTitle>
<Badge variant="secondary" title="Posts loaded">
{allPosts.length} posts
</Badge>
Expand Down

0 comments on commit 14a4e6d

Please sign in to comment.