Merge branch 'theming_settings' into theming

pull/2521/head
William Grant 3 years ago
commit 4adc20a457

@ -1,5 +1,14 @@
<!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8" />
<meta
content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"
name="viewport"
/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta <meta
http-equiv="Content-Security-Policy" http-equiv="Content-Security-Policy"
content="default-src 'none'; content="default-src 'none';
@ -14,6 +23,7 @@
script-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';" style-src 'self' 'unsafe-inline';"
/> />
<link href="images/sesion/session_icon_128.png" rel="shortcut icon" />
<link href="stylesheets/dist/manifest.css" rel="stylesheet" type="text/css" /> <link href="stylesheets/dist/manifest.css" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>

@ -55,16 +55,7 @@
} }
.session-icon-button { .session-icon-button {
background-color: var(--button-icon-background-color); background-color: var(--primary-color);
box-shadow: none;
filter: brightness(1.05);
svg path {
transition: var(--default-duration);
opacity: 0.6;
// TODO Theming remove
fill: var(--color-text-opposite);
}
} }
} }
} }

@ -21,10 +21,6 @@
word-break: break-all; word-break: break-all;
} }
.session-icon-button svg path {
transition: fill 0.3s ease;
}
input, input,
textarea { textarea {
caret-color: var(--color-text) !important; caret-color: var(--color-text) !important;
@ -73,27 +69,17 @@ textarea {
} }
.session-label { .session-label {
color: var(--color-white-color); font-weight: 700;
color: var(--white-color);
padding: var(--margins-sm); padding: var(--margins-sm);
width: 100%; width: 100%;
border-radius: 2px; border-radius: 2px;
text-align: center; text-align: center;
&.primary { &.primary {
background-color: var(--color-dark-gray-color); background-color: var(--primary-color);
}
&.secondary {
background-color: var(--color-darkest-gray-color);
}
&.success {
/* TODO is this correct? */
background-color: var(--color-text);
} }
&.danger { &.danger {
background-color: var(--color-destructive); background-color: var(--danger-color);
}
/* TODO Is this correct? */
&.warning {
background-color: var(--color-warning);
} }
} }
@ -101,17 +87,7 @@ textarea {
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
position: relative; position: relative;
opacity: 0.4;
transform: translateZ(0); transform: translateZ(0);
&:hover {
opacity: 1;
}
transition: opacity var(--default-duration);
&.no-opacity {
opacity: 1;
}
} }
/* CONVERSATION AND MESSAGES */ /* CONVERSATION AND MESSAGES */
@ -464,10 +440,6 @@ label {
&:hover { &:hover {
background: var(--color-clickable-hovered); background: var(--color-clickable-hovered);
.session-icon {
opacity: 1;
}
} }
} }
@ -582,6 +554,7 @@ label {
height: 100vh; height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: var(--background-secondary-color);
&__password-lock { &__password-lock {
display: flex; display: flex;
@ -598,21 +571,22 @@ label {
max-width: 90%; max-width: 90%;
width: 600px; width: 600px;
background: var(--color-cell-background); background: var(--background-primary-color);
color: var(--color-text); color: var(--text-primary-color);
border: 1px solid var(--color-darker-gray-color); border: 1px solid var(--border-color);
border-radius: 5px; border-radius: 5px;
} }
} }
} }
// TODO Theming
#qr svg, #qr svg,
.qr-image svg { .qr-image svg {
width: $session-modal-size-sm; width: $session-modal-size-sm;
height: $session-modal-size-sm; height: $session-modal-size-sm;
padding: var(--margins-xs); padding: var(--margins-xs);
background-color: var(--color-white-color); background-color: var(--white-color);
border-radius: 3px; border-radius: 3px;
} }
@ -674,20 +648,6 @@ input {
height: 40px; height: 40px;
width: 40px; width: 40px;
border-radius: 50%; border-radius: 50%;
opacity: 1;
background-color: var(--button-icon-background-color);
box-shadow: var(--color-session-shadow);
svg path {
transition: var(--default-duration);
opacity: 0.6;
fill: var(--button-icon-stroke-color);
}
&:hover svg path {
opacity: 1;
fill: var(--button-icon-stroke-hover-color);
}
} }
} }

