Skip to content

Commit fe57721

Browse files
committed
feat: moved appearance section and slider for zoom factor
1 parent 7f885a1 commit fe57721

25 files changed

+567
-630
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"pino": "^9.6.0",
9191
"protobufjs": "^7.4.0",
9292
"punycode": "^2.3.1",
93-
"rc-slider": "^11.1.8",
9493
"react": "18.3.1",
9594
"react-contexify": "^6.0.0",
9695
"react-dom": "18.3.1",

stylesheets/_session_slider.scss

Lines changed: 0 additions & 260 deletions
This file was deleted.

stylesheets/manifest.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@
2828
@import 'session_theme';
2929
@import 'session_left_pane';
3030

31-
@import 'session_slider';
3231
@import 'session_conversation';

ts/components/SessionContextMenuContainer.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export const SessionContextMenuContainer = styled.div.attrs({
44
// custom props
55
})`
66
.contexify {
7+
--contexify-activeItem-bgColor: var(--context-menu-background-hover-color);
8+
--contexify-activeItem-color: var(--context-menu-text-hover-color);
79
// be sure it is more than the one set for the More Information screen of messages
810
z-index: 30;
911
min-width: 200px;
@@ -36,3 +38,17 @@ export const SessionContextMenuContainer = styled.div.attrs({
3638
}
3739
}
3840
`;
41+
42+
export const SessionContextMenuContainerItemsCentered = styled(SessionContextMenuContainer)`
43+
.contexify {
44+
.contexify_item {
45+
width: 100%;
46+
place-items: center;
47+
}
48+
49+
.contexify_itemContent {
50+
width: 100%;
51+
justify-content: center;
52+
}
53+
}
54+
`;

ts/components/basic/SessionRadio.tsx

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangeEvent, SessionDataTestId, type MouseEventHandler } from 'react';
1+
import { SessionDataTestId, type MouseEventHandler } from 'react';
22

33
import styled, { CSSProperties } from 'styled-components';
44
import { Flex } from './Flex';
@@ -38,7 +38,11 @@ const StyledRadioOuter = styled.div<{
3838
}
3939
`;
4040

41-
function RadioButton({
41+
/**
42+
* The dot part of the radio button. Unless for the Theme switcher, it shouldn't be used directly.
43+
* Instead, use `SessionRadio`.
44+
*/
45+
export function RadioDot({
4246
disabled,
4347
onClick,
4448
selected,
@@ -143,7 +147,7 @@ export const SessionRadio = (props: SessionRadioProps) => {
143147
</StyledLabel>
144148
) : null}
145149

146-
<RadioButton
150+
<RadioDot
147151
selected={active}
148152
onClick={clickHandler}
149153
disabled={disabled}
@@ -154,47 +158,3 @@ export const SessionRadio = (props: SessionRadioProps) => {
154158
</StyledContainer>
155159
);
156160
};
157-
158-
/**
159-
* This is slightly different that the classic SessionRadio as this one has
160-
* - no padding between the selected background and the border,
161-
* - they all have a background color (even when not selected), but the border is present on the selected one
162-
*
163-
* Keeping it here so we don't have to export
164-
*/
165-
export const SessionRadioPrimaryColors = (props: {
166-
value: string;
167-
active: boolean;
168-
onClick: (value: string) => void;
169-
ariaLabel: string;
170-
color: string; // by default, we use the theme accent color but for the settings screen we need to be able to force it
171-
}) => {
172-
const { value, active, onClick, color, ariaLabel } = props;
173-
174-
function clickHandler(e: ChangeEvent<any>) {
175-
e.stopPropagation();
176-
onClick(value);
177-
}
178-
179-
// this component has no padding between the selected background and the border
180-
const diameterRadioBorder = 26;
181-
182-
const overriddenColorsVars = {
183-
'--primary-color': color,
184-
'--text-primary-color': active ? undefined : 'transparent',
185-
} as React.CSSProperties;
186-
187-
return (
188-
<Flex $container={true} padding="0 0 5px 0">
189-
<RadioButton
190-
selected={true}
191-
onClick={clickHandler}
192-
disabled={false}
193-
dataTestId={undefined}
194-
diameterRadioBorder={diameterRadioBorder}
195-
style={overriddenColorsVars}
196-
ariaLabel={ariaLabel}
197-
/>
198-
</Flex>
199-
);
200-
};

ts/components/buttons/panel/GenericPanelButtonWithAction.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReactNode, SessionDataTestId } from 'react';
1+
import type { MouseEvent, ReactNode, SessionDataTestId } from 'react';
22
import styled from 'styled-components';
33
import { useIsDarkTheme } from '../../../state/theme/selectors/theme';
44
import { StyledPanelButton, StyledContent } from './PanelButton';
@@ -7,13 +7,14 @@ import { StyledPanelButtonSeparator } from './StyledPanelButtonGroupSeparator';
77
const StyledActionContainer = styled.div`
88
display: flex;
99
align-items: center;
10+
flex-shrink: 0;
1011
pointer-events: none; // let the container handle the event (otherwise we get 2 onClick events, cancelling each others)
1112
`;
1213

1314
export type GenericPanelButtonProps = {
1415
textElement: ReactNode;
1516
actionElement: ReactNode;
16-
onClick: undefined | (() => void | Promise<void>);
17+
onClick: undefined | ((e: MouseEvent<any>) => void | Promise<void>);
1718
rowDataTestId: SessionDataTestId;
1819
};
1920

0 commit comments

Comments
 (0)