|
1 | | -import { useRef, useState } from 'react' |
| 1 | +import { useRef, useState, type CSSProperties } from 'react' |
2 | 2 | import { |
3 | 3 | Form, |
4 | 4 | Link, |
@@ -67,40 +67,52 @@ export default function Layout() { |
67 | 67 | const data = useLoaderData<typeof loader>() |
68 | 68 | const user = useOptionalUser() |
69 | 69 | const requestInfo = useRequestInfo() |
| 70 | + const isRecipientsRoute = requestInfo.path.startsWith('/recipients') |
| 71 | + const recipientsTheme = isRecipientsRoute |
| 72 | + ? ({ |
| 73 | + '--background': '0 0% 100%', |
| 74 | + '--card': '0 0% 100%', |
| 75 | + } as CSSProperties) |
| 76 | + : undefined |
70 | 77 | return ( |
71 | | - <div className="flex h-screen flex-col justify-between"> |
72 | | - <header className="container py-5 md:py-6"> |
73 | | - <nav className="flex flex-wrap items-center justify-between gap-4 sm:flex-nowrap md:gap-8"> |
74 | | - <Logo /> |
75 | | - <div className="flex items-center gap-10"> |
76 | | - {user ? ( |
77 | | - <div className="flex gap-4"> |
78 | | - {data.isSubscribed ? null : ( |
79 | | - <Button variant="outline" asChild> |
80 | | - <Link to="/settings/profile/subscription"> |
81 | | - Start your free trial |
82 | | - </Link> |
83 | | - </Button> |
84 | | - )} |
85 | | - <UserDropdown /> |
86 | | - </div> |
87 | | - ) : ( |
88 | | - <> |
89 | | - <Button |
90 | | - asChild |
91 | | - variant="default" |
92 | | - size="lg" |
93 | | - className="hidden sm:inline-flex" |
94 | | - > |
95 | | - <Link to="/login">Log In</Link> |
96 | | - </Button> |
97 | | - <div className="sm:hidden"> |
98 | | - <MobileMenu /> |
| 78 | + <div |
| 79 | + className="bg-background flex h-screen flex-col justify-between" |
| 80 | + style={recipientsTheme} |
| 81 | + > |
| 82 | + <header className="border-border border-b"> |
| 83 | + <div className="container py-5 md:py-6"> |
| 84 | + <nav className="flex flex-wrap items-center justify-between gap-4 sm:flex-nowrap md:gap-8"> |
| 85 | + <Logo /> |
| 86 | + <div className="flex items-center gap-10"> |
| 87 | + {user ? ( |
| 88 | + <div className="flex gap-4"> |
| 89 | + {data.isSubscribed ? null : ( |
| 90 | + <Button variant="outline" asChild> |
| 91 | + <Link to="/settings/profile/subscription"> |
| 92 | + Start your free trial |
| 93 | + </Link> |
| 94 | + </Button> |
| 95 | + )} |
| 96 | + <UserDropdown /> |
99 | 97 | </div> |
100 | | - </> |
101 | | - )} |
102 | | - </div> |
103 | | - </nav> |
| 98 | + ) : ( |
| 99 | + <> |
| 100 | + <Button |
| 101 | + asChild |
| 102 | + variant="default" |
| 103 | + size="lg" |
| 104 | + className="hidden sm:inline-flex" |
| 105 | + > |
| 106 | + <Link to="/login">Log In</Link> |
| 107 | + </Button> |
| 108 | + <div className="sm:hidden"> |
| 109 | + <MobileMenu /> |
| 110 | + </div> |
| 111 | + </> |
| 112 | + )} |
| 113 | + </div> |
| 114 | + </nav> |
| 115 | + </div> |
104 | 116 | </header> |
105 | 117 | <div className="flex-1"> |
106 | 118 | <Outlet /> |
|
0 commit comments