more cleanup

This commit is contained in:
gingervitis
2021-02-14 01:45:08 -08:00
parent d55e4dfe29
commit 682ddf96c3
8 changed files with 23 additions and 15 deletions

View File

@@ -196,7 +196,6 @@ export default function EditSocialLinks() {
return (
<div className="actions">
<Button
type="primary"
size="small"
onClick={() => {
setEditId(index);

View File

@@ -21,6 +21,7 @@ import {
import TextField from './form-textfield';
import FormStatusIndicator from './form-status-indicator';
import { isValidUrl } from '../../utils/urls';
import ToggleSwitch from './form-toggleswitch-with-submit';
// import ToggleSwitch from './form-toggleswitch-with-submit';
const { Panel } = Collapse;
@@ -145,20 +146,21 @@ export default function EditStorage() {
return (
<div className={containerClass}>
<div className="enable-switch">
{/* <ToggleSwitch
<ToggleSwitch
apiPath=""
fieldName="enabled"
label="Storage Enabled"
checked={formDataValues.enabled}
onChange={handleSwitchChange}
/> */}
<Switch
/>
{/* <Switch
checked={formDataValues.enabled}
defaultChecked={formDataValues.enabled}
onChange={handleSwitchChange}
checkedChildren="ON"
unCheckedChildren="OFF"
/>{' '}
Enabled
Enabled */}
</div>
<div className="form-fields">

View File

@@ -1,5 +1,6 @@
// This is a wrapper for the Ant Switch component.
// onChange of the switch, it will automatically post a change to the config api.
// This one is styled to match the form-textfield component.
// If `useSubmit` is true then it will automatically post to the config API onChange.
import React, { useState, useContext } from 'react';
import { Switch } from 'antd';
@@ -17,9 +18,9 @@ import { RESET_TIMEOUT, postConfigUpdateToAPI } from '../../utils/config-constan
import { ServerStatusContext } from '../../utils/server-status-context';
interface ToggleSwitchProps {
apiPath: string;
fieldName: string;
apiPath?: string;
checked?: boolean;
configPath?: string;
disabled?: boolean;
@@ -106,6 +107,7 @@ export default function ToggleSwitch(props: ToggleSwitchProps) {
}
ToggleSwitch.defaultProps = {
apiPath: '',
checked: false,
configPath: '',
disabled: false,

View File

@@ -153,7 +153,6 @@ export default function CurrentVariantsTable() {
return (
<span className="actions">
<Button
type="primary"
size="small"
onClick={() => {
setEditId(index);