prettier fixes

This commit is contained in:
Gábor Farkas
2023-09-29 13:34:51 +02:00
parent 143f39e365
commit 313a166be6
8 changed files with 23 additions and 22 deletions

View File

@@ -7,7 +7,5 @@ interface Props {
} }
export const AckButton: FC<Props> = ({ className, onClick }) => { export const AckButton: FC<Props> = ({ className, onClick }) => {
return ( return <ActionButton className={className} icon="reply-all" tooltip="Acknowledge problem" onClick={onClick} />;
<ActionButton className={className} icon="reply-all" tooltip="Acknowledge problem" onClick={onClick} />
);
}; };

View File

@@ -18,8 +18,10 @@ export const ActionButton: FC<PropsWithChildren<Props>> = ({ icon, width, toolti
const buttonClass = cx( const buttonClass = cx(
'btn', 'btn',
styles.button, styles.button,
css`width: ${width || 3}rem`, css`
className, width: ${width || 3}rem;
`,
className
); );
let button = ( let button = (

View File

@@ -14,16 +14,17 @@ export const provideConfig = (component: React.ComponentType<any>) => {
return ConfigProvider; return ConfigProvider;
}; };
export const getCurrentTheme = () => createTheme({ export const getCurrentTheme = () =>
createTheme({
colors: { colors: {
mode: config.bootData.user.lightTheme ? 'light' : 'dark', mode: config.bootData.user.lightTheme ? 'light' : 'dark',
}, },
}); });
export const ThemeProvider = ({ children }: { children: React.ReactNode }) => { export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
return ( return (
<ConfigConsumer> <ConfigConsumer>
{config => { {(config) => {
return <ThemeContext.Provider value={getCurrentTheme()}>{children}</ThemeContext.Provider>; return <ThemeContext.Provider value={getCurrentTheme()}>{children}</ThemeContext.Provider>;
}} }}
</ConfigConsumer> </ConfigConsumer>

View File

@@ -7,7 +7,5 @@ interface Props {
} }
export const ExecScriptButton: FC<Props> = ({ className, onClick }) => { export const ExecScriptButton: FC<Props> = ({ className, onClick }) => {
return ( return <ActionButton className={className} icon="terminal" tooltip="Execute script" onClick={onClick} />;
<ActionButton className={className} icon="terminal" tooltip="Execute script" onClick={onClick} />
);
}; };

View File

@@ -10,13 +10,11 @@ export const GFHeartIcon: FC<Props> = ({ status, className }) => {
const iconClass = cx( const iconClass = cx(
className, className,
'icon-gf', 'icon-gf',
{ "icon-gf-critical": status === 'critical' || status === 'problem' || status === 'warning'}, { 'icon-gf-critical': status === 'critical' || status === 'problem' || status === 'warning' },
{ "icon-gf-online": status === 'online' || status === 'ok' }, { 'icon-gf-online': status === 'online' || status === 'ok' }
); );
return ( return <i className={iconClass}></i>;
<i className={iconClass}></i>
);
}; };
export default GFHeartIcon; export default GFHeartIcon;

View File

@@ -33,7 +33,7 @@ export class ModalController extends React.Component<Props, State> {
showModal = (component: React.ComponentType<any>, props: any) => { showModal = (component: React.ComponentType<any>, props: any) => {
this.setState({ this.setState({
component, component,
props props,
}); });
}; };

View File

@@ -281,7 +281,9 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
border-color: ${red}; border-color: ${red};
border-radius: 2px; border-radius: 2px;
outline-offset: 2px; outline-offset: 2px;
box-shadow: 0 0 0 2px ${theme.colors.bg1}, 0 0 0px 4px ${red}; box-shadow:
0 0 0 2px ${theme.colors.bg1},
0 0 0px 4px ${red};
`, `,
inputHint: css` inputHint: css`
display: inherit; display: inherit;

View File

@@ -180,7 +180,9 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
border-color: ${red}; border-color: ${red};
border-radius: 2px; border-radius: 2px;
outline-offset: 2px; outline-offset: 2px;
box-shadow: 0 0 0 2px ${theme.colors.bg1}, 0 0 0px 4px ${red}; box-shadow:
0 0 0 2px ${theme.colors.bg1},
0 0 0px 4px ${red};
`, `,
scriptCommandContainer: css` scriptCommandContainer: css`
margin-bottom: ${theme.spacing.md}; margin-bottom: ${theme.spacing.md};