@@ -23,10 +23,7 @@ export default function AuthRedirect({ children }: Props) {
|
||||
const isUnauthenticated = status === "unauthenticated";
|
||||
const isPublicPage = router.pathname.startsWith("/public");
|
||||
const hasInactiveSubscription =
|
||||
user.id &&
|
||||
!user.subscription?.active &&
|
||||
!user.parentSubscription?.active &&
|
||||
stripeEnabled;
|
||||
user.id && !user.subscription?.active && stripeEnabled;
|
||||
|
||||
// There are better ways of doing this... but this one works for now
|
||||
const routes = [
|
||||
@@ -52,8 +49,6 @@ export default function AuthRedirect({ children }: Props) {
|
||||
} else {
|
||||
if (isLoggedIn && hasInactiveSubscription) {
|
||||
redirectTo("/subscribe");
|
||||
} else if (isLoggedIn && !user.name && user.parentSubscriptionId) {
|
||||
redirectTo("/member-onboarding");
|
||||
} else if (
|
||||
isLoggedIn &&
|
||||
!routes.some((e) => router.pathname.startsWith(e.path) && e.isProtected)
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function CenteredForm({
|
||||
data-testid={dataTestId}
|
||||
>
|
||||
<div className="m-auto flex flex-col gap-2 w-full">
|
||||
{settings.theme && (
|
||||
{settings.theme ? (
|
||||
<Image
|
||||
src={`/linkwarden_${
|
||||
settings.theme === "dark" ? "dark" : "light"
|
||||
@@ -33,12 +33,12 @@ export default function CenteredForm({
|
||||
alt="Linkwarden"
|
||||
className="h-12 w-fit mx-auto"
|
||||
/>
|
||||
)}
|
||||
{text && (
|
||||
) : undefined}
|
||||
{text ? (
|
||||
<p className="text-lg max-w-[30rem] min-w-80 w-full mx-auto font-semibold px-2 text-center">
|
||||
{text}
|
||||
</p>
|
||||
)}
|
||||
) : undefined}
|
||||
{children}
|
||||
<p className="text-center text-xs text-neutral mb-5">
|
||||
<Trans
|
||||
|
||||
@@ -34,9 +34,9 @@ export default function MainLayout({ children }: Props) {
|
||||
|
||||
return (
|
||||
<div className="flex" data-testid="dashboard-wrapper">
|
||||
{showAnnouncement && (
|
||||
{showAnnouncement ? (
|
||||
<Announcement toggleAnnouncementBar={toggleAnnouncementBar} />
|
||||
)}
|
||||
) : undefined}
|
||||
<div className="hidden lg:block">
|
||||
<Sidebar className={`fixed top-0`} />
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,7 @@ export default function SettingsLayout({ children }: Props) {
|
||||
|
||||
{children}
|
||||
|
||||
{sidebar && (
|
||||
{sidebar ? (
|
||||
<div className="fixed top-0 bottom-0 right-0 left-0 bg-black bg-opacity-10 backdrop-blur-sm flex items-center fade-in z-30">
|
||||
<ClickAwayHandler
|
||||
className="h-full"
|
||||
@@ -65,7 +65,7 @@ export default function SettingsLayout({ children }: Props) {
|
||||
</div>
|
||||
</ClickAwayHandler>
|
||||
</div>
|
||||
)}
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user