You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
948 B
JavaScript
35 lines
948 B
JavaScript
import React, { useCallback } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { Radio, Tab } from 'semantic-ui-react';
|
|
|
|
import styles from './PreferencesPane.module.css';
|
|
|
|
const PreferencesPane = React.memo(({ subscribeToOwnCards, onUpdate }) => {
|
|
const [t] = useTranslation();
|
|
|
|
const handleSubscribeToOwnCardsChange = useCallback(() => {
|
|
onUpdate({
|
|
subscribeToOwnCards: !subscribeToOwnCards,
|
|
});
|
|
}, [subscribeToOwnCards, onUpdate]);
|
|
|
|
return (
|
|
<Tab.Pane attached={false} className={styles.wrapper}>
|
|
<Radio
|
|
toggle
|
|
checked={subscribeToOwnCards}
|
|
label={t('common.subscribeToMyOwnCardsByDefault')}
|
|
onChange={handleSubscribeToOwnCardsChange}
|
|
/>
|
|
</Tab.Pane>
|
|
);
|
|
});
|
|
|
|
PreferencesPane.propTypes = {
|
|
subscribeToOwnCards: PropTypes.bool.isRequired,
|
|
onUpdate: PropTypes.func.isRequired,
|
|
};
|
|
|
|
export default PreferencesPane;
|