Skip to content

Commit 0286a78

Browse files
committed
refactor: move error handling display to a new location in the Authorize component
1 parent 08e1682 commit 0286a78

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

epicshop/epic-me/app/routes/oauth/authorize.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -223,34 +223,6 @@ export default function Authorize({
223223
</div>
224224
</div>
225225

226-
{actionData?.status === 'error' && actionData?.message ? (
227-
<div className="mb-8 rounded-xl border border-red-200 bg-red-50 p-6 dark:border-red-700 dark:bg-red-900/20">
228-
<div className="flex">
229-
<div className="flex-shrink-0">
230-
<svg
231-
className="h-5 w-5 text-red-400 dark:text-red-300"
232-
viewBox="0 0 20 20"
233-
fill="currentColor"
234-
>
235-
<path
236-
fillRule="evenodd"
237-
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"
238-
clipRule="evenodd"
239-
/>
240-
</svg>
241-
</div>
242-
<div className="ml-3">
243-
<h3 className="text-sm font-medium text-red-800 dark:text-red-200">
244-
Authorization Failed
245-
</h3>
246-
<div className="mt-2 text-sm text-red-700 dark:text-red-300">
247-
<p>{actionData.message}</p>
248-
</div>
249-
</div>
250-
</div>
251-
</div>
252-
) : null}
253-
254226
<div className="mb-8 rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-700">
255227
<h3 className="mb-2 text-sm font-medium text-gray-900 dark:text-white">
256228
What happens when you authorize?
@@ -433,6 +405,34 @@ export default function Authorize({
433405
</div>
434406
</div>
435407

408+
{actionData?.status === 'error' && actionData?.message ? (
409+
<div className="mb-8 rounded-xl border border-red-200 bg-red-50 p-6 dark:border-red-700 dark:bg-red-900/20">
410+
<div className="flex">
411+
<div className="flex-shrink-0">
412+
<svg
413+
className="h-5 w-5 text-red-400 dark:text-red-300"
414+
viewBox="0 0 20 20"
415+
fill="currentColor"
416+
>
417+
<path
418+
fillRule="evenodd"
419+
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"
420+
clipRule="evenodd"
421+
/>
422+
</svg>
423+
</div>
424+
<div className="ml-3">
425+
<h3 className="text-sm font-medium text-red-800 dark:text-red-200">
426+
Authorization Failed
427+
</h3>
428+
<div className="mt-2 text-sm text-red-700 dark:text-red-300">
429+
<p>{actionData.message}</p>
430+
</div>
431+
</div>
432+
</div>
433+
</div>
434+
) : null}
435+
436436
{users.length > 0 ? (
437437
<div className="grid gap-4">
438438
{users.map((user) => {

0 commit comments

Comments
 (0)