Skip to content

Commit 5070626

Browse files
committed
fix: address PR comments
1 parent 200a5ed commit 5070626

File tree

12 files changed

+13
-22
lines changed

12 files changed

+13
-22
lines changed

stylesheets/_rtl.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
body.rtl {
22
input,
3+
button,
34
textarea,
45
.module-left-pane,
56
.module-conversation-list-item,

ts/components/buttons/PanelRadioButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const PanelRadioButton = (props: PanelRadioButtonProps) => {
5757
label=""
5858
disabled={disabled}
5959
inputDataTestId={radioInputDataTestId}
60-
style={{ paddingRight: 'var(--margins-xs)' }}
60+
style={{ paddingInlineEnd: 'var(--margins-xs)' }}
6161
/>
6262
</StyledCheckContainer>
6363
</StyledContent>

ts/components/buttons/PlusAvatarButton.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { SessionDataTestId } from 'react';
22
import { SessionIconButton } from '../icon';
3-
import { useIsRtl } from '../../util/i18n/rtlSupport';
43

54
export const PlusAvatarButton = ({
65
onClick,
@@ -9,8 +8,6 @@ export const PlusAvatarButton = ({
98
onClick?: () => void;
109
dataTestId?: SessionDataTestId;
1110
}) => {
12-
const isRtl = useIsRtl();
13-
1411
return (
1512
<SessionIconButton
1613
iconType="plusFat"
@@ -25,8 +22,7 @@ export const PlusAvatarButton = ({
2522
style={{
2623
position: 'absolute',
2724
bottom: 0,
28-
right: isRtl ? undefined : 0,
29-
left: isRtl ? 0 : undefined,
25+
insetInlineEnd: 0,
3026
}}
3127
/>
3228
);

ts/components/inputs/ClearInputButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { SessionDataTestId } from 'react';
2-
import { useHTMLDirection } from '../../util/i18n/rtlSupport';
32
import { SessionIconButton } from '../icon';
43
import { alignButtonEndAbsoluteButtonStyle } from './sharedStyles';
54

@@ -12,8 +11,7 @@ export const ClearInputButton = ({
1211
dataTestId: SessionDataTestId;
1312
show: boolean;
1413
}) => {
15-
const htmlDirection = useHTMLDirection();
16-
const style = alignButtonEndAbsoluteButtonStyle(htmlDirection);
14+
const style = alignButtonEndAbsoluteButtonStyle();
1715

1816
if (!show) {
1917
return null;

ts/components/inputs/ShowHidePasswordButton.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { SessionDataTestId } from 'react';
2-
import { useHTMLDirection } from '../../util/i18n/rtlSupport';
32
import { alignButtonEndAbsoluteButtonStyle } from './sharedStyles';
43
import { SessionIconButton } from '../icon';
54

@@ -15,8 +14,7 @@ type ShowHideButtonProps = {
1514
export const ShowHideButton = (props: ShowHideButtonProps) => {
1615
const { forceShow, toggleForceShow, hasError, ariaLabels, dataTestIds } = props;
1716

18-
const htmlDirection = useHTMLDirection();
19-
const style = alignButtonEndAbsoluteButtonStyle(htmlDirection);
17+
const style = alignButtonEndAbsoluteButtonStyle();
2018

2119
return (
2220
<SessionIconButton
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import type { CSSProperties } from 'styled-components';
2-
import type { HTMLDirection } from '../../util/i18n/rtlSupport';
32

4-
export function alignButtonEndAbsoluteButtonStyle(htmlDirection: HTMLDirection): CSSProperties {
3+
export function alignButtonEndAbsoluteButtonStyle(): CSSProperties {
54
return {
65
position: 'absolute',
76
top: '50%',
87
transform: 'translateY(-50%)',
9-
left: htmlDirection === 'ltr' ? undefined : 'var(--margins-sm)',
10-
right: htmlDirection === 'ltr' ? 'var(--margins-sm)' : undefined,
8+
insetInlineEnd: 'var(--margins-sm)',
119
};
1210
}

ts/components/menuAndSettingsHooks/useCopyAccountId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function useShowCopyAccountId(conversationId?: string) {
1111
export function useShowCopyAccountIdCb(conversationId?: string) {
1212
const canCopy = useShowCopyAccountId(conversationId);
1313

14-
if (!canCopy && conversationId) {
14+
if (!canCopy || !conversationId) {
1515
return null;
1616
}
1717

ts/components/menuAndSettingsHooks/useGroupCommonNoShow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useIsActive, useIsBlocked, useIsKickedFromGroup } from '../../hooks/useParamSelector';
22

33
export function useGroupCommonNoShow(convoId: string) {
4-
const isKickedFromGroup = useIsKickedFromGroup(convoId) || false;
4+
const isKickedFromGroup = useIsKickedFromGroup(convoId);
55
const isBlocked = useIsBlocked(convoId);
66
const isActive = useIsActive(convoId);
77

ts/components/menuAndSettingsHooks/useShowBlockUnblock.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export function useShowBlockUnblock(convoId?: string) {
1616
const isIncomingRequest = useIsIncomingRequest(convoId);
1717
const dispatch = useDispatch();
1818

19-
const showBlockUnblock = convoId && !isMe && isPrivate && !isIncomingRequest && !PubKey.isBlinded(convoId);
19+
const showBlockUnblock =
20+
convoId && !isMe && isPrivate && !isIncomingRequest && !PubKey.isBlinded(convoId);
2021

2122
if (!showBlockUnblock) {
2223
return null;

ts/components/menuAndSettingsHooks/useShowLeaveGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useIsMessageRequestOverlayShown } from '../../state/selectors/section';
1212

1313
export function useShowLeaveGroupCb(conversationId?: string) {
1414
const isClosedGroup = useIsClosedGroup(conversationId);
15-
const isKickedFromGroup = useIsKickedFromGroup(conversationId) || false;
15+
const isKickedFromGroup = useIsKickedFromGroup(conversationId);
1616
const isGroupDestroyed = useIsGroupDestroyed(conversationId);
1717
const isMessageRequestShown = useIsMessageRequestOverlayShown();
1818
const username = useConversationUsername(conversationId) || conversationId;

0 commit comments

Comments
 (0)