Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions containers/search/EncryptedSearchToggle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Toggle, useToggle } from 'react-components';

const EncryptedSearchToggle = ({ id }) => {
const { state, toggle } = useToggle(); // TODO set default
const handleChange = () => {
// TODO
toggle();
};
return <Toggle id={id} checked={state} onChange={handleChange} />;
};

EncryptedSearchToggle.propTypes = {
id: PropTypes.string
};

export default EncryptedSearchToggle;
18 changes: 18 additions & 0 deletions containers/search/ExactMatchToggle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Toggle, useToggle } from 'react-components';

const ExactMatchToggle = ({ id }) => {
const { state, toggle } = useToggle(); // TODO set default
const handleChange = () => {
// TODO
toggle();
};
return <Toggle id={id} checked={state} onChange={handleChange} />;
};

ExactMatchToggle.propTypes = {
id: PropTypes.string
};

export default ExactMatchToggle;
28 changes: 28 additions & 0 deletions containers/search/SearchSection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { c } from 'ttag';
import React from 'react';
import { SubTitle, Info, Row, Label } from 'react-components';

import ExactMatchToggle from './ExactMatchToggle';
import EncryptedSearchToggle from './EncryptedSearchToggle';

const SearchSection = () => {
return (
<>
<SubTitle>{c('Title').t`Search`}</SubTitle>
<Row>
<Label htmlFor="exactMatch">
{c('Label').t`Require exact match`} <Info url="TODO" />
</Label>
<ExactMatchToggle id="exactMatch" />
</Row>
<Row>
<Label htmlFor="encryptedSearch">
{c('Label').t`Encrypted search`} <Info url="TODO" />
</Label>
<EncryptedSearchToggle id="encryptedSearch" />
</Row>
</>
);
};

export default SearchSection;