Skip to content

Commit

Permalink
refactor: [M3-6395] – MUI v5 Migration - Components > StackScript (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dwiley-akamai authored Apr 13, 2023
1 parent 39f02b3 commit 44ab7dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions packages/manager/src/components/StackScript/StackScript.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { StackScript as StackScriptType } from '@linode/api-v4/lib/stackscripts';
import Box from '@mui/material/Box';
import { Theme, useTheme } from '@mui/material/styles';
import * as React from 'react';
import { Link, useHistory } from 'react-router-dom';
import Button from 'src/components/Button';
import CopyTooltip from 'src/components/CopyTooltip';
import Chip from 'src/components/core/Chip';
import Divider from 'src/components/core/Divider';
import { makeStyles } from '@mui/styles';
import { Theme, useTheme } from '@mui/material/styles';
import Typography from 'src/components/core/Typography';
import DateTimeDisplay from 'src/components/DateTimeDisplay';
import H1Header from 'src/components/H1Header';
import ScriptCode from 'src/components/ScriptCode';
import { useAccountManagement } from 'src/hooks/useAccountManagement';
import { listToItemsByID } from 'src/queries/base';
import { useAllImagesQuery } from 'src/queries/images';
import Box from '@mui/material/Box';
import { makeStyles } from 'tss-react/mui';
import TooltipIcon from '../TooltipIcon';

const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles()((theme: Theme) => ({
root: {
backgroundColor: theme.bg.bgPaper,
'.detailsWrapper &': {
Expand Down Expand Up @@ -73,7 +73,7 @@ const useStyles = makeStyles((theme: Theme) => ({
},
}));

export interface Props {
export interface StackScriptProps {
data: StackScriptType;
userCanModify: boolean;
}
Expand All @@ -83,7 +83,7 @@ interface StackScriptImages {
deprecated: JSX.Element[];
}

export const StackScript: React.FC<Props> = (props) => {
export const StackScript = (props: StackScriptProps) => {
const {
data: {
username,
Expand All @@ -99,10 +99,11 @@ export const StackScript: React.FC<Props> = (props) => {
userCanModify,
} = props;

const { classes } = useStyles();
const { profile } = useAccountManagement();

const theme = useTheme();
const classes = useStyles();
const history = useHistory();
const { profile } = useAccountManagement();

const { data: imagesData } = useAllImagesQuery(
{},
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/src/components/StackScript/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import StackScript, { Props as _Props } from './StackScript';
import StackScript, { StackScriptProps } from './StackScript';
export default StackScript;
/* tslint:disable */
export interface Props extends _Props {}
export interface Props extends StackScriptProps {}

0 comments on commit 44ab7dd

Please sign in to comment.