move a part of SessionSrollButton to styled component

pull/1387/head
Audric Ackermann 5 years ago
parent 857bea50ea
commit e0fd910fa4
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -32,12 +32,7 @@
UNRESTRICTED: 3, UNRESTRICTED: 3,
}; };
const { const { Conversation, Contact, Message, PhoneNumber } = window.Signal.Types;
Conversation,
Contact,
Message,
PhoneNumber,
} = window.Signal.Types;
const { const {
upgradeMessageSchema, upgradeMessageSchema,
loadAttachmentData, loadAttachmentData,

@ -1335,12 +1335,7 @@ input {
} }
} }
.session-scroll-button { .messages-container {
animation: fadein $session-fadein-duration;
position: fixed;
z-index: 2;
right: 60px;
.session-icon-button { .session-icon-button {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -1349,12 +1344,16 @@ input {
width: 40px; width: 40px;
border-radius: 50%; border-radius: 50%;
opacity: 1; opacity: 1;
background-color: $session-shade-2; @include themify($themes) {
box-shadow: 0px 0px 10px 0px rgba($session-color-white, 0.1); background-color: themed('cellBackground');
box-shadow: themed('sessionShadow');
}
svg path { svg path {
transition: $session-transition-duration; transition: $session-transition-duration;
opacity: 0.6; opacity: 0.6;
@include themify($themes) {
fill: themed('textColor');
}
} }
&:hover svg path { &:hover svg path {

@ -110,6 +110,7 @@ $session-compose-margin: 20px;
width: $session-left-pane-sections-container-width; width: $session-left-pane-sections-container-width;
display: inline-flex; display: inline-flex;
flex-direction: column; flex-direction: column;
overflow: auto;
@include themify($themes) { @include themify($themes) {
border-right: themed('sessionBorder'); border-right: themed('sessionBorder');
} }

@ -1,31 +1,34 @@
import React from 'react'; import React, { useContext } from 'react';
import styled, { ThemeContext } from 'styled-components';
import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; import { SessionIconButton, SessionIconSize, SessionIconType } from './icon';
interface Props { type Props = {
onClick?: () => any; onClick?: () => any;
show?: boolean; show?: boolean;
} };
export class SessionScrollButton extends React.PureComponent<Props> { const SessionScrollButtonDiv = styled.div`
constructor(props: any) { position: fixed;
super(props); z-index: 2;
} right: 60px;
animation: fadein ${props => props.theme.common.animations.defaultDuration};
`;
public render() { export const SessionScrollButton = (props: Props) => {
return ( const themeContext = useContext(ThemeContext);
<>
{this.props.show && ( return (
<div className="session-scroll-button"> <>
<SessionIconButton {props.show && (
iconType={SessionIconType.Chevron} <SessionScrollButtonDiv theme={themeContext}>
iconSize={SessionIconSize.Huge} <SessionIconButton
iconColor={'#FFFFFF'} iconType={SessionIconType.Chevron}
onClick={this.props.onClick} iconSize={SessionIconSize.Huge}
/> onClick={props.onClick}
</div> />
)} </SessionScrollButtonDiv>
</> )}
); </>
} );
} };

@ -25,6 +25,9 @@ const common = {
md: '15px', md: '15px',
lg: '20px', lg: '20px',
}, },
animations: {
defaultDuration: '0.25s',
},
}; };
export const lightTheme: DefaultTheme = { export const lightTheme: DefaultTheme = {

3
ts/styled.d.ts vendored

@ -14,6 +14,9 @@ declare module 'styled-components' {
md: string; md: string;
lg: string; lg: string;
}; };
animations: {
defaultDuration: string;
};
}; };
colors: { colors: {
accent: string; accent: string;

Loading…
Cancel
Save