feat: improved TermsOfServicePrivacyDialog styling

added new modal confirm buttons, only tested in classic dark for onboarding
pull/3056/head
William Grant 1 year ago
parent eaa9817d14
commit 131c114b24

@ -6,11 +6,13 @@ export enum SessionButtonType {
Outline = 'outline',
Simple = 'simple',
Solid = 'solid',
ModalConfirm = 'modal-confirm',
}
export enum SessionButtonShape {
Round = 'round',
Square = 'square',
None = 'none',
}
// NOTE References ts/themes/colors.tsx
@ -33,7 +35,7 @@ const StyledButton = styled.div<{
buttonType: SessionButtonType;
buttonShape: SessionButtonShape;
}>`
width: auto;
width: ${props => (props.buttonType === SessionButtonType.ModalConfirm ? '100%' : 'auto')};
display: flex;
justify-content: center;
align-items: center;
@ -45,8 +47,9 @@ const StyledButton = styled.div<{
transition: var(--default-duration);
background-repeat: no-repeat;
overflow: hidden;
height: 34px;
padding: 0px 18px;
height: ${props => (props.buttonType === SessionButtonType.ModalConfirm ? undefined : '34px')};
padding: ${props =>
props.buttonType === SessionButtonType.ModalConfirm ? '16px 24px 24px' : '0px 18px'};
background-color: ${props =>
props.buttonType === SessionButtonType.Solid && props.color
? `var(--${props.color}-color)`
@ -65,7 +68,12 @@ const StyledButton = styled.div<{
${props =>
props.buttonType === SessionButtonType.Solid &&
'box-shadow: 0px 0px 6px var(--button-solid-shadow-color);'}
border-radius: ${props => (props.buttonShape === SessionButtonShape.Round ? '17px' : '6px')};
border-radius: ${props =>
props.buttonShape === SessionButtonShape.Round
? '17px'
: props.buttonShape === SessionButtonShape.Square
? '6px'
: '0px'};
.session-icon {
fill: var(--background-primary-color);

@ -1,8 +1,16 @@
import { noop } from 'lodash';
import { useDispatch } from 'react-redux';
import { updateTermsOfServicePrivacyModal } from '../../state/ducks/modalDialog';
import styled from 'styled-components';
import { updateTermsOfServicePrivacyModal } from '../../state/onboarding/ducks/modals';
import { SessionWrapperModal } from '../SessionWrapperModal';
import { Flex } from '../basic/Flex';
import { SessionButton, SessionButtonShape, SessionButtonType } from '../basic/SessionButton';
import { SpacerSM } from '../basic/Text';
// NOTE we want to bypass the padding on the modal body so the buttons take up the full space
const ConfirmButtonContainer = styled(Flex)`
margin: 0px calc(var(--margins-lg) * -1) calc(var(--margins-lg) * -1) calc(var(--margins-lg) * -1);
`;
export type TermsOfServicePrivacyDialogProps = {
show: boolean;
@ -21,33 +29,33 @@ export function TermsOfServicePrivacyDialog(props: TermsOfServicePrivacyDialogPr
return null;
}
// TODO[epic=ses-900] need to add redux context to initial screens... or at the very least, a separate onboarding redux state
return (
<SessionWrapperModal
title={window.i18n('urlOpen')}
onClose={onClose}
showExitIcon={true}
showHeader={true}
headerReverse={true}
>
<div className="session-modal__centered">
<span className="session-confirm-sub-message">{window.i18n('urlOpenBrowser')}</span>
<div className="session-modal__button-group">
<span>{window.i18n('urlOpenBrowser')}</span>
<SpacerSM />
<ConfirmButtonContainer container={true} justifyContent="center" alignItems="center">
<SessionButton
text={window.i18n('termsOfService')}
buttonType={SessionButtonType.Simple}
buttonShape={SessionButtonShape.Square}
buttonType={SessionButtonType.ModalConfirm}
buttonShape={SessionButtonShape.None}
onClick={noop}
dataTestId="session-tos-button"
/>
<SessionButton
text={window.i18n('privacyPolicy')}
buttonType={SessionButtonType.Simple}
buttonShape={SessionButtonShape.Square}
buttonType={SessionButtonType.ModalConfirm}
buttonShape={SessionButtonShape.None}
onClick={noop}
dataTestId="session-privacy-policy-button"
/>
</div>
</ConfirmButtonContainer>
</div>
</SessionWrapperModal>
);

@ -58,6 +58,10 @@ export const classicDark: ThemeColorVariables = {
'--button-simple-text-color': 'var(--text-primary-color)',
'--button-simple-disabled-color': 'var(--disabled-color)',
'--button-modal-confirm-background-color': 'none',
'--button-modal-confirm-background-hover-color': THEMES.CLASSIC_DARK.COLOR2,
'--button-modal-confirm-disabled-color': 'none',
'--button-icon-background-color': 'var(--transparent-color)',
'--button-icon-stroke-color': 'var(--text-secondary-color)',
'--button-icon-stroke-hover-color': 'var(--text-primary-color)',

@ -58,6 +58,10 @@ export const classicLight: ThemeColorVariables = {
'--button-simple-text-color': 'var(--text-primary-color)',
'--button-simple-disabled-color': 'var(--disabled-color)',
'--button-modal-confirm-background-color': 'none',
'--button-modal-confirm-background-hover-color': THEMES.CLASSIC_LIGHT.COLOR4,
'--button-modal-confirm-disabled-color': 'none',
'--button-icon-background-color': 'var(--transparent-color)',
'--button-icon-stroke-color': 'var(--text-secondary-color)',
'--button-icon-stroke-hover-color': 'var(--text-primary-color)',

@ -58,6 +58,10 @@ export const oceanDark: ThemeColorVariables = {
'--button-simple-text-color': 'var(--text-primary-color)',
'--button-simple-disabled-color': 'var(--disabled-color)',
'--button-modal-confirm-background-color': 'none',
'--button-modal-confirm-background-hover-color': THEMES.OCEAN_DARK.COLOR6,
'--button-modal-confirm-disabled-color': 'none',
'--button-icon-background-color': 'var(--transparent-color)',
'--button-icon-stroke-color': 'var(--text-secondary-color)',
'--button-icon-stroke-hover-color': 'var(--text-primary-color)',

@ -58,6 +58,10 @@ export const oceanLight: ThemeColorVariables = {
'--button-simple-text-color': 'var(--text-primary-color)',
'--button-simple-disabled-color': 'var(--disabled-color)',
'--button-modal-confirm-background-color': 'none',
'--button-modal-confirm-background-hover-color': THEMES.OCEAN_LIGHT.COLOR6,
'--button-modal-confirm-disabled-color': 'none',
'--button-icon-background-color': 'var(--transparent-color)',
'--button-icon-stroke-color': 'var(--text-secondary-color)',
'--button-icon-stroke-hover-color': 'var(--text-primary-color)',

@ -70,6 +70,12 @@ export type ThemeColorVariables = {
'--button-simple-text-color': string;
'--button-simple-disabled-color': string;
/* Confirm */
'--button-modal-confirm-background-color': string;
'--button-modal-confirm-background-hover-color': string;
/* Confirm buttons stay the same and rely on the disabled pointer */
'--button-modal-confirm-disabled-color': string;
/* Icons */
'--button-icon-background-color': string;
'--button-icon-stroke-color': string;

Loading…
Cancel
Save