@ -165,18 +165,11 @@
z-index: 1; z-index: 1;
.session-icon-button { .session-icon-button {
margin-right: var(--margins-sm);
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
opacity: 0.7;
&:hover { margin-right: var(--margins-sm);
opacity: 1;
filter: brightness(0.9);
transition: var(--default-duration);
}
.send { .send {
padding: var(--margins-xs); padding: var(--margins-xs);

@ -22,23 +22,18 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: var(--color-black-color);
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 3 * $session-margin-lg; padding: calc(3 * var(--margins-lg));
} }
&-error-section { &-error-section {
width: 100%; width: 100%;
color: white; color: var(--text-primary-color);
margin: -var(--margins-sm) 0px 2 * $session-margin-lg 0px; margin: -var(--margins-sm) 0px calc(2 * var(--margins-lg)) 0px;
.session-label { .session-label {
&.primary {
background-color: rgba(var(--color-dark-gray-color-rgb), 0.3);
}
padding: var(--margins-xs) var(--margins-sm); padding: var(--margins-xs) var(--margins-sm);
text-align: center; text-align: center;
} }
@ -46,7 +41,7 @@
&-container { &-container {
font-family: $session-font-default; font-family: $session-font-default;
color: white; color: var(--text-primary-color);
display: inline-flex; display: inline-flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -54,10 +49,10 @@
width: 600px; width: 600px;
min-width: 420px; min-width: 420px;
padding: 3 * $session-margin-lg 2 * $session-margin-lg; padding: calc(3 * var(--margins-lg)) calc(2 * var(--margins-lg));
box-sizing: border-box; box-sizing: border-box;
background-color: var(--color-darkest-gray-color); background-color: var(--background-secondary-color);
border: 1px solid var(--color-darker-gray-color); border: 1px solid var(--border-color);
border-radius: 2px; border-radius: 2px;
.warning-info-area, .warning-info-area,
@ -67,7 +62,7 @@
align-items: center; align-items: center;
h1 { h1 {
color: white; color: var(--text-primary-color);
} }
svg { svg {
margin-inline-end: var(--margins-lg); margin-inline-end: var(--margins-lg);
@ -85,13 +80,13 @@
#password-prompt-input { #password-prompt-input {
width: 100%; width: 100%;
color: var(--color-white-color); background-color: var(--text-box-background-color);
background-color: var(--color-darker-gray-color); color: var(--text-box-text-user-color);
margin-top: 2 * $session-margin-lg; margin-top: calc(2 * var(--margins-lg));
padding: var(--margins-xs) var(--margins-lg); padding: var(--margins-xs) var(--margins-lg);
outline: none; outline: none;
border: none; border: 1px solid var(--border-color);
border-radius: 2px; border-radius: 7px;
text-align: center; text-align: center;
font-size: 24px; font-size: 24px;
letter-spacing: 5px; letter-spacing: 5px;

@ -22,6 +22,7 @@ const StyledSessionMemberItem = styled.button<{
inMentions?: boolean; inMentions?: boolean;
zombie?: boolean; zombie?: boolean;
selected?: boolean; selected?: boolean;
disableBg?: boolean;
}>` }>`
cursor: pointer; cursor: pointer;
display: flex; display: flex;
@ -36,14 +37,13 @@ const StyledSessionMemberItem = styled.button<{
transition: var(--default-duration); transition: var(--default-duration);
opacity: ${props => (props.zombie ? 0.5 : 1)}; opacity: ${props => (props.zombie ? 0.5 : 1)};
background-color: ${props => background-color: ${props =>
props.selected && 'var(--color-conversation-item-selected) !important'}; !props.disableBg && props.selected
? 'var(--conversation-tab-background-selected-color) !important'
: null};
:not(:last-child) { :not(:last-child) {
border-bottom: var(--border-color); border-bottom: var(--border-color);
} }
background-color: ${props =>
props.selected ? 'var(--conversation-tab-background-selected-color) !important' : null};
`; `;
const StyledInfo = styled.div` const StyledInfo = styled.div`
@ -109,6 +109,7 @@ export const MemberListItem = (props: {
zombie={isZombie} zombie={isZombie}
inMentions={inMentions} inMentions={inMentions}
selected={isSelected} selected={isSelected}
disableBg={disableBg}
> >
<StyledInfo> <StyledInfo>
<AvatarItem memberPubkey={pubkey} isAdmin={isAdmin || false} /> <AvatarItem memberPubkey={pubkey} isAdmin={isAdmin || false} />

@ -1,12 +1,16 @@
import React from 'react'; import React, { useEffect } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { SessionIcon } from './icon'; import { SessionIcon } from './icon';
import { withTheme } from 'styled-components';
import autoBind from 'auto-bind'; import autoBind from 'auto-bind';
import { SessionButton, SessionButtonColor } from './basic/SessionButton'; import { SessionButton, SessionButtonColor, SessionButtonType } from './basic/SessionButton';
import { Constants } from '../session';
import { SessionSpinner } from './basic/SessionSpinner'; import { SessionSpinner } from './basic/SessionSpinner';
import {
SessionTheme,
switchHtmlToDarkTheme,
switchHtmlToLightTheme,
} from '../themes/SessionTheme';
import styled from 'styled-components';
interface State { interface State {
error: string; error: string;
@ -17,11 +21,16 @@ interface State {
export const MAX_LOGIN_TRIES = 3; export const MAX_LOGIN_TRIES = 3;
const StyledTextPleaseWait = styled.div`
margin: var(--margins-sm) 0;
font-weight: 700;
`;
const TextPleaseWait = (props: { isLoading: boolean }) => { const TextPleaseWait = (props: { isLoading: boolean }) => {
if (!props.isLoading) { if (!props.isLoading) {
return null; return null;
} }
return <div>{window.i18n('pleaseWaitOpenAndOptimizeDb')}</div>; return <StyledTextPleaseWait>{window.i18n('pleaseWaitOpenAndOptimizeDb')}</StyledTextPleaseWait>;
}; };
class SessionPasswordPromptInner extends React.PureComponent<{}, State> { class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
@ -78,18 +87,18 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
/> />
); );
const infoIcon = this.state.clearDataView ? ( const infoIcon = this.state.clearDataView ? (
<SessionIcon iconType="warning" iconSize={35} iconColor="#ce0000" /> <SessionIcon iconType="warning" iconSize={35} iconColor="var(--danger-color)" />
) : ( ) : (
<SessionIcon iconType="lock" iconSize={35} iconColor={Constants.UI.COLORS.GREEN} /> <SessionIcon iconType="lock" iconSize={35} iconColor={'var(--primary-color)'} />
); );
const errorSection = !this.state.clearDataView && ( const errorSection = !this.state.clearDataView && (
<div className="password-prompt-error-section"> <div className="password-prompt-error-section">
{this.state.error && ( {this.state.error && (
<> <>
{showResetElements ? ( {showResetElements ? (
<div className="session-label warning">{window.i18n('maxPasswordAttempts')}</div> <div className="session-label danger">{window.i18n('maxPasswordAttempts')}</div>
) : ( ) : (
<div className="session-label primary">{this.state.error}</div> <div className="session-label danger">{this.state.error}</div>
)} )}
</> </>
)} )}
@ -174,7 +183,7 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
<div className={classNames(showResetElements && 'button-group')}> <div className={classNames(showResetElements && 'button-group')}>
<SessionButton <SessionButton
text={window.i18n('unlock')} text={window.i18n('unlock')}
buttonColor={SessionButtonColor.Primary} buttonType={SessionButtonType.Simple}
onClick={this.initLogin} onClick={this.initLogin}
/> />
{showResetElements && ( {showResetElements && (
@ -182,6 +191,7 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
<SessionButton <SessionButton
text="Reset Database" text="Reset Database"
buttonColor={SessionButtonColor.Danger} buttonColor={SessionButtonColor.Danger}
buttonType={SessionButtonType.Simple}
onClick={this.initClearDataView} onClick={this.initClearDataView}
/> />
</> </>
@ -196,10 +206,12 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
<SessionButton <SessionButton
text={window.i18n('clearAllData')} text={window.i18n('clearAllData')}
buttonColor={SessionButtonColor.Danger} buttonColor={SessionButtonColor.Danger}
buttonType={SessionButtonType.Simple}
onClick={window.clearLocalData} onClick={window.clearLocalData}
/> />
<SessionButton <SessionButton
text={window.i18n('cancel')} text={window.i18n('cancel')}
buttonType={SessionButtonType.Simple}
onClick={() => { onClick={() => {
this.setState({ clearDataView: false }); this.setState({ clearDataView: false });
}} }}
@ -209,4 +221,18 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
} }
} }
export const SessionPasswordPrompt = withTheme(SessionPasswordPromptInner); export const SessionPasswordPrompt = () => {
useEffect(() => {
if ((window as any).theme === 'dark') {
switchHtmlToDarkTheme();
} else {
switchHtmlToLightTheme();
}
}, []);
return (
<SessionTheme>
<SessionPasswordPromptInner />
</SessionTheme>
);
};

@ -2,19 +2,19 @@ import React from 'react';
import { updateConfirmModal } from '../../state/ducks/modalDialog'; import { updateConfirmModal } from '../../state/ducks/modalDialog';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import styled from 'styled-components'; import styled from 'styled-components';
import { whiteColor } from '../../themes/SessionTheme';
const StyledKnob = styled.div<{ active: boolean }>` const StyledKnob = styled.div<{ active: boolean }>`
position: absolute; position: absolute;
top: 0.5px; top: ${props => (props.active ? '1px' : '0.5px')};
left: 0.5px; left: ${props => (props.active ? '2px' : '0.5px')};
height: 21px; height: 21px;
width: 21px; width: 21px;
border-radius: 28px; border-radius: 28px;
/* TODO Theming update */ background-color: var(--toggle-switch-ball-color);
background-color: ${whiteColor};
box-shadow: ${props => box-shadow: ${props =>
props.active ? '-2px 1px 3px rgba(0, 0, 0, 0.15)' : '2px 1px 3px rgba(0, 0, 0, 0.15);'}; props.active
? '-2px 1px 3px var(--toggle-switch-ball-shadow-color);'
: '2px 1px 3px var(--toggle-switch-ball-shadow-color);'};
transition: transform var(--default-duration) ease, background-color var(--default-duration) ease; transition: transform var(--default-duration) ease, background-color var(--default-duration) ease;
@ -24,17 +24,22 @@ const StyledKnob = styled.div<{ active: boolean }>`
const StyledSessionToggle = styled.div<{ active: boolean }>` const StyledSessionToggle = styled.div<{ active: boolean }>`
width: 51px; width: 51px;
height: 25px; height: 25px;
border: 1px solid #e5e5ea; // TODO Theming update background-color: (--toggle-switch-off-background-color);
border: 1px solid var(--toggle-switch-off-border-color);
border-radius: 16px; border-radius: 16px;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
background-color: var(--color-transparent-color);
transition: var(--default-duration); transition: var(--default-duration);
background-color: ${props => background-color: ${props =>
props.active ? 'var(--color-accent)' : 'var(--color-clickable-hovered)'}; props.active
border-color: ${props => (props.active ? 'var(--color-accent)' : 'var(--color-cell-background)')}; ? 'var(--toggle-switch-on-background-color)'
: 'var(--toggle-switch-off-background-color)'};
border-color: ${props =>
props.active
? 'var(--toggle-switch-on-border-color)'
: 'var(--toggle-switch-off-border-color)'};
`; `;
type Props = { type Props = {

@ -68,19 +68,6 @@ const StyledMessagesContainer = styled.div<{}>`
height: 40px; height: 40px;
width: 40px; width: 40px;
border-radius: 50%; border-radius: 50%;
opacity: 1;
background-color: var(--color-cell-background);
box-shadow: var(--color-session-shadow);
svg path {
transition: var(--default-duration);
opacity: 0.6;
fill: var(--color-text);
}
&:hover svg path {
opacity: 1;
}
} }
`; `;

@ -127,7 +127,7 @@ export class SessionRecording extends React.Component<Props, State> {
<SessionIconButton <SessionIconButton
iconType="stop" iconType="stop"
iconSize="medium" iconSize="medium"
iconColor={'#FF4538'} iconColor={'var(--danger-color)'}
onClick={actionPauseFn} onClick={actionPauseFn}
/> />
)} )}
@ -174,6 +174,7 @@ export class SessionRecording extends React.Component<Props, State> {
iconSize={'large'} iconSize={'large'}
iconRotation={90} iconRotation={90}
onClick={this.onSendVoiceMessage} onClick={this.onSendVoiceMessage}
margin={'var(--margins-sm)'}
/> />
</div> </div>
)} )}

@ -1,54 +1,77 @@
import React from 'react'; import React from 'react';
import styled from 'styled-components';
import { SessionIconButton } from '../../icon'; import { SessionIconButton } from '../../icon';
const StyledChatButtonContainer = styled.div`
.session-icon-button {
svg {
background-color: var(--chat-buttons-background-color);
}
&:hover svg {
background-color: var(--chat-buttons-background-hover-color);
}
}
`;
export const AddStagedAttachmentButton = (props: { onClick: () => void }) => { export const AddStagedAttachmentButton = (props: { onClick: () => void }) => {
return ( return (
<SessionIconButton <StyledChatButtonContainer>
iconType="plusThin" <SessionIconButton
backgroundColor={'var(--color-compose-view-button-background)'} iconType="plusThin"
iconSize={'huge2'} backgroundColor={'var(--chat-buttons-background-color)'}
borderRadius="300px" iconColor={'var(--chat-buttons-icon-color)'}
iconPadding="8px" iconSize={'huge2'}
onClick={props.onClick} borderRadius="300px"
/> iconPadding="8px"
onClick={props.onClick}
/>
</StyledChatButtonContainer>
); );
}; };
export const StartRecordingButton = (props: { onClick: () => void }) => { export const StartRecordingButton = (props: { onClick: () => void }) => {
return ( return (
<SessionIconButton <StyledChatButtonContainer>
iconType="microphone"
iconSize={'huge2'}
backgroundColor={'var(--color-compose-view-button-background)'}
borderRadius="300px"
iconPadding="6px"
onClick={props.onClick}
/>
);
};
export const ToggleEmojiButton = React.forwardRef<HTMLDivElement, { onClick: () => void }>(
(props, ref) => {
return (
<SessionIconButton <SessionIconButton
iconType="emoji" iconType="microphone"
ref={ref}
backgroundColor="var(--color-compose-view-button-background)"
iconSize={'huge2'} iconSize={'huge2'}
backgroundColor={'var(--chat-buttons-background-color)'}
iconColor={'var(--chat-buttons-icon-color)'}
borderRadius="300px" borderRadius="300px"
iconPadding="6px" iconPadding="6px"
onClick={props.onClick} onClick={props.onClick}
/> />
</StyledChatButtonContainer>
);
};
export const ToggleEmojiButton = React.forwardRef<HTMLDivElement, { onClick: () => void }>(
(props, ref) => {
return (
<StyledChatButtonContainer>
<SessionIconButton
iconType="emoji"
ref={ref}
backgroundColor={'var(--chat-buttons-background-color)'}
iconColor={'var(--chat-buttons-icon-color)'}
iconSize={'huge2'}
borderRadius="300px"
iconPadding="6px"
onClick={props.onClick}
/>
</StyledChatButtonContainer>
); );
} }
); );
export const SendMessageButton = (props: { onClick: () => void }) => { export const SendMessageButton = (props: { onClick: () => void }) => {
return ( return (
<div className="send-message-button"> <StyledChatButtonContainer className="send-message-button">
<SessionIconButton <SessionIconButton
iconType="send" iconType="send"
backgroundColor={'var(--color-compose-view-button-background)'} backgroundColor={'var(--chat-buttons-background-color)'}
iconColor={'var(--chat-buttons-icon-color)'}
iconSize={'huge2'} iconSize={'huge2'}
iconRotation={90} iconRotation={90}
borderRadius="300px" borderRadius="300px"
@ -56,6 +79,6 @@ export const SendMessageButton = (props: { onClick: () => void }) => {
onClick={props.onClick} onClick={props.onClick}
dataTestId="send-message-button" dataTestId="send-message-button"
/> />
</div> </StyledChatButtonContainer>
); );
}; };

@ -12,7 +12,7 @@ type Props = {
}; };
const StyledMessageReactBar = styled.div` const StyledMessageReactBar = styled.div`
background-color: var(--color-received-message-background); background-color: var(--emoji-reaction-bar-background-color);
border-radius: 25px; border-radius: 25px;
box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.2), 0 0px 20px 0 rgba(0, 0, 0, 0.19); box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.2), 0 0px 20px 0 rgba(0, 0, 0, 0.19);
@ -26,9 +26,10 @@ const StyledMessageReactBar = styled.div`
align-items: center; align-items: center;
.session-icon-button { .session-icon-button {
border-color: transparent !important;
box-shadow: none !important;
margin: 0 4px; margin: 0 4px;
&:hover svg {
background-color: var(--chat-buttons-background-hover-color);
}
} }
`; `;
@ -44,7 +45,7 @@ const ReactButton = styled.span`
font-size: 24px; font-size: 24px;
:hover { :hover {
background-color: var(--color-compose-view-button-background); background-color: var(--chat-buttons-background-hover-color);
} }
`; `;
@ -79,11 +80,11 @@ export const MessageReactBar = (props: Props): ReactElement => {
</ReactButton> </ReactButton>
))} ))}
<SessionIconButton <SessionIconButton
iconColor={'var(--color-text)'} iconColor={'var(--emoji-reaction-bar-icon-color)'}
iconPadding={'12px'} iconPadding={'8px'}
iconSize={'huge2'} iconSize={'huge'}
iconType="plusThin" iconType="plusThin"
backgroundColor={'var(--color-compose-view-button-background)'} backgroundColor={'var(--emoji-reaction-bar-icon-background-color)'}
borderRadius="300px" borderRadius="300px"
onClick={additionalAction} onClick={additionalAction}
/> />

