diff --git a/app/soapbox/components/showable_password.tsx b/app/soapbox/components/showable_password.tsx deleted file mode 100644 index 7d7858fdc..000000000 --- a/app/soapbox/components/showable_password.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import classNames from 'classnames'; -import React, { useState } from 'react'; -import { defineMessages, useIntl } from 'react-intl'; - -import IconButton from 'soapbox/components/icon_button'; -import { InputContainer, LabelInputContainer } from 'soapbox/features/forms'; - -const messages = defineMessages({ - showPassword: { id: 'forms.show_password', defaultMessage: 'Show password' }, - hidePassword: { id: 'forms.hide_password', defaultMessage: 'Hide password' }, -}); - -interface IShowablePassword { - label?: React.ReactNode, - className?: string, - hint?: React.ReactNode, - placeholder?: string, - error?: boolean, - onToggleVisibility?: () => void, - autoComplete?: string, - autoCorrect?: string, - autoCapitalize?: string, - name?: string, - required?: boolean, - onChange?: React.ChangeEventHandler, - onBlur?: React.ChangeEventHandler, - value?: string, -} - -const ShowablePassword: React.FC = (props) => { - const intl = useIntl(); - const [revealed, setRevealed] = useState(false); - - const { hint, error, label, className, ...rest } = props; - - const toggleReveal = () => { - if (props.onToggleVisibility) { - props.onToggleVisibility(); - } else { - setRevealed(!revealed); - } - }; - - const revealButton = ( - - ); - - return ( - - {label ? ( - - - {revealButton} - - ) : (<> - - {revealButton} - )} - - ); -}; - -export default ShowablePassword;