Feat(privacy): Add granular privacy controls of public profile (#17178)
* feat(privacy): Add granular privacy controls of public profile * feat(certs): Hide certs if showCerts is false
This commit is contained in:
committed by
Quincy Larson
parent
a1f2fc7c5c
commit
bb4bcbfb45
53
common/app/routes/Settings/components/ToggleSetting.jsx
Normal file
53
common/app/routes/Settings/components/ToggleSetting.jsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {
|
||||
Row,
|
||||
Col,
|
||||
ControlLabel
|
||||
} from 'react-bootstrap';
|
||||
|
||||
import TB from '../Toggle-Button';
|
||||
|
||||
const propTypes = {
|
||||
action: PropTypes.string.isRequired,
|
||||
explain: PropTypes.string,
|
||||
flag: PropTypes.bool.isRequired,
|
||||
flagName: PropTypes.string.isRequired,
|
||||
toggleFlag: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default function ToggleSetting({
|
||||
action,
|
||||
explain,
|
||||
flag,
|
||||
flagName,
|
||||
toggleFlag
|
||||
}) {
|
||||
return (
|
||||
<Row className='inline-form'>
|
||||
<Col sm={ 8 } xs={ 12 }>
|
||||
<ControlLabel htmlFor={ flagName }>
|
||||
<p>
|
||||
<strong>
|
||||
{ action }
|
||||
</strong>
|
||||
<br />
|
||||
{
|
||||
explain ? <em>{explain}</em> : null
|
||||
}
|
||||
</p>
|
||||
</ControlLabel>
|
||||
</Col>
|
||||
<Col sm={ 4 } xs={ 12 }>
|
||||
<TB
|
||||
name={ flagName }
|
||||
onChange={ toggleFlag }
|
||||
value={ flag }
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
ToggleSetting.displayName = 'ToggleSetting';
|
||||
ToggleSetting.propTypes = propTypes;
|
Reference in New Issue
Block a user