From 5ab28bb60ef87ab42ff9c784ae394c10d48f7d6e Mon Sep 17 00:00:00 2001 From: William Grant Date: Fri, 16 Sep 2022 13:43:49 +1000 Subject: [PATCH] refactor: rename SessionButton2 to SessionButton and remove old version --- ts/components/DebugLogView.tsx | 4 +- ts/components/SessionPasswordPrompt.tsx | 10 +- ts/components/SessionWrapperModal.tsx | 10 +- ts/components/basic/SessionButton.tsx | 141 ++++++++++++--- ts/components/basic/SessionButton2.tsx | 165 ------------------ ts/components/calling/IncomingCallDialog.tsx | 6 +- .../conversation/ConversationHeader.tsx | 8 +- .../ConversationRequestButtons.tsx | 6 +- ts/components/conversation/H5AudioPlayer.tsx | 4 +- .../conversation/SessionConversation.tsx | 2 +- .../conversation/SessionRightPanel.tsx | 4 +- .../message-content/ClickToTrustSender.tsx | 2 +- .../dialog/AdminLeaveClosedGroupDialog.tsx | 6 +- ts/components/dialog/BanOrUnbanUserDialog.tsx | 6 +- ts/components/dialog/DeleteAccountModal.tsx | 10 +- ts/components/dialog/EditProfileDialog.tsx | 6 +- ts/components/dialog/InviteContactsDialog.tsx | 6 +- ts/components/dialog/ModeratorsAddDialog.tsx | 4 +- .../dialog/ModeratorsRemoveDialog.tsx | 6 +- ts/components/dialog/ReactClearAllModal.tsx | 6 +- ts/components/dialog/ReactListModal.tsx | 4 +- ts/components/dialog/SessionConfirm.tsx | 6 +- ts/components/dialog/SessionModal.tsx | 2 +- .../dialog/SessionNicknameDialog.tsx | 6 +- .../dialog/SessionPasswordDialog.tsx | 6 +- ts/components/dialog/SessionSeedModal.tsx | 8 +- .../dialog/UpdateGroupMembersDialog.tsx | 6 +- .../dialog/UpdateGroupNameDialog.tsx | 6 +- ts/components/dialog/UserDetailsDialog.tsx | 6 +- .../leftpane/LeftPaneSectionHeader.tsx | 4 +- .../leftpane/overlay/OverlayClosedGroup.tsx | 4 +- .../leftpane/overlay/OverlayCommunity.tsx | 4 +- .../leftpane/overlay/OverlayMessage.tsx | 4 +- .../overlay/OverlayMessageRequest.tsx | 4 +- ts/components/menu/Menu.tsx | 2 +- ts/components/registration/SignInTab.tsx | 8 +- ts/components/registration/SignUpTab.tsx | 8 +- ts/components/settings/BlockedList.tsx | 4 +- .../SessionNotificationGroupSettings.tsx | 4 +- .../settings/SessionSettingListItem.tsx | 6 +- ts/components/settings/SessionSettings.tsx | 4 +- .../settings/section/CategoryHelp.tsx | 2 +- .../settings/section/CategoryPermissions.tsx | 2 +- .../settings/section/CategoryPrivacy.tsx | 2 +- ts/interactions/conversationInteractions.ts | 2 +- .../conversations/unsendingInteractions.ts | 2 +- 46 files changed, 228 insertions(+), 300 deletions(-) delete mode 100644 ts/components/basic/SessionButton2.tsx diff --git a/ts/components/DebugLogView.tsx b/ts/components/DebugLogView.tsx index 928d2bf7d..7d85c928c 100644 --- a/ts/components/DebugLogView.tsx +++ b/ts/components/DebugLogView.tsx @@ -6,7 +6,7 @@ import { switchHtmlToLightTheme, } from '../themes/SessionTheme'; import { fetch } from '../util/logging'; -import { SessionButton2, SessionButtonType } from './basic/SessionButton2'; +import { SessionButton, SessionButtonType } from './basic/SessionButton'; const StyledContent = styled.div` background-color: var(--color-modal-background); @@ -50,7 +50,7 @@ const DebugLogTextArea = (props: { content: string }) => { const DebugLogButtons = (props: { content: string }) => { return (
- { diff --git a/ts/components/SessionPasswordPrompt.tsx b/ts/components/SessionPasswordPrompt.tsx index 782218e8e..40055805b 100644 --- a/ts/components/SessionPasswordPrompt.tsx +++ b/ts/components/SessionPasswordPrompt.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import { SessionIcon } from './icon'; import { withTheme } from 'styled-components'; import autoBind from 'auto-bind'; -import { SessionButton2, SessionButtonColor } from './basic/SessionButton2'; +import { SessionButton, SessionButtonColor } from './basic/SessionButton'; import { Constants } from '../session'; import { SessionSpinner } from './basic/SessionSpinner'; @@ -172,14 +172,14 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> { return (
- {showResetElements && ( <> - { private renderClearDataViewButtons(): JSX.Element { return (
- - { this.setState({ clearDataView: false }); diff --git a/ts/components/SessionWrapperModal.tsx b/ts/components/SessionWrapperModal.tsx index f418476ff..c75e28edb 100644 --- a/ts/components/SessionWrapperModal.tsx +++ b/ts/components/SessionWrapperModal.tsx @@ -5,7 +5,7 @@ import { SessionIconButton } from './icon/'; // tslint:disable-next-line: no-submodule-imports import useKey from 'react-use/lib/useKey'; -import { SessionButton2, SessionButtonColor, SessionButtonType } from './basic/SessionButton2'; +import { SessionButton, SessionButtonColor, SessionButtonType } from './basic/SessionButton'; export type SessionWrapperModalType = { title?: string; @@ -114,18 +114,18 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => {
{onConfirm ? ( - + {confirmText || window.i18n('ok')} - + ) : null} {onClose && showClose ? ( - {cancelText || window.i18n('close')} - + ) : null}
diff --git a/ts/components/basic/SessionButton.tsx b/ts/components/basic/SessionButton.tsx index dd66e0b49..e737fc6a9 100644 --- a/ts/components/basic/SessionButton.tsx +++ b/ts/components/basic/SessionButton.tsx @@ -1,32 +1,114 @@ import React, { ReactNode } from 'react'; import classNames from 'classnames'; +import styled from 'styled-components'; export enum SessionButtonType { - Brand = 'brand', - BrandOutline = 'brand-outline', - Default = 'default', - DefaultOutline = 'default-outline', - Square = 'square', - SquareOutline = 'square-outline', + Outline = 'outline', Simple = 'simple', + Solid = 'solid', } +export enum SessionButtonShape { + Round = 'round', + Square = 'square', +} + +// NOTE References ts/themes/colors.tsx export enum SessionButtonColor { Green = 'green', + Blue = 'blue', + Yellow = 'yellow', + Pink = 'pink', + Purple = 'purple', + Orange = 'orange', + Red = 'red', White = 'white', Primary = 'primary', - Secondary = 'secondary', - Success = 'success', Danger = 'danger', - Warning = 'warning', - None = '', + None = 'transparent', } +const StyledButton = styled.div<{ + color: string | undefined; + buttonType: SessionButtonType; + buttonShape: SessionButtonShape; +}>` + width: auto; + display: flex; + justify-content: center; + align-items: center; + font-size: var(--font-size-md); + font-weight: 700; + user-select: none; + white-space: nowrap; + cursor: pointer; + transition: var(--default-duration); + background-repeat: no-repeat; + overflow: hidden; + height: 34px; + padding: 0px 18px; + background-color: ${props => + props.buttonType === SessionButtonType.Solid && props.color + ? `var(--${props.color}-color)` + : `var(--button-${props.buttonType}-background-color)`}; + color: ${props => + props.color + ? props.buttonType !== SessionButtonType.Solid + ? `var(--${props.color}-color)` + : 'var(--white-color)' + : `var(--button-${props.buttonType}-text-color)`}; + ${props => + props.buttonType === SessionButtonType.Outline && + `outline: none; border: 1px solid ${ + props.color ? `var(--${props.color}-color)` : 'var(--button-outline-border-color)' + }`}; + ${props => + props.buttonType === SessionButtonType.Solid && + 'box-shadow: 0px 0px 6px var(--button-solid-shadow-color);'} + border-radius: ${props => (props.buttonShape === SessionButtonShape.Round ? '17px' : '6px')}; + + .session-icon { + fill: var(--background-primary-color); + } + + & > *:hover:not(svg) { + filter: brightness(80%); + } + + &.disabled { + cursor: not-allowed; + outline: none; + ${props => + props.buttonType === SessionButtonType.Solid + ? 'background-color: var(--button-solid-disabled-color)' + : props.buttonType === SessionButtonType.Outline + ? 'border: 1px solid var(--button-outline-disabled-color)' + : ''}; + color: ${props => + props.buttonType === SessionButtonType.Solid + ? 'var(--button-solid-text-color)' + : `var(--button-${props.buttonType}-disabled-color)`}; + } + + &:not(.disabled) { + &:hover { + ${props => + props.buttonType && + `background-color: var(--button-${props.buttonType}-background-hover-color);`}; + ${props => props.color && `color: var(--button-${props.buttonType}-text-color);`} + ${props => + props.buttonType === SessionButtonType.Outline && + 'outline: none; border: 1px solid var(--button-outline-border-hover-color);'}; + } + } +`; + type Props = { text?: string; disabled?: boolean; buttonType: SessionButtonType; - buttonColor: SessionButtonColor; + buttonShape: SessionButtonShape; + buttonColor?: SessionButtonColor; // will override theme onClick: any; children?: ReactNode; margin?: string; @@ -34,7 +116,16 @@ type Props = { }; export const SessionButton = (props: Props) => { - const { buttonType, dataTestId, buttonColor, text, disabled, onClick, margin } = props; + const { + buttonType, + buttonShape, + dataTestId, + buttonColor, + text, + disabled, + onClick, + margin, + } = props; const clickHandler = (e: any) => { if (onClick) { @@ -42,31 +133,33 @@ export const SessionButton = (props: Props) => { onClick(); } }; - - const buttonTypes = []; const onClickFn = disabled ? () => null : clickHandler; - buttonTypes.push(buttonType); - if (buttonType.includes('-outline')) { - buttonTypes.push(buttonType.replace('-outline', '')); - } - return ( -
{props.children || text} -
+ ); }; SessionButton.defaultProps = { disabled: false, - buttonType: SessionButtonType.Default, - buttonColor: SessionButtonColor.Primary, + buttonShape: SessionButtonShape.Round, + buttonType: SessionButtonType.Outline, onClick: null, } as Partial; diff --git a/ts/components/basic/SessionButton2.tsx b/ts/components/basic/SessionButton2.tsx deleted file mode 100644 index af74b7c9c..000000000 --- a/ts/components/basic/SessionButton2.tsx +++ /dev/null @@ -1,165 +0,0 @@ -import React, { ReactNode } from 'react'; -import classNames from 'classnames'; -import styled from 'styled-components'; - -export enum SessionButtonType { - Outline = 'outline', - Simple = 'simple', - Solid = 'solid', -} - -export enum SessionButtonShape { - Round = 'round', - Square = 'square', -} - -// NOTE References ts/themes/colors.tsx -export enum SessionButtonColor { - Green = 'green', - Blue = 'blue', - Yellow = 'yellow', - Pink = 'pink', - Purple = 'purple', - Orange = 'orange', - Red = 'red', - White = 'white', - Primary = 'primary', - Danger = 'danger', - None = 'transparent', -} - -const StyledButton = styled.div<{ - color: string | undefined; - buttonType: SessionButtonType; - buttonShape: SessionButtonShape; -}>` - width: auto; - display: flex; - justify-content: center; - align-items: center; - font-size: var(--font-size-md); - font-weight: 700; - user-select: none; - white-space: nowrap; - cursor: pointer; - transition: var(--default-duration); - background-repeat: no-repeat; - overflow: hidden; - height: 34px; - padding: 0px 18px; - background-color: ${props => - props.buttonType === SessionButtonType.Solid && props.color - ? `var(--${props.color}-color)` - : `var(--button-${props.buttonType}-background-color)`}; - color: ${props => - props.color - ? props.buttonType !== SessionButtonType.Solid - ? `var(--${props.color}-color)` - : 'var(--white-color)' - : `var(--button-${props.buttonType}-text-color)`}; - ${props => - props.buttonType === SessionButtonType.Outline && - `outline: none; border: 1px solid ${ - props.color ? `var(--${props.color}-color)` : 'var(--button-outline-border-color)' - }`}; - ${props => - props.buttonType === SessionButtonType.Solid && - 'box-shadow: 0px 0px 6px var(--button-solid-shadow-color);'} - border-radius: ${props => (props.buttonShape === SessionButtonShape.Round ? '17px' : '6px')}; - - .session-icon { - fill: var(--background-primary-color); - } - - & > *:hover:not(svg) { - filter: brightness(80%); - } - - &.disabled { - cursor: not-allowed; - outline: none; - ${props => - props.buttonType === SessionButtonType.Solid - ? 'background-color: var(--button-solid-disabled-color)' - : props.buttonType === SessionButtonType.Outline - ? 'border: 1px solid var(--button-outline-disabled-color)' - : ''}; - color: ${props => - props.buttonType === SessionButtonType.Solid - ? 'var(--button-solid-text-color)' - : `var(--button-${props.buttonType}-disabled-color)`}; - } - - &:not(.disabled) { - &:hover { - ${props => - props.buttonType && - `background-color: var(--button-${props.buttonType}-background-hover-color);`}; - ${props => props.color && `color: var(--button-${props.buttonType}-text-color);`} - ${props => - props.buttonType === SessionButtonType.Outline && - 'outline: none; border: 1px solid var(--button-outline-border-hover-color);'}; - } - } -`; - -type Props = { - text?: string; - disabled?: boolean; - buttonType: SessionButtonType; - buttonShape: SessionButtonShape; - buttonColor?: SessionButtonColor; // will override theme - onClick: any; - children?: ReactNode; - margin?: string; - dataTestId?: string; -}; - -export const SessionButton2 = (props: Props) => { - const { - buttonType, - buttonShape, - dataTestId, - buttonColor, - text, - disabled, - onClick, - margin, - } = props; - - const clickHandler = (e: any) => { - if (onClick) { - e.stopPropagation(); - onClick(); - } - }; - const onClickFn = disabled ? () => null : clickHandler; - - return ( - - {props.children || text} - - ); -}; - -SessionButton2.defaultProps = { - disabled: false, - buttonShape: SessionButtonShape.Round, - buttonType: SessionButtonType.Outline, - onClick: null, -} as Partial; diff --git a/ts/components/calling/IncomingCallDialog.tsx b/ts/components/calling/IncomingCallDialog.tsx index 62c32f08e..d47169c59 100644 --- a/ts/components/calling/IncomingCallDialog.tsx +++ b/ts/components/calling/IncomingCallDialog.tsx @@ -8,7 +8,7 @@ import { CallManager } from '../../session/utils'; import { callTimeoutMs } from '../../session/utils/calling/CallManager'; import { getHasIncomingCall, getHasIncomingCallFrom } from '../../state/selectors/call'; import { Avatar, AvatarSize } from '../avatar/Avatar'; -import { SessionButton2, SessionButtonColor, SessionButtonType } from '../basic/SessionButton2'; +import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/SessionButton'; import { SessionWrapperModal } from '../SessionWrapperModal'; export const CallWindow = styled.div` @@ -79,12 +79,12 @@ export const IncomingCallDialog = () => {
- - {
{!isOnlyServerDeletable && ( - { onClick={onDeleteSelectedMessages} /> )} - { declineConversationWithConfirm(convoId, true); @@ -41,7 +41,7 @@ export const ConversationMessageRequestButtons = () => { return ( - { await handleAcceptConversationRequest(selectedConversation.id); @@ -49,7 +49,7 @@ export const ConversationMessageRequestButtons = () => { text={window.i18n('accept')} dataTestId="accept-message-request" /> - { diff --git a/ts/components/conversation/H5AudioPlayer.tsx b/ts/components/conversation/H5AudioPlayer.tsx index 52de95f2d..f3a55a4f9 100644 --- a/ts/components/conversation/H5AudioPlayer.tsx +++ b/ts/components/conversation/H5AudioPlayer.tsx @@ -11,7 +11,7 @@ import { isMessageSelectionMode, } from '../../state/selectors/conversations'; import { getAudioAutoplay } from '../../state/selectors/userConfig'; -import { SessionButton2, SessionButtonType } from '../basic/SessionButton2'; +import { SessionButton, SessionButtonType } from '../basic/SessionButton'; import { SessionIcon } from '../icon'; const StyledSpeedButton = styled.div` @@ -118,7 +118,7 @@ export const AudioPlayerWithEncryptedFile = (props: { customControlsSection={[ RHAP_UI.MAIN_CONTROLS, - { setPlaybackSpeed(playbackSpeed === 1 ? 1.5 : 1); diff --git a/ts/components/conversation/SessionConversation.tsx b/ts/components/conversation/SessionConversation.tsx index 6301f2b32..97ae138db 100644 --- a/ts/components/conversation/SessionConversation.tsx +++ b/ts/components/conversation/SessionConversation.tsx @@ -38,7 +38,7 @@ import { addStagedAttachmentsInConversation } from '../../state/ducks/stagedAtta import { MIME } from '../../types'; import { AttachmentTypeWithPath } from '../../types/Attachment'; import { arrayBufferToObjectURL, AttachmentUtil, GoogleChrome } from '../../util'; -import { SessionButtonColor } from '../basic/SessionButton2'; +import { SessionButtonColor } from '../basic/SessionButton'; import { MessageView } from '../MainViewController'; import { ConversationHeaderWithDetails } from './ConversationHeader'; import { MessageDetail } from './message/message-item/MessageDetail'; diff --git a/ts/components/conversation/SessionRightPanel.tsx b/ts/components/conversation/SessionRightPanel.tsx index dc760504d..e06146910 100644 --- a/ts/components/conversation/SessionRightPanel.tsx +++ b/ts/components/conversation/SessionRightPanel.tsx @@ -21,7 +21,7 @@ import { getSelectedConversation, isRightPanelShowing } from '../../state/select import { getTimerOptions } from '../../state/selectors/timerOptions'; import { AttachmentTypeWithPath } from '../../types/Attachment'; import { Avatar, AvatarSize } from '../avatar/Avatar'; -import { SessionButton2, SessionButtonColor, SessionButtonType } from '../basic/SessionButton2'; +import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/SessionButton'; import { SessionDropdown } from '../basic/SessionDropdown'; import { SpacerLG } from '../basic/Text'; import { MediaItemType } from '../lightbox/LightboxGallery'; @@ -323,7 +323,7 @@ export const SessionRightPanelWithDetails = () => { {isGroup && ( // tslint:disable-next-line: use-simple-attributes - {

{warningAsAdmin}

- - - - { />
- { disabled={deleteEverythingWithNetwork || deleteDeviceOnly} /> - { @@ -230,7 +230,7 @@ export const DeleteAccountModal = () => { {(deleteDeviceOnly || deleteEverythingWithNetwork) && (
- { disabled={isLoading} /> - { diff --git a/ts/components/dialog/EditProfileDialog.tsx b/ts/components/dialog/EditProfileDialog.tsx index 6f95ec841..0633af4ff 100644 --- a/ts/components/dialog/EditProfileDialog.tsx +++ b/ts/components/dialog/EditProfileDialog.tsx @@ -12,7 +12,7 @@ import { getConversationController } from '../../session/conversations'; import autoBind from 'auto-bind'; import { editProfileModal } from '../../state/ducks/modalDialog'; import { uploadOurAvatar } from '../../interactions/conversationInteractions'; -import { SessionButton2, SessionButtonType } from '../basic/SessionButton2'; +import { SessionButton, SessionButtonType } from '../basic/SessionButton'; import { SessionSpinner } from '../basic/SessionSpinner'; import { SessionIconButton } from '../icon'; import { MAX_USERNAME_LENGTH } from '../registration/RegistrationStages'; @@ -108,7 +108,7 @@ export class EditProfileDialog extends React.Component<{}, State> { {viewDefault || viewQR ? ( - { @@ -119,7 +119,7 @@ export class EditProfileDialog extends React.Component<{}, State> { /> ) : ( !this.state.loading && ( - {
- - { value={inputBoxValue} autoFocus={true} /> - { )}
- - { >

{window.i18n('clearAllReactions', [reaction])}

- - { )}

{isPublic && weAreModerator && ( - {
- { dataTestId="session-confirm-ok-button" /> {!hideCancel && ( - { />
- - { {this.showError()}
- - {
- - {
- { diff --git a/ts/components/dialog/UpdateGroupMembersDialog.tsx b/ts/components/dialog/UpdateGroupMembersDialog.tsx index 2ffa63e14..e6ed6929a 100644 --- a/ts/components/dialog/UpdateGroupMembersDialog.tsx +++ b/ts/components/dialog/UpdateGroupMembersDialog.tsx @@ -5,7 +5,7 @@ import { ToastUtils, UserUtils } from '../../session/utils'; import _ from 'lodash'; import { SpacerLG, Text } from '../basic/Text'; import { updateGroupMembersModal } from '../../state/ducks/modalDialog'; -import { SessionButton2, SessionButtonColor, SessionButtonType } from '../basic/SessionButton2'; +import { SessionButton, SessionButtonColor, SessionButtonType } from '../basic/SessionButton'; import { MemberListItem } from '../MemberListItem'; import { SessionWrapperModal } from '../SessionWrapperModal'; import { useDispatch } from 'react-redux'; @@ -244,9 +244,9 @@ export const UpdateGroupMembersDialog = (props: Props) => {
{weAreAdmin && ( - + )} - { ) : null}
- - {
- - { diff --git a/ts/components/leftpane/LeftPaneSectionHeader.tsx b/ts/components/leftpane/LeftPaneSectionHeader.tsx index b2b25c1f5..6b943ca4e 100644 --- a/ts/components/leftpane/LeftPaneSectionHeader.tsx +++ b/ts/components/leftpane/LeftPaneSectionHeader.tsx @@ -7,7 +7,7 @@ import { recoveryPhraseModal } from '../../state/ducks/modalDialog'; import { Flex } from '../basic/Flex'; import { getFocusedSection, getOverlayMode } from '../../state/selectors/section'; import { SectionType } from '../../state/ducks/section'; -import { SessionButton2 } from '../basic/SessionButton2'; +import { SessionButton } from '../basic/SessionButton'; import { isSignWithRecoveryPhrase } from '../../util/storage'; import { MenuButton } from '../button/MenuButton'; @@ -74,7 +74,7 @@ const BannerInner = () => { return (

{window.i18n('recoveryPhraseRevealMessage')}

- { - { />
- + diff --git a/ts/components/leftpane/overlay/OverlayMessage.tsx b/ts/components/leftpane/overlay/OverlayMessage.tsx index 92536dde1..f969b79bb 100644 --- a/ts/components/leftpane/overlay/OverlayMessage.tsx +++ b/ts/components/leftpane/overlay/OverlayMessage.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; // tslint:disable: use-simple-attributes no-submodule-imports import { useDispatch } from 'react-redux'; -import { SessionButton2 } from '../../basic/SessionButton2'; +import { SessionButton } from '../../basic/SessionButton'; import { SessionIdEditable } from '../../basic/SessionIdEditable'; import { SessionSpinner } from '../../basic/SessionSpinner'; import { OverlayHeader } from './OverlayHeader'; @@ -127,7 +127,7 @@ export const OverlayMessage = () => { - { <> - { diff --git a/ts/components/menu/Menu.tsx b/ts/components/menu/Menu.tsx index fc7c7f1d7..6c0fc05cc 100644 --- a/ts/components/menu/Menu.tsx +++ b/ts/components/menu/Menu.tsx @@ -52,7 +52,7 @@ import { hideMessageRequestBanner } from '../../state/ducks/userConfig'; import { getFocusedSection } from '../../state/selectors/section'; import { getTimerOptions } from '../../state/selectors/timerOptions'; import { LocalizerKeys } from '../../types/LocalizerKeys'; -import { SessionButtonColor } from '../basic/SessionButton2'; +import { SessionButtonColor } from '../basic/SessionButton'; import { ContextConversationId } from '../leftpane/conversation-list-item/ConversationListItem'; function showTimerOptions( diff --git a/ts/components/registration/SignInTab.tsx b/ts/components/registration/SignInTab.tsx index 472eae03e..70cd670fd 100644 --- a/ts/components/registration/SignInTab.tsx +++ b/ts/components/registration/SignInTab.tsx @@ -1,7 +1,7 @@ import React, { useContext, useState } from 'react'; import { sanitizeSessionUsername } from '../../session/utils/String'; import { Flex } from '../basic/Flex'; -import { SessionButton2 } from '../basic/SessionButton2'; +import { SessionButton } from '../basic/SessionButton'; import { SessionSpinner } from '../basic/SessionSpinner'; import { SpacerLG } from '../basic/Text'; import { @@ -24,7 +24,7 @@ export enum SignInMode { const LinkDeviceButton = (props: { onLinkDeviceButtonClicked: () => any }) => { return ( - any }) => { const RestoreUsingRecoveryPhraseButton = (props: { onRecoveryButtonClicked: () => any }) => { return ( - { return ( - { - return ; + return ; }; const ContinueSignUpButton = ({ continueSignUp }: { continueSignUp: any }) => { - return ; + return ; }; const SignUpDefault = (props: { createSessionID: () => void }) => { @@ -137,7 +137,7 @@ export const SignUpTab = () => { }} stealAutoFocus={true} /> - { ) : ( {hasAtLeastOneSelected && expanded ? ( - - + ) : null} diff --git a/ts/components/settings/SessionSettingListItem.tsx b/ts/components/settings/SessionSettingListItem.tsx index c48f93b62..a6ed9f0ad 100644 --- a/ts/components/settings/SessionSettingListItem.tsx +++ b/ts/components/settings/SessionSettingListItem.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { - SessionButton2, + SessionButton, SessionButtonColor, SessionButtonShape, SessionButtonType, -} from '../basic/SessionButton2'; +} from '../basic/SessionButton'; import { SessionToggle } from '../basic/SessionToggle'; import { SessionConfirmDialogProps } from '../dialog/SessionConfirm'; import styled from 'styled-components'; @@ -164,7 +164,7 @@ export const SessionSettingButtonItem = (props: ButtonSettingsProps) => { return ( - {pwdLockError}
} -