@ -25,8 +25,8 @@ export const GroupInvitation = (props: PropsForGroupInvitation) => {
<div className={classNames(classes)}> <div className={classNames(classes)}>
<div className="contents"> <div className="contents">
<SessionIconButton <SessionIconButton
iconColor="var(--background-secondary-color)"
iconType="plus" iconType="plus"
iconColor={'var(--color-accent)'}
iconSize={'large'} iconSize={'large'}
onClick={() => { onClick={() => {
acceptOpenGroupInvitation(props.acceptUrl, props.serverName); acceptOpenGroupInvitation(props.acceptUrl, props.serverName);

@ -64,7 +64,7 @@ export const SessionConfirm = (props: SessionConfirmDialogProps) => {
const cancelText = props.cancelText || window.i18n('cancel'); const cancelText = props.cancelText || window.i18n('cancel');
const showHeader = !!props.title; const showHeader = !!props.title;
const messageSubText = messageSub ? 'session-confirm-main-message' : 'subtle'; const messageSubText = messageSub ? 'session-confirm-main-message' : undefined;
const onClickOkHandler = async () => { const onClickOkHandler = async () => {
if (onClickOk) { if (onClickOk) {
@ -120,11 +120,7 @@ export const SessionConfirm = (props: SessionConfirmDialogProps) => {
)} )}
<SessionHtmlRenderer tag="span" className={messageSubText} html={message} /> <SessionHtmlRenderer tag="span" className={messageSubText} html={message} />
<SessionHtmlRenderer <SessionHtmlRenderer tag="span" className="session-confirm-sub-message" html={messageSub} />
tag="span"
className="session-confirm-sub-message subtle"
html={messageSub}
/>
<SessionSpinner loading={isLoading} /> <SessionSpinner loading={isLoading} />
</div> </div>

@ -140,7 +140,7 @@ export class SessionPasswordDialog extends React.Component<Props, State> {
<> <>
{message && ( {message && (
<> <>
<div className="session-label warning">{message}</div> <div className="session-label danger">{message}</div>
<SpacerLG /> <SpacerLG />
</> </>
)} )}

@ -3,6 +3,7 @@ import classNames from 'classnames';
import { SessionIcon, SessionIconProps } from '../icon'; import { SessionIcon, SessionIconProps } from '../icon';
import _ from 'lodash'; import _ from 'lodash';
import { SessionNotificationCount } from './SessionNotificationCount'; import { SessionNotificationCount } from './SessionNotificationCount';
import styled from 'styled-components';
interface SProps extends SessionIconProps { interface SProps extends SessionIconProps {
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void; onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
@ -15,6 +16,26 @@ interface SProps extends SessionIconProps {
style?: object; style?: object;
} }
const StyledSessionIconButton = styled.div<{ color?: string; isSelected?: boolean }>`
background-color: var(--button-icon-background-color);
svg path {
transition: var(--default-duration);
${props =>
!props.color &&
`fill:
${
props.isSelected
? 'var(--button-icon-stroke-selected-color)'
: 'var(--button-icon-stroke-color)'
};`}
}
&:hover svg path {
${props => !props.color && `fill: var(--button-icon-stroke-hover-color);`}
}
`;
const SessionIconButtonInner = React.forwardRef<HTMLDivElement, SProps>((props, ref) => { const SessionIconButtonInner = React.forwardRef<HTMLDivElement, SProps>((props, ref) => {
const { const {
iconType, iconType,
@ -43,8 +64,10 @@ const SessionIconButtonInner = React.forwardRef<HTMLDivElement, SProps>((props,
}; };
return ( return (
<div <StyledSessionIconButton
className={classNames('session-icon-button', iconSize, isSelected ? 'no-opacity' : '')} color={iconColor}
isSelected={isSelected}
className={classNames('session-icon-button', iconSize)}
role="button" role="button"
ref={ref} ref={ref}
id={id} id={id}
@ -65,7 +88,7 @@ const SessionIconButtonInner = React.forwardRef<HTMLDivElement, SProps>((props,
iconPadding={iconPadding} iconPadding={iconPadding}
/> />
{Boolean(notificationCount) && <SessionNotificationCount count={notificationCount} />} {Boolean(notificationCount) && <SessionNotificationCount count={notificationCount} />}
</div> </StyledSessionIconButton>
); );
}); });

@ -101,7 +101,6 @@ const Section = (props: { type: SectionType }) => {
iconSize="medium" iconSize="medium"
dataTestId="message-section" dataTestId="message-section"
iconType={'chatBubble'} iconType={'chatBubble'}
iconColor={undefined}
notificationCount={unreadToShow} notificationCount={unreadToShow}
onClick={handleClick} onClick={handleClick}
isSelected={isSelected} isSelected={isSelected}
@ -113,7 +112,6 @@ const Section = (props: { type: SectionType }) => {
iconSize="medium" iconSize="medium"
dataTestId="settings-section" dataTestId="settings-section"
iconType={'gear'} iconType={'gear'}
iconColor={undefined}
notificationCount={unreadToShow} notificationCount={unreadToShow}
onClick={handleClick} onClick={handleClick}
isSelected={isSelected} isSelected={isSelected}
@ -134,7 +132,6 @@ const Section = (props: { type: SectionType }) => {
iconSize="medium" iconSize="medium"
iconType={'moon'} iconType={'moon'}
dataTestId="theme-section" dataTestId="theme-section"
iconColor={undefined}
notificationCount={unreadToShow} notificationCount={unreadToShow}
onClick={handleClick} onClick={handleClick}
isSelected={isSelected} isSelected={isSelected}

@ -15,6 +15,33 @@ import { SessionIcon } from '../icon';
import { SessionSettingCategory } from '../settings/SessionSettings'; import { SessionSettingCategory } from '../settings/SessionSettings';
import { resetConversationExternal } from '../../state/ducks/conversations'; import { resetConversationExternal } from '../../state/ducks/conversations';
const StyledSettingsSectionTitle = styled.strong`
font-family: var(--font-font-accent);
font-size: var(--font-size-md);
`;
const StyledSettingsListItem = styled.div<{ active: boolean }>`
background-color: ${props =>
props.active
? 'var(--settings-tab-background-selected-color)'
: 'var(--settings-tab-background-color)'};
color: var(--settings-tab-text-color);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 74px;
line-height: 1.4;
padding: 0px var(--margins-md);
flex-shrink: 0;
cursor: pointer;
transition: var(--default-duration) !important;
:hover {
background: var(--settings-tab-background-hover-color);
}
`;
const getCategories = () => { const getCategories = () => {
return [ return [
{ {
@ -92,9 +119,7 @@ const LeftPaneSettingsCategoryRow = (props: {
} }
}} }}
> >
<StyledSettingsSectionTitle <StyledSettingsSectionTitle style={{ color: isClearData ? 'var(--danger-color)' : 'unset' }}>
style={{ color: isClearData ? 'var(--color-destructive)' : 'unset' }}
>
{title} {title}
</StyledSettingsSectionTitle> </StyledSettingsSectionTitle>
@ -123,29 +148,6 @@ const StyledContentSection = styled.div`
overflow-y: auto; overflow-y: auto;
`; `;
const StyledSettingsSectionTitle = styled.strong`
font-family: var(--font-font-accent);
font-size: var(--font-size-md);
`;
const StyledSettingsListItem = styled.div<{ active: boolean }>`
background: ${props => (props.active ? 'var(--color-conversation-item-selected)' : 'none')};
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 74px;
line-height: 1.4;
padding: 0px var(--margins-md);
flex-shrink: 0;
cursor: pointer;
transition: var(--default-duration) !important;
:hover {
background: var(--color-clickable-hovered);
}
`;
export const LeftPaneSettingSection = () => { export const LeftPaneSettingSection = () => {
return ( return (
<StyledContentSection> <StyledContentSection>

@ -14,6 +14,7 @@ import { Flex } from '../basic/Flex';
import { SessionIconButton, SessionIconType } from '../icon'; import { SessionIconButton, SessionIconType } from '../icon';
import * as MIME from '../../types/MIME'; import * as MIME from '../../types/MIME';
import { isUndefined } from 'lodash'; import { isUndefined } from 'lodash';
import styled from 'styled-components';
const Colors = { const Colors = {
TEXT_SECONDARY: '#bbb', TEXT_SECONDARY: '#bbb',
@ -127,6 +128,17 @@ const styles = {
}, },
}; };
const StyledIconButton = styled.div`
.session-icon-button {
opacity: 0.4;
transition: opacity var(--default-duration);
&:hover {
opacity: 1;
}
}
`;
interface IconButtonProps { interface IconButtonProps {
onClick?: () => void; onClick?: () => void;
style?: React.CSSProperties; style?: React.CSSProperties;
@ -162,14 +174,16 @@ const IconButton = ({ onClick, type }: IconButtonProps) => {
} }
return ( return (
<SessionIconButton <StyledIconButton>
iconType={iconType} <SessionIconButton
iconSize={'huge'} iconType={iconType}
iconRotation={iconRotation} iconSize={'huge'}
// the lightbox has a dark background iconRotation={iconRotation}
iconColor="white" // the lightbox has a dark background
onClick={clickHandler} iconColor="var(--white-color)"
/> onClick={clickHandler}
/>
</StyledIconButton>
); );
}; };

@ -18,20 +18,28 @@ const BlockedEntriesContainer = styled.div`
overflow: auto; overflow: auto;
min-height: 40px; min-height: 40px;
max-height: 100%; max-height: 100%;
background: var(--color-input-background); // TODO theming update
`; `;
const BlockedEntriesRoundedContainer = styled.div` const BlockedEntriesRoundedContainer = styled.div`
overflow: hidden; overflow: hidden;
background: var(--background-secondary-color);
border: 1px solid var(--border-color);
border-radius: 16px; border-radius: 16px;
padding: var(--margins-lg); padding: var(--margins-lg);
background: var(--color-input-background); // TODO theming update margin: 0 var(--margins-lg);
`; `;
const BlockedContactsSection = styled.div` const BlockedContactsSection = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 0; min-height: 0;
background: var(--settings-tab-background-color);
color: var(--settings-tab-text-color);
border-top: 1px solid var(--border-color);
border-bottom: 1px solid var(--border-color);
margin-bottom: var(--margins-lg);
`; `;
const BlockedContactListTitle = styled.div` const BlockedContactListTitle = styled.div`
@ -50,10 +58,6 @@ export const StyledBlockedSettingItem = styled.div<{ clickable: boolean }>`
font-size: var(--font-size-md); font-size: var(--font-size-md);
padding: var(--margins-lg); padding: var(--margins-lg);
background: var(--color-cell-background);
color: var(--color-text);
border-bottom: var(--border-session);
cursor: ${props => (props.clickable ? 'pointer' : 'unset')}; cursor: ${props => (props.clickable ? 'pointer' : 'unset')};
`; `;
@ -143,18 +147,20 @@ export const BlockedContactsList = () => {
iconRotation={expanded ? 0 : 180} iconRotation={expanded ? 0 : 180}
dataTestId="reveal-blocked-user-settings" dataTestId="reveal-blocked-user-settings"
/> />
<SpacerLG />
</BlockedContactListTitleButtons> </BlockedContactListTitleButtons>
)} )}
</BlockedContactListTitle> </BlockedContactListTitle>
</StyledBlockedSettingItem> </StyledBlockedSettingItem>
{expanded && !noBlockedNumbers ? ( {expanded && !noBlockedNumbers ? (
<BlockedEntries <>
blockedNumbers={blockedNumbers} <BlockedEntries
selectedIds={selectedIds} blockedNumbers={blockedNumbers}
addToSelected={addToSelected} selectedIds={selectedIds}
removeFromSelected={removeFromSelected} addToSelected={addToSelected}
/> removeFromSelected={removeFromSelected}
/>
<SpacerLG />
</>
) : null} ) : null}
</BlockedContactsSection> </BlockedContactsSection>
); );

@ -26,7 +26,6 @@ export const StyledDescriptionSettingsItem = styled.div`
font-size: var(--font-size-sm); font-size: var(--font-size-sm);
font-weight: 400; font-weight: 400;
max-width: 700px; max-width: 700px;
color: var(--color-text-subtle);
`; `;
export const StyledTitleSettingsItem = styled.div` export const StyledTitleSettingsItem = styled.div`
@ -47,10 +46,12 @@ const StyledDescriptionContainer = styled(StyledDescriptionSettingsItem)`
export const StyledSettingItem = styled.div` export const StyledSettingItem = styled.div`
font-size: var(--font-size-md); font-size: var(--font-size-md);
padding: var(--margins-lg); padding: var(--margins-lg);
margin-bottom: var(--margins-lg);
background: var(--color-cell-background); background: var(--settings-tab-background-color);
color: var(--color-text); color: var(--settings-tab-text-color);
border-bottom: var(--border-session); border-top: 1px solid var(--border-color);
border-bottom: 1px solid var(--border-color);
`; `;
const StyledSettingItemInline = styled(StyledSettingItem)` const StyledSettingItemInline = styled(StyledSettingItem)`
@ -61,9 +62,12 @@ const StyledSettingItemInline = styled(StyledSettingItem)`
`; `;
const StyledSettingItemClickable = styled(StyledSettingItemInline)` const StyledSettingItemClickable = styled(StyledSettingItemInline)`
cursor: pointer;
:hover { :hover {
background: var(--color-clickable-hovered); background: var(--settings-tab-background-hover-color);
cursor: pointer; }
:active {
background: var(--settings-tab-background-selected-color);
} }
`; `;

@ -61,21 +61,33 @@ const StyledSpanSessionInfo = styled.span`
opacity: 0.4; opacity: 0.4;
transition: var(--default-duration); transition: var(--default-duration);
user-select: text; user-select: text;
cursor: pointer;
:hover { &:hover {
opacity: 1; opacity: 1;
} }
`; `;
const SessionInfo = () => { const SessionInfo = () => {
const openOxenWebsite = () => {
void shell.openExternal('https://oxen.io/');
};
return ( return (
<StyledVersionInfo> <StyledVersionInfo>
<StyledSpanSessionInfo>v{window.versionInfo.version}</StyledSpanSessionInfo> <StyledSpanSessionInfo
onClick={() => {
void shell.openExternal(
`https://github.com/oxen-io/session-desktop/releases/tag/v${window.versionInfo.version}`
);
}}
>
v{window.versionInfo.version}
</StyledSpanSessionInfo>
<StyledSpanSessionInfo> <StyledSpanSessionInfo>
<SessionIconButton iconSize="medium" iconType="oxen" onClick={openOxenWebsite} /> <SessionIconButton
iconSize="medium"
iconType="oxen"
onClick={() => {
void shell.openExternal('https://oxen.io/');
}}
/>
</StyledSpanSessionInfo> </StyledSpanSessionInfo>
<StyledSpanSessionInfo>{window.versionInfo.commitHash}</StyledSpanSessionInfo> <StyledSpanSessionInfo>{window.versionInfo.commitHash}</StyledSpanSessionInfo>
</StyledVersionInfo> </StyledVersionInfo>
@ -84,18 +96,22 @@ const SessionInfo = () => {
const StyledPasswordInput = styled.input` const StyledPasswordInput = styled.input`
width: 100%; width: 100%;
background: var(--color-input-background); background: var(--text-box-background-color);
color: var(--color-text); color: var(--text-box-text-user-color);
padding: var(--margins-xs) var(--margins-md); padding: var(--margins-xs) var(--margins-md);
margin-bottom: var(--margins-lg); margin-bottom: var(--margins-lg);
outline: none; outline: none;
border: none; border: 1px solid var(--border-color);
border-radius: 2px; border-radius: 7px;
text-align: center; text-align: center;
font-size: 24px; font-size: 24px;
letter-spacing: 5px; letter-spacing: 5px;
font-family: var(--font-default); font-family: var(--font-default);
::placeholder {
color: var(--text-box-text-control-color);
}
`; `;
const StyledH3 = styled.h3` const StyledH3 = styled.h3`
@ -123,7 +139,7 @@ const PasswordLock = ({
autoFocus={true} autoFocus={true}
/> />
{pwdLockError && <div className="session-label warning">{pwdLockError}</div>} {pwdLockError && <div className="session-label danger">{pwdLockError}</div>}
<SessionButton <SessionButton
buttonType={SessionButtonType.Simple} buttonType={SessionButtonType.Simple}

@ -11,7 +11,6 @@ const StyledSettingsHeader = styled.div`
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: var(--main-view-header-height); height: var(--main-view-header-height);
background: var(--color-cell-background);
`; `;
const StyledHeaderTittle = styled.div` const StyledHeaderTittle = styled.div`

@ -485,6 +485,7 @@ export const SessionGlobalStyles = createGlobalStyle`
/* TODO Theming Clarify what those transparent colors mean */ /* TODO Theming Clarify what those transparent colors mean */
/* Text Box */ /* Text Box */
/* Also used for inputs specifically password box input */
--text-box-background-color: var(--background-primary-color); --text-box-background-color: var(--background-primary-color);
--text-box-text-control-color: ${THEMES.CLASSIC_LIGHT.COLOR1}; --text-box-text-control-color: ${THEMES.CLASSIC_LIGHT.COLOR1};
--text-box-text-user-color: var(--text-primary-color); --text-box-text-user-color: var(--text-primary-color);
@ -503,6 +504,7 @@ export const SessionGlobalStyles = createGlobalStyle`
--menu-button-icon-color: ${THEMES.CLASSIC_LIGHT.COLOR6}; --menu-button-icon-color: ${THEMES.CLASSIC_LIGHT.COLOR6};
/* Chat (Interaction) Buttons */ /* Chat (Interaction) Buttons */
/* Also used for Reaction Bar Buttons */
--chat-buttons-background-color: ${THEMES.CLASSIC_LIGHT.COLOR4}; --chat-buttons-background-color: ${THEMES.CLASSIC_LIGHT.COLOR4};
--chat-buttons-background-hover-color: ${THEMES.CLASSIC_LIGHT.COLOR3}; --chat-buttons-background-hover-color: ${THEMES.CLASSIC_LIGHT.COLOR3};
--chat-buttons-icon-color: var(--text-primary-color); --chat-buttons-icon-color: var(--text-primary-color);
@ -582,7 +584,8 @@ export const SessionGlobalStyles = createGlobalStyle`
--zoom-bar-selector-color: var(--primary-color); --zoom-bar-selector-color: var(--primary-color);
/* Toggle Switch */ /* Toggle Switch */
--toggle-switch-ball-color: ; --toggle-switch-ball-color: var(--white-color);
--toggle-switch-ball-shadow-color: rgba(${hexColorToRGB(COLORS.BLACK)}, 0.15);
/* TODO Theming think this should be white instead of transparent */ /* TODO Theming think this should be white instead of transparent */
--toggle-switch-off-background-color: var(--transparent-color); --toggle-switch-off-background-color: var(--transparent-color);
--toggle-switch-off-border-color: var(--border-color); --toggle-switch-off-border-color: var(--border-color);

Loading…
Cancel
Save