Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
geakstr committed Jul 24, 2023
1 parent 3692dfc commit 3c11e46
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 185 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
Expand Down
15 changes: 11 additions & 4 deletions src/blueprint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@
@import '~@blueprintjs/select/src/blueprint-select';
@import '~@blueprintjs/popover2/lib/css/blueprint-popover2.css';


@font-face{
font-family:'blueprint-icons-16';
src:url('./icons/blueprint/blueprint-icons-16.ttf?0c7462c47bcd60a8d9e9dc959711c752') format('truetype'), url('./icons/blueprint/blueprint-icons-16.eot?0c7462c47bcd60a8d9e9dc959711c752#iefix') format('embedded-opentype'), url('./icons/blueprint/blueprint-icons-16.woff2?0c7462c47bcd60a8d9e9dc959711c752') format('woff2'), url('./icons/blueprint/blueprint-icons-16.woff?0c7462c47bcd60a8d9e9dc959711c752') format('woff');
@font-face {
font-family: 'blueprint-icons-16';
src:
url('./icons/blueprint/blueprint-icons-16.ttf?0c7462c47bcd60a8d9e9dc959711c752')
format('truetype'),
url('./icons/blueprint/blueprint-icons-16.eot?0c7462c47bcd60a8d9e9dc959711c752#iefix')
format('embedded-opentype'),
url('./icons/blueprint/blueprint-icons-16.woff2?0c7462c47bcd60a8d9e9dc959711c752')
format('woff2'),
url('./icons/blueprint/blueprint-icons-16.woff?0c7462c47bcd60a8d9e9dc959711c752')
format('woff');
}

.bp4-control {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArrowsRenderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ArrowRendererProps {
arrow: Arrow;
}

export type ArrowRenderer = (_: ArrowRendererProps) => JSX.Element | null;
export type ArrowRenderer = (_: ArrowRendererProps) => React.ReactNode | null;

export interface Props {
strategy: ArrowStrategy;
Expand Down
1 change: 0 additions & 1 deletion src/components/EndpointCardHeader/logos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ export const grafana = 'icons/logos/grafana-logo.svg';
export const loki = 'icons/logos/loki-logo.svg';
export const tempo = 'icons/logos/tempo-logo.svg';
export const mimir = 'icons/logos/mimir-logo.svg';

72 changes: 36 additions & 36 deletions src/components/FlowsTable/SidebarComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,24 @@ export interface IPItemProps {
onClick?: () => void;
}

export const IPEntry = memo<IPItemProps>(function FlowsTableSidebarIPEntry(
props,
) {
const onClick = useCallback(() => {
props.onClick?.();
}, [props.onClick]);

const className = classnames(css.ip, {
[css.clickable]: !!props.onClick,
[css.selected]: props.isSelected,
});

return (
<span className={className} onClick={onClick}>
{props.ip}
</span>
);
});
export const IPEntry = memo<IPItemProps>(
function FlowsTableSidebarIPEntry(props) {
const onClick = useCallback(() => {
props.onClick?.();
}, [props.onClick]);

const className = classnames(css.ip, {
[css.clickable]: !!props.onClick,
[css.selected]: props.isSelected,
});

return (
<span className={className} onClick={onClick}>
{props.ip}
</span>
);
},
);

export interface DnsItemProps {
dns: string;
Expand Down Expand Up @@ -234,21 +234,21 @@ export interface PodItemProps {
onClick?: (_: PodSelector) => void;
}

export const PodEntry = memo<PodItemProps>(function FlowsTableSidebarPodEntry(
props,
) {
const onClick = useCallback(() => {
props.onClick?.(props.podSelector);
}, [props.podSelector, props.onClick]);

const className = classnames(css.podd, {
[css.clickable]: !!props.onClick,
[css.selected]: props.isSelected,
});

return (
<span className={className} onClick={onClick}>
{props.podSelector.pod}
</span>
);
});
export const PodEntry = memo<PodItemProps>(
function FlowsTableSidebarPodEntry(props) {
const onClick = useCallback(() => {
props.onClick?.(props.podSelector);
}, [props.podSelector, props.onClick]);

const className = classnames(css.podd, {
[css.clickable]: !!props.onClick,
[css.selected]: props.isSelected,
});

return (
<span className={className} onClick={onClick}>
{props.podSelector.pod}
</span>
);
},
);
62 changes: 31 additions & 31 deletions src/components/TopBar/TagDirection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ export interface TagDirectionProps {
direction: FilterDirection;
}

export const TagDirection = memo<TagDirectionProps>(function TagDirection(
props,
) {
const dir = props.direction;
const className = classnames(css.direction, {
[css.from]: dir === FilterDirection.From,
[css.to]: dir === FilterDirection.To,
[css.both]: dir === FilterDirection.Both,
});

const fromIsShown = [FilterDirection.From, FilterDirection.Both].includes(
dir,
);
const toIsShown = [FilterDirection.To, FilterDirection.Both].includes(dir);

const iconName =
dir === FilterDirection.Both ? 'arrows-horizontal' : 'arrow-right';

return (
<span className={className}>
{fromIsShown && (
<span className={classnames(css.label, css.from)}>from</span>
)}

<span className={css.icon}>
<Icon icon={iconName} iconSize={9} />
export const TagDirection = memo<TagDirectionProps>(
function TagDirection(props) {
const dir = props.direction;
const className = classnames(css.direction, {
[css.from]: dir === FilterDirection.From,
[css.to]: dir === FilterDirection.To,
[css.both]: dir === FilterDirection.Both,
});

const fromIsShown = [FilterDirection.From, FilterDirection.Both].includes(
dir,
);
const toIsShown = [FilterDirection.To, FilterDirection.Both].includes(dir);

const iconName =
dir === FilterDirection.Both ? 'arrows-horizontal' : 'arrow-right';

return (
<span className={className}>
{fromIsShown && (
<span className={classnames(css.label, css.from)}>from</span>
)}

<span className={css.icon}>
<Icon icon={iconName} iconSize={9} />
</span>

{toIsShown && <span className={classnames(css.label, css.to)}>to</span>}
</span>

{toIsShown && <span className={classnames(css.label, css.to)}>to</span>}
</span>
);
});
);
},
);
70 changes: 35 additions & 35 deletions src/components/TopBar/VerdictFilterDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,41 +40,41 @@ const filters: FilterOption[] = [
},
];

export const VerdictFilterDropdown = memo<Props>(function VerdictFilterDropdown(
props,
) {
const popover = usePopover();
export const VerdictFilterDropdown = memo<Props>(
function VerdictFilterDropdown(props) {
const popover = usePopover();

const getLabel = useCallback(() => {
const found = find(filters, f => f.verdict === props.verdict);
return found ? found.title : '';
}, [props.verdict]);
const getLabel = useCallback(() => {
const found = find(filters, f => f.verdict === props.verdict);
return found ? found.title : '';
}, [props.verdict]);

const content = (
<Menu>
{filters.map(filter => (
<MenuItem
key={String(filter.verdict)}
active={props.verdict == filter.verdict}
text={filter.title}
onClick={() => props.onSelect?.(filter.verdict)}
/>
))}
</Menu>
);
const content = (
<Menu>
{filters.map(filter => (
<MenuItem
key={String(filter.verdict)}
active={props.verdict == filter.verdict}
text={filter.title}
onClick={() => props.onSelect?.(filter.verdict)}
/>
))}
</Menu>
);

return (
<Popover {...popover.props} content={content}>
<FilterIcon
icon={<VerdictIcon />}
text={getLabel()}
onClick={popover.toggle}
className={classnames({
[css.verdictFilterDropped]: props.verdict === Verdict.Dropped,
[css.verdictFilterForwarded]: props.verdict === Verdict.Forwarded,
[css.verdictFilterAudit]: props.verdict === Verdict.Audit,
})}
/>
</Popover>
);
});
return (
<Popover {...popover.props} content={content}>
<FilterIcon
icon={<VerdictIcon />}
text={getLabel()}
onClick={popover.toggle}
className={classnames({
[css.verdictFilterDropped]: props.verdict === Verdict.Dropped,
[css.verdictFilterForwarded]: props.verdict === Verdict.Forwarded,
[css.verdictFilterAudit]: props.verdict === Verdict.Audit,
})}
/>
</Popover>
);
},
);
Loading

0 comments on commit 3c11e46

Please sign in to comment.