@djangocfg/layouts 1.4.10 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/layouts",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "Layout system and components for Unrealon applications",
5
5
  "author": {
6
6
  "name": "DjangoCFG",
@@ -63,9 +63,9 @@
63
63
  "check": "tsc --noEmit"
64
64
  },
65
65
  "peerDependencies": {
66
- "@djangocfg/api": "^1.4.10",
67
- "@djangocfg/og-image": "^1.4.10",
68
- "@djangocfg/ui": "^1.4.10",
66
+ "@djangocfg/api": "^1.4.11",
67
+ "@djangocfg/og-image": "^1.4.11",
68
+ "@djangocfg/ui": "^1.4.11",
69
69
  "@hookform/resolvers": "^5.2.0",
70
70
  "consola": "^3.4.2",
71
71
  "lucide-react": "^0.468.0",
@@ -86,7 +86,7 @@
86
86
  "vidstack": "0.6.15"
87
87
  },
88
88
  "devDependencies": {
89
- "@djangocfg/typescript-config": "^1.4.10",
89
+ "@djangocfg/typescript-config": "^1.4.11",
90
90
  "@types/node": "^24.7.2",
91
91
  "@types/react": "19.2.2",
92
92
  "@types/react-dom": "19.2.1",
@@ -24,7 +24,6 @@
24
24
  'use client';
25
25
 
26
26
  import React from 'react';
27
- import { useRouter } from 'next/router';
28
27
  import { Button } from '@djangocfg/ui/components';
29
28
  import { getErrorContent } from './errorConfig';
30
29
 
@@ -64,8 +63,6 @@ export function ErrorLayout({
64
63
  illustration,
65
64
  supportEmail = 'support@example.com',
66
65
  }: ErrorLayoutProps) {
67
- const router = useRouter();
68
-
69
66
  // Auto-configure content from error code if not provided
70
67
  const autoContent = code && (!title || !description || !illustration)
71
68
  ? getErrorContent(code)
@@ -77,15 +74,22 @@ export function ErrorLayout({
77
74
  const finalIllustration = illustration || autoContent?.icon;
78
75
 
79
76
  const handleGoBack = () => {
80
- if (window.history.length > 1) {
81
- router.back();
77
+ // Use native navigation with full page reload instead of Next.js client-side navigation
78
+ if (document.referrer && document.referrer !== window.location.href) {
79
+ // Navigate to referrer with full reload
80
+ window.location.href = document.referrer;
81
+ } else if (window.history.length > 1) {
82
+ // Fallback: go back in history
83
+ window.history.back();
82
84
  } else {
83
- router.push('/');
85
+ // Last resort: go to home
86
+ window.location.href = '/';
84
87
  }
85
88
  };
86
89
 
87
90
  const handleGoHome = () => {
88
- router.push('/');
91
+ // Full page reload to home
92
+ window.location.href = '/';
89
93
  };
90
94
 
91
95
  return (
@@ -135,7 +139,7 @@ export function ErrorLayout({
135
139
  variant="outline"
136
140
  size="lg"
137
141
  onClick={handleGoBack}
138
- className="min-w-[140px]"
142
+ style={{ minWidth: '140px', padding: '12px 32px' }}
139
143
  >
140
144
  Go Back
141
145
  </Button>
@@ -143,7 +147,7 @@ export function ErrorLayout({
143
147
  variant="default"
144
148
  size="lg"
145
149
  onClick={handleGoHome}
146
- className="min-w-[140px]"
150
+ style={{ minWidth: '140px', padding: '12px 32px' }}
147
151
  >
148
152
  Go Home
149
153
  </Button>