Skip to content

Commit feb78da

Browse files
committed
Simplify interception target list types
1 parent 150ca89 commit feb78da

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/components/intercept/config/docker-attach-config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DockerAttachConfig extends React.Component<{
101101
Pick a container to restart it with all traffic intercepted:
102102
</p>
103103

104-
<InterceptionTargetList<string>
104+
<InterceptionTargetList
105105
spinnerText='Looking for Docker containers to intercept...'
106106
interceptTarget={this.interceptTarget}
107107
ellipseDirection='right'

src/components/intercept/config/intercept-target-list.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ const TargetText = styled.span<{ ellipseDirection: 'left' | 'right' }>`
8888
: ''}
8989
`;
9090

91-
type TargetItem<Id> = {
92-
id: Id,
91+
type TargetItem = {
92+
id: string,
9393
title: string,
9494
content: React.ReactNode,
9595
icon?: React.ReactNode,
9696
status: 'active' | 'available' | 'activating' | 'unavailable',
9797
};
9898

9999
@observer
100-
export class InterceptionTargetList<Id extends string | number> extends React.Component<{
100+
export class InterceptionTargetList extends React.Component<{
101101
spinnerText: string,
102-
targets: TargetItem<Id>[],
103-
interceptTarget: (id: Id) => void,
102+
targets: TargetItem[],
103+
interceptTarget: (id: string) => void,
104104
ellipseDirection: 'left' | 'right'
105105
}> {
106106

@@ -116,7 +116,7 @@ export class InterceptionTargetList<Id extends string | number> extends React.Co
116116

117117
return <ListScrollContainer>
118118
<TargetList>
119-
{ _.map(targets, (target: TargetItem<Id>) => <Target key={target.id}>
119+
{ _.map(targets, (target: TargetItem) => <Target key={target.id}>
120120
<TargetButton
121121
title={target.title}
122122
state={target.status}

src/components/intercept/config/jvm-config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class JvmConfig extends React.Component<{
5959
Pick which JVM process you'd like to intercept:
6060
</p>
6161

62-
<InterceptionTargetList<string>
62+
<InterceptionTargetList
6363
spinnerText='Looking for JVM processes to intercept...'
6464
interceptTarget={this.interceptTarget}
6565
ellipseDirection='left'

0 commit comments

Comments
 (0)