diff --git a/app/soapbox/components/radio.tsx b/app/soapbox/components/radio.tsx
new file mode 100644
index 0000000000..ef204b06f9
--- /dev/null
+++ b/app/soapbox/components/radio.tsx
@@ -0,0 +1,43 @@
+import React from 'react';
+
+import List, { ListItem } from './list';
+
+interface IRadioGroup {
+ onChange: React.ChangeEventHandler
+ children: React.ReactElement<{ onChange: React.ChangeEventHandler }>[]
+}
+
+const RadioGroup = ({ onChange, children }: IRadioGroup) => {
+ const childrenWithProps = React.Children.map(children, child =>
+ React.cloneElement(child, { onChange }),
+ );
+
+ return {childrenWithProps}
;
+};
+
+interface IRadioItem {
+ label: React.ReactNode,
+ hint?: React.ReactNode,
+ value: string,
+ checked: boolean,
+ onChange?: React.ChangeEventHandler,
+}
+
+const RadioItem: React.FC = ({ label, hint, checked = false, onChange, value }) => {
+ return (
+
+
+
+ );
+};
+
+export {
+ RadioGroup,
+ RadioItem,
+};
\ No newline at end of file
diff --git a/app/soapbox/features/admin/components/registration-mode-picker.tsx b/app/soapbox/features/admin/components/registration-mode-picker.tsx
index 2c830153a4..eab7f2f944 100644
--- a/app/soapbox/features/admin/components/registration-mode-picker.tsx
+++ b/app/soapbox/features/admin/components/registration-mode-picker.tsx
@@ -3,12 +3,7 @@ import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
import { updateConfig } from 'soapbox/actions/admin';
import snackbar from 'soapbox/actions/snackbar';
-import {
- SimpleForm,
- FieldsGroup,
- RadioGroup,
- RadioItem,
-} from 'soapbox/features/forms';
+import { RadioGroup, RadioItem } from 'soapbox/components/radio';
import { useAppDispatch, useInstance } from 'soapbox/hooks';
import type { Instance } from 'soapbox/types/entities';
@@ -54,33 +49,26 @@ const RegistrationModePicker: React.FC = () => {
};
return (
-
-
- }
- onChange={onChange}
- >
- }
- hint={}
- checked={mode === 'open'}
- value='open'
- />
- }
- hint={}
- checked={mode === 'approval'}
- value='approval'
- />
- }
- hint={}
- checked={mode === 'closed'}
- value='closed'
- />
-
-
-
+
+ }
+ hint={}
+ checked={mode === 'open'}
+ value='open'
+ />
+ }
+ hint={}
+ checked={mode === 'approval'}
+ value='approval'
+ />
+ }
+ hint={}
+ checked={mode === 'closed'}
+ value='closed'
+ />
+
);
};
diff --git a/app/soapbox/features/admin/tabs/dashboard.tsx b/app/soapbox/features/admin/tabs/dashboard.tsx
index 66037845e5..40e1bd4fb5 100644
--- a/app/soapbox/features/admin/tabs/dashboard.tsx
+++ b/app/soapbox/features/admin/tabs/dashboard.tsx
@@ -78,7 +78,15 @@ const Dashboard: React.FC = () => {
/>
- {account.admin && }
+ {account.admin && (
+ <>
+ }
+ />
+
+
+ >
+ )}
}
diff --git a/app/soapbox/features/forms/index.tsx b/app/soapbox/features/forms/index.tsx
index b4b13a503c..5d853e5810 100644
--- a/app/soapbox/features/forms/index.tsx
+++ b/app/soapbox/features/forms/index.tsx
@@ -1,8 +1,8 @@
import classNames from 'clsx';
-import React, { useState, useRef } from 'react';
+import React, { useState } from 'react';
import { v4 as uuidv4 } from 'uuid';
-import { Text, Select } from '../../components/ui';
+import { Select } from '../../components/ui';
interface IInputContainer {
label?: React.ReactNode,
@@ -175,52 +175,6 @@ export const Checkbox: React.FC = (props) => (
);
-interface IRadioGroup {
- label?: React.ReactNode,
- onChange?: React.ChangeEventHandler,
-}
-
-export const RadioGroup: React.FC = (props) => {
- const { label, children, onChange } = props;
-
- const childrenWithProps = React.Children.map(children, child =>
- // @ts-ignore
- React.cloneElement(child, { onChange }),
- );
-
- return (
-
- );
-};
-
-interface IRadioItem {
- label?: React.ReactNode,
- hint?: React.ReactNode,
- value: string,
- checked: boolean,
- onChange?: React.ChangeEventHandler,
-}
-
-export const RadioItem: React.FC = (props) => {
- const { current: id } = useRef(uuidv4());
- const { label, hint, checked = false, ...rest } = props;
-
- return (
-
-
-
- );
-};
-
interface ISelectDropdown {
label?: React.ReactNode,
hint?: React.ReactNode,