Add 's' method to access theme props (#5163)
This commit is contained in:
@@ -4,6 +4,7 @@ import * as React from "react";
|
||||
import Dropzone from "react-dropzone";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import styled from "styled-components";
|
||||
import { s } from "@shared/styles";
|
||||
import { AttachmentPreset } from "@shared/types";
|
||||
import Flex from "~/components/Flex";
|
||||
import LoadingIndicator from "~/components/LoadingIndicator";
|
||||
@@ -114,7 +115,7 @@ const DropzoneContainer = styled.div<{
|
||||
? props.theme.secondaryBackground
|
||||
: props.theme.background};
|
||||
border-radius: 8px;
|
||||
border: 1px dashed ${(props) => props.theme.divider};
|
||||
border: 1px dashed ${s("divider")};
|
||||
padding: 52px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
@@ -122,7 +123,7 @@ const DropzoneContainer = styled.div<{
|
||||
opacity: ${(props) => (props.$disabled ? 0.5 : 1)};
|
||||
|
||||
&:hover {
|
||||
background: ${(props) => props.theme.secondaryBackground};
|
||||
background: ${s("secondaryBackground")};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import styled from "styled-components";
|
||||
import { s } from "@shared/styles";
|
||||
import Avatar, { IAvatar } from "~/components/Avatar/Avatar";
|
||||
import Flex from "~/components/Flex";
|
||||
import ImageUpload, { Props as ImageUploadProps } from "./ImageUpload";
|
||||
@@ -38,8 +39,8 @@ const ImageBox = styled(Flex)`
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 0 0 1px ${(props) => props.theme.secondaryBackground};
|
||||
background: ${(props) => props.theme.background};
|
||||
box-shadow: 0 0 0 1px ${s("secondaryBackground")};
|
||||
background: ${s("background")};
|
||||
overflow: hidden;
|
||||
|
||||
.upload {
|
||||
|
||||
@@ -5,6 +5,7 @@ import * as React from "react";
|
||||
import AvatarEditor from "react-avatar-editor";
|
||||
import Dropzone from "react-dropzone";
|
||||
import styled from "styled-components";
|
||||
import { s } from "@shared/styles";
|
||||
import { AttachmentPreset } from "@shared/types";
|
||||
import { AttachmentValidation } from "@shared/validations";
|
||||
import RootStore from "~/stores/RootStore";
|
||||
@@ -170,7 +171,7 @@ const RangeInput = styled.input`
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
border-radius: 50%;
|
||||
background: ${(props) => props.theme.text};
|
||||
background: ${s("text")};
|
||||
cursor: var(--pointer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user