mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 10:35:08 +01:00
Fix error overflow
This commit is contained in:
parent
953abce297
commit
41aaf29be7
@ -37,10 +37,10 @@ export function ErrorCard(props: {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
// I didn't put a <Transition> here because it'd fade out, then jump height weirdly
|
// I didn't put a <Transition> here because it'd fade out, then jump height weirdly
|
||||||
<div className="w-full bg-errors-card p-6 rounded-lg">
|
<div className="bg-errors-card w-full rounded-lg p-6">
|
||||||
<div className="flex justify-between items-center pb-2 border-b border-errors-border">
|
<div className="border-errors-border flex items-center justify-between border-b pb-2">
|
||||||
<span className="text-white font-medium">{t("errors.details")}</span>
|
<span className="font-medium text-white">{t("errors.details")}</span>
|
||||||
<div className="flex justify-center items-center gap-3">
|
<div className="flex items-center justify-center gap-3">
|
||||||
<Button
|
<Button
|
||||||
theme="secondary"
|
theme="secondary"
|
||||||
padding="p-2 md:px-4"
|
padding="p-2 md:px-4"
|
||||||
@ -48,12 +48,12 @@ export function ErrorCard(props: {
|
|||||||
>
|
>
|
||||||
{hasCopied ? (
|
{hasCopied ? (
|
||||||
<>
|
<>
|
||||||
<Icon icon={Icons.CHECKMARK} className="text-xs mr-3" />
|
<Icon icon={Icons.CHECKMARK} className="mr-3 text-xs" />
|
||||||
{t("actions.copied")}
|
{t("actions.copied")}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Icon icon={Icons.COPY} className="text-2xl mr-3" />
|
<Icon icon={Icons.COPY} className="mr-3 text-2xl" />
|
||||||
{t("actions.copy")}
|
{t("actions.copy")}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@ -67,7 +67,7 @@ export function ErrorCard(props: {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 h-60 overflow-y-auto text-left whitespace-pre pointer-events-auto select-text">
|
<div className="pointer-events-auto mt-4 h-60 select-text overflow-y-auto whitespace-pre text-left">
|
||||||
{errorMessage}
|
{errorMessage}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -82,8 +82,8 @@ export function ErrorCardInPlainModal(props: {
|
|||||||
}) {
|
}) {
|
||||||
if (!props.show || !props.error) return null;
|
if (!props.show || !props.error) return null;
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 w-full h-full bg-black bg-opacity-30 flex justify-center items-center p-12">
|
<div className="fixed inset-0 flex h-full w-full items-center justify-center bg-black bg-opacity-30 p-12">
|
||||||
<div className="max-w-2xl">
|
<div className="w-full max-w-2xl">
|
||||||
<ErrorCard error={props.error} onClose={props.onClose} />
|
<ErrorCard error={props.error} onClose={props.onClose} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -99,7 +99,7 @@ export function ErrorCardInModal(props: {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal id={props.id}>
|
<Modal id={props.id}>
|
||||||
<div className="max-w-2xl pointer-events-auto">
|
<div className="pointer-events-auto w-11/12 max-w-2xl">
|
||||||
<ErrorCard error={props.error} onClose={props.onClose} />
|
<ErrorCard error={props.error} onClose={props.onClose} />
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -21,10 +21,10 @@ export function ErrorPart(props: { error: any; errorInfo: any }) {
|
|||||||
const error = `${props.error.toString()}\n${errorLines.join("\n")}`;
|
const error = `${props.error.toString()}\n${errorLines.join("\n")}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative flex flex-1 flex-col min-h-screen">
|
<div className="relative flex min-h-screen flex-1 flex-col">
|
||||||
<div className="flex h-full flex-1 flex-col items-center justify-center p-5 text-center">
|
<div className="flex h-full flex-1 flex-col items-center justify-center p-5 text-center">
|
||||||
<ErrorLayout>
|
<ErrorLayout>
|
||||||
<ErrorContainer maxWidth="max-w-2xl">
|
<ErrorContainer maxWidth="max-w-2xl w-9/10">
|
||||||
<IconPill icon={Icons.EYE_SLASH}>{t("errors.badge")}</IconPill>
|
<IconPill icon={Icons.EYE_SLASH}>{t("errors.badge")}</IconPill>
|
||||||
<Title>{t("errors.title")}</Title>
|
<Title>{t("errors.title")}</Title>
|
||||||
|
|
||||||
@ -38,14 +38,14 @@ export function ErrorPart(props: { error: any; errorInfo: any }) {
|
|||||||
<div className="flex gap-3">
|
<div className="flex gap-3">
|
||||||
<ButtonPlain
|
<ButtonPlain
|
||||||
theme="secondary"
|
theme="secondary"
|
||||||
className="mt-6 md:px-12 p-2.5"
|
className="mt-6 p-2.5 md:px-12"
|
||||||
onClick={() => window.location.reload()}
|
onClick={() => window.location.reload()}
|
||||||
>
|
>
|
||||||
{t("errors.reloadPage")}
|
{t("errors.reloadPage")}
|
||||||
</ButtonPlain>
|
</ButtonPlain>
|
||||||
<ButtonPlain
|
<ButtonPlain
|
||||||
theme="purple"
|
theme="purple"
|
||||||
className="mt-6 md:px-12 p-2.5"
|
className="mt-6 p-2.5 md:px-12"
|
||||||
onClick={() => setShowErrorCard(true)}
|
onClick={() => setShowErrorCard(true)}
|
||||||
>
|
>
|
||||||
{t("errors.showError")}
|
{t("errors.showError")}
|
||||||
|
Loading…
Reference in New Issue
Block a user