File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { useRouter } from "next/router" ;
22
3+ import { Button } from "@/components/ui/button" ;
34import TagList from "@/components/ui/tag-list" ;
45import { useEvent } from "@/hooks/event" ;
56
6- import DockLayout from "../layouts/docklayout " ;
7+ import ActionLayout from "../layouts/actionlayout " ;
78
89export default function EventDetailsPage ( ) {
910 // useRouter allows access to URL parameters
@@ -20,7 +21,18 @@ export default function EventDetailsPage() {
2021 }
2122
2223 return (
23- < DockLayout >
24+ < ActionLayout
25+ secondaryAction = {
26+ < Button
27+ variant = "outline"
28+ className = "flex-1"
29+ onClick = { ( ) => router . back ( ) }
30+ >
31+ Back
32+ </ Button >
33+ }
34+ primaryAction = { < Button className = "flex-1" > Join Event</ Button > }
35+ >
2436 < div className = "mx-auto max-w-3xl px-4 sm:px-6 lg:px-0" >
2537 < div className = "relative h-56 w-full overflow-hidden rounded-xl bg-gray-200" >
2638 < div className = "absolute -bottom-6 left-6" >
@@ -42,6 +54,6 @@ export default function EventDetailsPage() {
4254 </ div >
4355 </ div >
4456 </ div >
45- </ DockLayout >
57+ </ ActionLayout >
4658 ) ;
4759}
Original file line number Diff line number Diff line change 1+ type ActionLayoutProps = {
2+ children : React . ReactNode ;
3+
4+ primaryAction ?: React . ReactNode ;
5+ secondaryAction ?: React . ReactNode ;
6+ } ;
7+
8+ export default function ActionLayout ( {
9+ children,
10+ primaryAction,
11+ secondaryAction,
12+ } : ActionLayoutProps ) {
13+ return (
14+ < div className = "flex min-h-screen flex-col" >
15+ < main className = "flex-1 px-4 py-6" > { children } </ main >
16+
17+ { ( primaryAction || secondaryAction ) && (
18+ < footer className = "sticky bottom-0 border-t bg-white px-4 py-3" >
19+ < div className = "mx-auto flex max-w-3xl gap-3" >
20+ { secondaryAction }
21+ { primaryAction }
22+ </ div >
23+ </ footer >
24+ ) }
25+ </ div >
26+ ) ;
27+ }
You can’t perform that action at this time.
0 commit comments