-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
Binary file modified
BIN
+3.62 KB
(100%)
...ents_Datatable_internalComponents_Datatable_With Open And Applied Filtering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.32 KB
(110%)
.storybook/image-snapshots/expected/components_Filters_Fetching Results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.16 KB
(110%)
.storybook/image-snapshots/expected/components_Filters_Unapplied Filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.31 KB
(110%)
.storybook/image-snapshots/expected/components_Filters_With Close Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.13 KB
(110%)
.storybook/image-snapshots/expected/components_Filters_With Fixed Operator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.3 KB
(110%)
.storybook/image-snapshots/expected/components_Filters_With State.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.34 KB
(110%)
.storybook/image-snapshots/expected/components_Filters_Without Apply Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { useState } from 'react'; | ||
import { always } from 'ramda'; | ||
|
||
import { SpaceSizes } from '../../../theme'; | ||
import { Inline, Padbox } from '../../layout'; | ||
import { InputFilter, SelectFilter } from '../components'; | ||
|
||
type MockObject = { | ||
inputValue: string; | ||
includeAssets: string[]; | ||
}; | ||
|
||
interface MockObjectFilterProps { | ||
value: MockObject; | ||
} | ||
|
||
const MockObjectFilter: React.FC<MockObjectFilterProps> = ({ value }) => { | ||
const [ipValue, setIpValue] = useState(value?.inputValue); | ||
const options = [ | ||
{ | ||
label: 'Include associated subdomains', | ||
value: 'include_domains', | ||
}, | ||
{ | ||
label: 'Include associated IPs', | ||
value: 'include_ips', | ||
}, | ||
]; | ||
|
||
const handleOnChange = (event) => { | ||
const { target } = event; | ||
setIpValue(target.value); | ||
}; | ||
const validate = always(false); | ||
const handleOnError = () => { | ||
// do nothing | ||
}; | ||
|
||
return ( | ||
<Padbox> | ||
<Inline gap={SpaceSizes.sm} stretch="all"> | ||
<InputFilter | ||
placeholder="IP" | ||
value={ipValue} | ||
onChange={handleOnChange} | ||
onError={handleOnError} | ||
onValidate={validate} | ||
/> | ||
<SelectFilter options={options} isMulti /> | ||
</Inline> | ||
</Padbox> | ||
); | ||
}; | ||
export default MockObjectFilter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters