Migrated settings module to TS

This commit is contained in:
Alejandro Celaya
2020-08-24 17:32:20 +02:00
parent 0b4a348969
commit fefa4e7848
7 changed files with 40 additions and 40 deletions

View File

@@ -0,0 +1,22 @@
import React from 'react';
import { Card, CardBody, CardHeader } from 'reactstrap';
import ToggleSwitch from '../utils/ToggleSwitch';
import { Settings } from './reducers/settings';
interface RealTimeUpdatesProps {
settings: Settings;
setRealTimeUpdates: (enabled: boolean) => void;
}
const RealTimeUpdates = ({ settings: { realTimeUpdates }, setRealTimeUpdates }: RealTimeUpdatesProps) => (
<Card>
<CardHeader>Real-time updates</CardHeader>
<CardBody>
<ToggleSwitch checked={realTimeUpdates.enabled} onChange={setRealTimeUpdates}>
Enable or disable real-time updates, when using Shlink v2.2.0 or newer.
</ToggleSwitch>
</CardBody>
</Card>
);
export default RealTimeUpdates;