|
|
|
|
@ -153,31 +153,42 @@ class FilterModal extends React.Component {
|
|
|
|
|
|
|
|
|
|
{this.renderSearchSelector()}
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
type="submit"
|
|
|
|
|
disabled={filterValue.trim().length === 0}
|
|
|
|
|
className="button mt-4 w-2/3 mx-auto"
|
|
|
|
|
>
|
|
|
|
|
{query.filters[selectedFilter] ? 'Update' : 'Add'} Filter
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{query.filters[selectedFilter] && (
|
|
|
|
|
<div className="mt-6 flex items-center justify-start">
|
|
|
|
|
<button
|
|
|
|
|
className="button mt-8 px-4 mx-auto flex bg-red-500 dark:bg-red-500 hover:bg-red-600 dark:hover:bg-red-700 items-center"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
this.selectFilterAndCloseModal(selectedFilter, null)
|
|
|
|
|
}}
|
|
|
|
|
type="submit"
|
|
|
|
|
disabled={filterValue.trim().length === 0}
|
|
|
|
|
className="button"
|
|
|
|
|
>
|
|
|
|
|
<svg className="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg>
|
|
|
|
|
Remove Filter
|
|
|
|
|
{query.filters[selectedFilter] ? 'Update' : 'Add'} Filter
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{query.filters[selectedFilter] && (
|
|
|
|
|
<button
|
|
|
|
|
className="ml-2 button px-4 flex bg-red-500 dark:bg-red-500 hover:bg-red-600 dark:hover:bg-red-700 items-center"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
this.selectFilterAndCloseModal(selectedFilter, null)
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<svg className="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg>
|
|
|
|
|
Remove
|
|
|
|
|
</button>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
{this.renderHints()}
|
|
|
|
|
</main>
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderHints() {
|
|
|
|
|
if (['page', 'entry_page', 'exit_page'].includes(this.state.selectedFilter)) {
|
|
|
|
|
return (
|
|
|
|
|
<p className="mt-6 text-xs text-gray-500">Hint: You can use double asterisks to match any character e.g. /blog**</p>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<Modal site={this.props.site} maxWidth="460px">
|
|
|
|
|
|