Skip to content

Commit

Permalink
Removed <Dialog> transitions. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Oct 30, 2024
1 parent a04390e commit a1c057b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
11 changes: 11 additions & 0 deletions Tools/dora-dora/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ const useResize = ({minWidth, defaultWidth}: UseResizeProps) => {
};

const resizeHandleWidth = 4;
const transitionProps = {
appear: false,
enter: false,
exit: false
};

export default function PersistentDrawerLeft() {
const {t} = useTranslation();
Expand Down Expand Up @@ -2293,6 +2298,8 @@ export default function PersistentDrawerLeft() {
<Dialog
maxWidth="lg"
open={filterOptions !== null}
transitionDuration={0}
TransitionProps={transitionProps}
>
<DialogContent>
{filterOptions !== null ?
Expand All @@ -2306,6 +2313,8 @@ export default function PersistentDrawerLeft() {
open={popupInfo !== null}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
transitionDuration={0}
TransitionProps={transitionProps}
>
<DialogTitle id="alert-dialog-title">
{popupInfo?.title}
Expand Down Expand Up @@ -2361,6 +2370,8 @@ export default function PersistentDrawerLeft() {
open={fileInfo !== null}
aria-labelledby="filename-dialog-title"
aria-describedby="filename-dialog-description"
transitionDuration={0}
TransitionProps={transitionProps}
>
<DialogTitle id="filename-dialog-title">
{t(fileInfo?.title ?? "")}
Expand Down
13 changes: 8 additions & 5 deletions Tools/dora-dora/src/LogView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ const formatPart = (text: string) => {
}</span>;
};

const transitionProps = {
appear: false,
enter: false,
exit: false
};

const LogView = memo((props: LogViewProps) => {
const {t} = useTranslation();
const [text, setText] = useState(t("log.wait"));
Expand Down Expand Up @@ -497,15 +503,12 @@ const LogView = memo((props: LogViewProps) => {
<Dialog
maxWidth="lg"
fullWidth
keepMounted
open={props.openName !== null}
aria-labelledby="logview-dialog-title"
aria-describedby="logview-dialog-description"
transitionDuration={0}
TransitionProps={{
appear: false,
enter: false,
exit: false,
}}
TransitionProps={transitionProps}
>
<DialogContent style={{overflow: "hidden", margin: 0, padding: 0}}>
<div hidden={!toggleProfiler}>
Expand Down
23 changes: 17 additions & 6 deletions Tools/dora-dora/src/NewFileDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { SiNodered } from 'react-icons/si';
import { DiCode } from 'react-icons/di';
import { VscMarkdown } from 'react-icons/vsc';
import { useTranslation } from 'react-i18next';
import { DialogActions, Grid } from '@mui/material';
import { DialogActions, Grid2 } from '@mui/material';

export type DoraFileType = "Lua" | "Yuescript" | "Teal" | "Typescript" | "Dora XML" | "Markdown" | "Yarn" | "Visual Script" | "Folder"

Expand Down Expand Up @@ -95,6 +95,12 @@ export interface NewFileDialogProps {
onClose: (value?: DoraFileType) => void;
}

const transitionProps = {
appear: false,
enter: false,
exit: false
};

function NewFileDialog(props: NewFileDialogProps) {
const { t } = useTranslation();
const { onClose, open } = props;
Expand All @@ -108,12 +114,17 @@ function NewFileDialog(props: NewFileDialogProps) {
};

return (
<Dialog maxWidth="sm" onClose={handleClose} open={open}>
<Dialog
maxWidth="sm"
onClose={handleClose}
open={open}
transitionDuration={0}
TransitionProps={transitionProps}>
<DialogTitle>{t("file.new")}</DialogTitle>
<Grid container columns={2}>
<Grid2 container columns={2}>
{
fileTypes.map((fileType) => (
<Grid key={fileType.name} xs={1} item>
<Grid2 key={fileType.name} size={1}>
<ListItem>
<ListItemButton sx={{height:"90px"}}
onClick={() => handleListItemClick(fileType.name)}
Expand All @@ -123,10 +134,10 @@ function NewFileDialog(props: NewFileDialogProps) {
<ListItemText primary={fileType.name} secondary={t(fileType.desc)} sx={{paddingLeft: fileType.padding}}/>
</ListItemButton>
</ListItem>
</Grid>
</Grid2>
))
}
</Grid>
</Grid2>
<DialogActions/>
</Dialog>
);
Expand Down

0 comments on commit a1c057b

Please sign in to comment.