Skip to content

Commit

Permalink
fix: hmr linting issue (#746)
Browse files Browse the repository at this point in the history
Signed-off-by: hxtree <[email protected]>
  • Loading branch information
hxtree authored Dec 11, 2023
1 parent 7966966 commit ef0cf5e
Show file tree
Hide file tree
Showing 23 changed files with 207 additions and 194 deletions.
2 changes: 1 addition & 1 deletion services/admin-client/components/DiceAnalyzer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const DiceAnalyzer = (props: DiceAnalyzerProps) => {

<Grid item>
<Stack>
<Box component="form" noValidate autoComplete="off">
<Box component="form">
<TextField
label="Dice Notation"
value={notation}
Expand Down
8 changes: 8 additions & 0 deletions services/design-system/src/SelectChangeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export type SelectChangeEvent<T = string> =
| (Event & {
target: {
value: T;
name: string;
};
})
| React.ChangeEvent<HTMLInputElement>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MUIAlert, { AlertProps as MUIAlertProps } from '@mui/material/Alert';

export type AlertProps = {} & MUIAlertProps;
export type AlertProps = MUIAlertProps;

export const Alert = (props: AlertProps) => {
const { ...muiProps } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ import MuiLoadingButton, {
LoadingButtonProps as MuiLoadingButtonProps,
} from '@mui/lab/LoadingButton';

export type LoadingButtonProps = {} & MuiLoadingButtonProps;
export type LoadingButtonProps = {
selected?: boolean;
} & MuiLoadingButtonProps;

export const LoadingButton = (props: LoadingButtonProps) => {
const { children, ...muiProps } = props;
return (
<MuiLoadingButton
{...muiProps}
style={{
...(props.selected && { backgroundColor: '#616366', color: '#FFF' }),
fontFamily: 'Helvetica, arial, sans-serif',
fontWeight: 'bold',
borderRadius: '36px',
padding: '15px 30px 10px 30px',
}}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MUICheckbox, {
CheckboxProps as MUICheckboxProps,
} from '@mui/material/Checkbox';

export type CheckboxProps = {} & MUICheckboxProps;
export type CheckboxProps = MUICheckboxProps;

export const Checkbox = (props: CheckboxProps) => {
const { ...muiProps } = props;
Expand Down
17 changes: 4 additions & 13 deletions services/design-system/src/components/CodeSnippet/CodeSnippet.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
// import React from 'react';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { codeTheme } from './hljs-custom';

export enum CodeSnippetLanguages {
JSON = 'json',
HTML = 'html',
CSS = 'css',
JAVASCRIPT = 'javascript',
}

export type CodeSnippetProps = {
data: string;
language: CodeSnippetLanguages;
};
import { CodeSnippetProps } from './CodeSnippetProps';

export const CodeSnippet = (props: CodeSnippetProps) => {
const { data, language } = props;

return (
<div>
{data ? (
<SyntaxHighlighter language={language} style={codeTheme as any}>
<SyntaxHighlighter language={language} style={codeTheme}>
{data}
</SyntaxHighlighter>
) : (
Expand All @@ -29,3 +18,5 @@ export const CodeSnippet = (props: CodeSnippetProps) => {
</div>
);
};

export default CodeSnippet;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export enum CodeSnippetLanguages {
JSON = 'json',
HTML = 'html',
CSS = 'css',
JAVASCRIPT = 'javascript',
}

export type CodeSnippetProps = {
data: string;
language: CodeSnippetLanguages;
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const codeTheme = {
import { CSSProperties } from 'react';

export const codeTheme: { [key: string]: CSSProperties } = {
hljs: {
display: 'block',
overflowX: 'auto',
Expand Down
16 changes: 1 addition & 15 deletions services/design-system/src/components/Gauge/Gauge.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
export enum OrientationType {
RIGHT = 'RIGHT',
LEFT = 'LEFT',
}

export type GaugeProps = {
width: number;
height: number;
color?: string;
strokeWidth?: number;
orientation?: OrientationType;
current?: number;
max?: number;
boundingBox: boolean;
};
import { GaugeProps, OrientationType } from "./GaugeProps";

export const Gauge = (props: GaugeProps) => {
const width = props.width ?? 150;
Expand Down
15 changes: 15 additions & 0 deletions services/design-system/src/components/Gauge/GaugeProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export enum OrientationType {
RIGHT = 'RIGHT',
LEFT = 'LEFT',
}

export type GaugeProps = {
width: number;
height: number;
color?: string;
strokeWidth?: number;
orientation?: OrientationType;
current?: number;
max?: number;
boundingBox: boolean;
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export {
faBars,
} from '@fortawesome/free-solid-svg-icons';

export { faGithub } from '@fortawesome/free-brands-svg-icons';
export { faGithub } from '@fortawesome/free-brands-svg-icons';
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@ import MUIStack, { StackProps as MUIStackProps } from '@mui/material/Stack';
import MUIGrid, { GridProps as MUIGridProps } from '@mui/material/Grid';
import MUIPaper, { PaperProps as MUIPaperProps } from '@mui/material/Paper';

export type PaperProps = {} & MUIPaperProps;
export type PaperProps = MUIPaperProps;

export const Paper = (props: PaperProps) => {
const { children, ...muiProps } = props;
return <MUIPaper {...muiProps}>{children}</MUIPaper>;
};

export type StackProps = {} & MUIStackProps;
export type StackProps = MUIStackProps;
export const Stack = (props: StackProps) => {
const { children, ...muiProps } = props;
return <MUIStack {...muiProps}>{children}</MUIStack>;
};

export type BoxProps = {} & MUIBoxProps;
export type BoxProps = MUIBoxProps;
export const Box = (props: BoxProps) => {
const { children, ...muiProps } = props;
return <MUIBox {...muiProps}>{children}</MUIBox>;
};

export type GridProps = {} & MUIGridProps;
export type GridProps = MUIGridProps;
export const Grid = (props: GridProps) => {
const { children, ...muiProps } = props;
return <MUIGrid {...muiProps}>{children}</MUIGrid>;
};

export type ItemProps = {} & PaperProps;
export type ItemProps = PaperProps;
// style={"padding: 0.5rem; font-family: 'Eczar', serif;"}
export const Item = (props: ItemProps) => {
const { children, ...muiProps } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MUILink, { LinkProps as MUILinkProps } from '@mui/material/Link';

export type LinkProps = {} & MUILinkProps;
export type LinkProps = MUILinkProps;

export const Link = (props: LinkProps) => {
const { children, ...muiProps } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MUILink, { LinkProps as MUILinkProps } from '@mui/material/Link';

export type NonInteractiveLinkProps = {} & MUILinkProps;
export type NonInteractiveLinkProps = MUILinkProps;

export const NonInteractiveLink = (props: NonInteractiveLinkProps) => {
const { children, ...muiProps } = props;
Expand Down
105 changes: 0 additions & 105 deletions services/design-system/src/components/Mui/Typography.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions services/design-system/src/components/Mui/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export {
Drawer,
CssBaseline,
Toolbar,
List,
Divider,
IconButton,
ListItem,
ListItemButton,
FormControl,
InputLabel,
Select,
CardContent,
Card,
Container,
OutlinedInput,
MenuItem,
ListItemIcon,
ListItemText,
styled,
useTheme,
} from '@mui/material';
46 changes: 0 additions & 46 deletions services/design-system/src/components/Mui/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MUITextField, {
TextFieldProps as MUITextFieldProps,
} from '@mui/material/TextField';

export type TextFieldProps = {} & MUITextFieldProps;
export type TextFieldProps = MUITextFieldProps;

export const TextField = (props: TextFieldProps) => {
const { ...muiProps } = props;
Expand Down
Loading

0 comments on commit ef0cf5e

Please sign in to comment.