Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: [M3-6397, M3-6416] - MUI v5 Migration - Components > SupportLink, TextTooltip #8993

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/manager/src/components/MigrateError.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import Typography from 'src/components/core/Typography';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';

export const MigrateError: React.FC<{}> = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/components/SupportError.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { APIError } from '@linode/api-v4/lib/types';
import Typography from 'src/components/core/Typography';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import { useTheme } from '@mui/material/styles';

interface Props {
Expand Down
6 changes: 3 additions & 3 deletions packages/manager/src/components/SupportLink/SupportLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TicketType,
} from 'src/features/Support/SupportTickets/SupportTicketDrawer';

interface Props {
interface SupportLinkProps {
title?: string;
description?: string;
text: string;
Expand All @@ -19,7 +19,7 @@ export interface EntityForTicketDetails {
type: EntityType;
}

const SupportLink = (props: Props) => {
const SupportLink = (props: SupportLinkProps) => {
const { description, text, title, entity, ticketType, onClick } = props;
return (
<Link
Expand All @@ -40,4 +40,4 @@ const SupportLink = (props: Props) => {
);
};

export default SupportLink;
export { SupportLink };
2 changes: 1 addition & 1 deletion packages/manager/src/components/SupportLink/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './SupportLink';
export { SupportLink } from './SupportLink';
12 changes: 6 additions & 6 deletions packages/manager/src/components/TextTooltip/TextTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { SxProps } from '@mui/material';
import * as React from 'react';
import { makeStyles } from '@mui/styles';
import { makeStyles } from 'tss-react/mui';
import { Theme } from '@mui/material/styles';
import ToolTip from 'src/components/core/Tooltip';
import Typography from 'src/components/core/Typography';

interface Props {
interface TextTooltipProps {
displayText: string;
tooltipText: JSX.Element | string;
sxTypography?: SxProps;
}

const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles()((theme: Theme) => ({
root: {
position: 'relative',
borderRadius: 4,
Expand All @@ -30,8 +30,8 @@ const useStyles = makeStyles((theme: Theme) => ({
},
}));

export const TextTooltip = (props: Props) => {
const classes = useStyles();
const TextTooltip = (props: TextTooltipProps) => {
const { classes } = useStyles();
const { displayText, tooltipText, sxTypography } = props;

return (
Expand All @@ -49,4 +49,4 @@ export const TextTooltip = (props: Props) => {
);
};

export default TextTooltip;
export { TextTooltip };
3 changes: 1 addition & 2 deletions packages/manager/src/components/TextTooltip/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
import TextTooltip from './TextTooltip';
export default TextTooltip;
export { TextTooltip } from './TextTooltip';
2 changes: 1 addition & 1 deletion packages/manager/src/components/VerificationError.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import Typography from 'src/components/core/Typography';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';

interface Props {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/features/Account/EnableManaged.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ConfirmationDialog from 'src/components/ConfirmationDialog';
import Typography from 'src/components/core/Typography';
import ExternalLink from 'src/components/ExternalLink';
import Grid from 'src/components/Grid';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import withLinodes, {
DispatchProps,
} from 'src/containers/withLinodes.container';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Theme } from '@mui/material/styles';
import TableBody from 'src/components/core/TableBody';
import TableHead from 'src/components/core/TableHead';
import Typography from 'src/components/core/Typography';
import TextTooltip from 'src/components/TextTooltip/TextTooltip';
import { TextTooltip } from 'src/components/TextTooltip';
import Currency from 'src/components/Currency';
import DateTimeDisplay from 'src/components/DateTimeDisplay';
import Select, { Item } from 'src/components/EnhancedSelect/Select';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Grid from '@mui/material/Unstable_Grid2';
import { TooltipIcon } from 'src/components/TooltipIcon/TooltipIcon';
import LinearProgress from 'src/components/LinearProgress';
import Notice from 'src/components/Notice';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import TextField from 'src/components/TextField';
import PayPalErrorBoundary from 'src/features/Billing/BillingPanels/PaymentInfoPanel/PayPalErrorBoundary';
import { useAccount } from 'src/queries/account';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Drawer from 'src/components/Drawer';
import Link from 'src/components/Link';
import LinodeMultiSelect from 'src/components/LinodeMultiSelect/LinodeMultiSelect';
import Notice from 'src/components/Notice';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import { useGrants, useProfile } from 'src/queries/profile';
import { getEntityIdsByPermission } from 'src/utilities/grants';
import { READ_ONLY_LINODES_HIDDEN_MESSAGE } from '../../FirewallLanding/CreateFirewallDrawer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ActionsPanel from 'src/components/ActionsPanel';
import Button from 'src/components/Button';
import ConfirmationDialog from 'src/components/ConfirmationDialog';
import Typography from 'src/components/core/Typography';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import { useMutateAccountAgreements } from 'src/queries/accountAgreements';
import { getErrorStringOrDefault } from 'src/utilities/errorUtils';
import EUAgreementCheckbox from '../Account/Agreements/EUAgreementCheckbox';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import TableHead from 'src/components/core/TableHead';
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
import Notice from 'src/components/Notice';
import Radio from 'src/components/Radio';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import Table from 'src/components/Table';
import TableCell from 'src/components/TableCell';
import TableRow from 'src/components/TableRow';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Link } from 'src/components/Link';
import ModeSelect, { Mode } from 'src/components/ModeSelect';
import Notice from 'src/components/Notice';
import TextField from 'src/components/TextField';
import TextTooltip from 'src/components/TextTooltip';
import { TextTooltip } from 'src/components/TextTooltip';
import {
handleFieldErrors,
handleGeneralErrors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { compose } from 'recompose';

import Notice from 'src/components/Notice';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';

interface Props {
notifications: Notification[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Typography from 'src/components/core/Typography';
import ExternalLink from 'src/components/ExternalLink';
import SupportLink from 'src/components/SupportLink';
import { SupportLink } from 'src/components/SupportLink';
import { MAGIC_DATE_THAT_EMAIL_RESTRICTIONS_WERE_IMPLEMENTED } from 'src/constants';
import { useAccount } from 'src/queries/account';
import { sendLinodeCreateDocsEvent } from 'src/utilities/ga';
Expand Down