-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make dialog controllable with gamepad
- Loading branch information
1 parent
c79f1db
commit f60026c
Showing
14 changed files
with
209 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ coverage | |
/playwright/.cache/ | ||
/e2eTests/*Config/ | ||
/readme/build/ | ||
/buildConfig/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,49 @@ | ||
import { styled } from "styled-system/jsx"; | ||
import { Dialog } from "~/components/Dialog"; | ||
import { Headline } from "~/components/Headline"; | ||
import { IconChildrenWrapper } from "~/components/IconChildrenWrapper"; | ||
import { Typography } from "~/components/Typography"; | ||
import { MdErrorOutline } from "react-icons/md"; | ||
|
||
const Body = styled("div", { | ||
base: { | ||
position: "relative", | ||
paddingTop: "1", | ||
paddingRight: "0.5em", | ||
paddingBottom: "1", | ||
paddingLeft: "2", | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "1", | ||
backgroundColor: "backgroundColor", | ||
minWidth: "25rem", | ||
height: "100%", | ||
}, | ||
}); | ||
import { ListActionBarLayout } from "../layouts/ListActionBarLayout"; | ||
import { SidebarMainLayout } from "~/components/layouts/SidebarMainLayout"; | ||
import type { ForwardedRef } from "react"; | ||
|
||
const Stacktrace = styled("p", { | ||
base: { | ||
whiteSpace: "pre-wrap", | ||
overflowY: "scroll", | ||
}, | ||
}); | ||
|
||
type Props = { | ||
title?: string; | ||
stacktrace?: string; | ||
onClose: () => void; | ||
listRef?: ForwardedRef<HTMLDivElement>; | ||
}; | ||
|
||
// TODO: add radix scrollarea | ||
export const ErrorDialog = ({ | ||
title = "An unexpected error has occurred", | ||
stacktrace = "An unexpected error has occurred", | ||
onClose, | ||
listRef, | ||
}: Props) => ( | ||
<Dialog open onClose={onClose}> | ||
<Body> | ||
<Headline> | ||
<IconChildrenWrapper> | ||
<MdErrorOutline /> | ||
<Typography>{title}</Typography> | ||
</IconChildrenWrapper> | ||
</Headline> | ||
<Stacktrace>{stacktrace}</Stacktrace> | ||
</Body> | ||
<Dialog open onClose={onClose} variant="accent" smaller={true}> | ||
<SidebarMainLayout> | ||
<SidebarMainLayout.Main> | ||
<ListActionBarLayout | ||
headline={ | ||
<IconChildrenWrapper> | ||
<MdErrorOutline /> | ||
<Typography>{title}</Typography> | ||
</IconChildrenWrapper> | ||
} | ||
> | ||
<ListActionBarLayout.ListActionBarContainer | ||
ref={listRef} | ||
scrollSmooth | ||
list={<Stacktrace>{stacktrace}</Stacktrace>} | ||
/> | ||
</ListActionBarLayout> | ||
</SidebarMainLayout.Main> | ||
</SidebarMainLayout> | ||
</Dialog> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.