Skip to content

Commit

Permalink
feat: move back button to detail page only
Browse files Browse the repository at this point in the history
  • Loading branch information
iqbalpa committed Jul 20, 2024
1 parent c3615ba commit 5badb45
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/app/[id]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { ScrollArea } from '@/components/ui/scroll-area';
import BackButton from '@/components/backButton/backButton';

export default function DetailLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<div className="flex h-screen flex-1 overflow-hidden overflow-y-auto">
<div className="relative flex h-screen flex-1 overflow-hidden overflow-y-auto">
<BackButton />
{children}
</div>
);
Expand Down
3 changes: 0 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Inter } from 'next/font/google';
import './globals.css';
import Header from '@/components/header/header';
import GoTopButton from '@/components/goTopButton/goTopButton';
import BackButton from '@/components/backButton/backButton';
import { ScrollArea } from '@/components/ui/scroll-area';
import Sidebar from '@/components/sidebar/sidebar';

const inter = Inter({ subsets: ['latin'] });
Expand Down Expand Up @@ -32,7 +30,6 @@ export default function RootLayout({
</div>
</div>
<GoTopButton />
<BackButton />
</body>
</html>
);
Expand Down
25 changes: 25 additions & 0 deletions src/components/ui/input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as React from "react"

import { cn } from "@/lib/utils"

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}

const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
/>
)
}
)
Input.displayName = "Input"

export { Input }

0 comments on commit 5badb45

Please sign in to comment.