-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪟🔧 Remove styled components (round 1) #18766
Changes from all commits
848cb5c
781868f
71da962
89d9d80
b70a9d7
d9663cd
ba7e41c
b319aa9
8ca43a4
ad4c37e
27c7f81
d193186
f145055
362d823
ad89b4a
d56a1c5
cb7a03f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@use "scss/colors"; | ||
|
||
.editorHeader { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
flex-direction: row; | ||
color: colors.$dark-blue-900; | ||
font-weight: 500; | ||
font-size: 14px; | ||
line-height: 17px; | ||
margin: 5px 0 10px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The spacing variables can be used here. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
.buttonWithMargin { | ||
margin-right: 12px; | ||
} | ||
|
||
.content { | ||
width: 585px; | ||
font-size: 14px; | ||
padding: 25px; | ||
white-space: pre-line; | ||
} | ||
|
||
.buttonContent { | ||
margin-top: 26px; | ||
display: flex; | ||
justify-content: flex-end; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
import React from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
import styled from "styled-components"; | ||
|
||
import { Button } from "components/ui/Button"; | ||
import { Modal } from "components/ui/Modal"; | ||
|
||
import useLoadingState from "../../../hooks/useLoadingState"; | ||
import styles from "./ConfirmationModal.module.scss"; | ||
|
||
const Content = styled.div` | ||
width: 585px; | ||
font-size: 14px; | ||
padding: 25px; | ||
white-space: pre-line; | ||
`; | ||
|
||
const ButtonContent = styled.div` | ||
margin-top: 26px; | ||
display: flex; | ||
justify-content: flex-end; | ||
`; | ||
|
||
export interface ConfirmationModalProps { | ||
onClose: () => void; | ||
title: string; | ||
|
@@ -45,9 +31,9 @@ export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ | |
|
||
return ( | ||
<Modal onClose={onClose} title={<FormattedMessage id={title} />}> | ||
<Content> | ||
<div className={styles.content}> | ||
<FormattedMessage id={text} /> | ||
<ButtonContent> | ||
<div className={styles.buttonContent}> | ||
Comment on lines
+34
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could probably be switched to use ModalBody and ModalFooter instead (these were created after this component) |
||
<Button | ||
className={styles.buttonWithMargin} | ||
onClick={onClose} | ||
|
@@ -60,8 +46,8 @@ export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ | |
<Button variant="danger" onClick={onSubmitBtnClick} data-id={submitButtonDataId} isLoading={isLoading}> | ||
<FormattedMessage id={submitButtonText} /> | ||
</Button> | ||
</ButtonContent> | ||
</Content> | ||
</div> | ||
</div> | ||
</Modal> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.content { | ||
height: 25px; | ||
width: 25px; | ||
overflow: hidden; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import { getIcon } from "utils/imageUtils"; | ||
|
||
import styles from "./ConnectorIcon.module.scss"; | ||
|
||
interface Props { | ||
icon?: string; | ||
className?: string; | ||
small?: boolean; | ||
} | ||
|
||
export const Content = styled.div` | ||
height: 25px; | ||
width: 25px; | ||
overflow: hidden; | ||
`; | ||
|
||
export const ConnectorIcon: React.FC<Props> = ({ icon, className }) => ( | ||
<Content className={className} aria-hidden="true"> | ||
export const ConnectorIcon: React.FC<Props> = ({ icon }) => ( | ||
<div className={styles.content} aria-hidden="true"> | ||
{getIcon(icon)} | ||
</Content> | ||
</div> | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@use "scss/colors"; | ||
|
||
.deleteBlock { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could also be |
||
margin-top: 12px; | ||
padding: 19px 20px 20px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.text { | ||
font-size: 11px; | ||
line-height: 13px; | ||
color: colors.$grey-300; | ||
white-space: pre-line; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@use "scss/colors"; | ||
|
||
.content { | ||
padding: 74px 0 111px; | ||
text-align: center; | ||
font-size: 20px; | ||
line-height: 27px; | ||
color: colors.$dark-blue-900; | ||
} | ||
|
||
.imgBlock { | ||
height: 80px; | ||
width: 80px; | ||
border-radius: 50%; | ||
background: colors.$grey-100; | ||
margin: 0 auto 10px; | ||
text-align: center; | ||
padding: 20px 0; | ||
} | ||
|
||
.description { | ||
font-weight: normal; | ||
font-size: 14px; | ||
line-height: 19px; | ||
Comment on lines
+22
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be replaceable with a Text component |
||
color: colors.$grey-500; | ||
margin-top: 5px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This along other parts of this SCSS can use the spacing variables |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,18 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import styles from "./EmptyResourceBlock.module.scss"; | ||
|
||
interface EmptyResourceBlockProps { | ||
text: React.ReactNode; | ||
description?: React.ReactNode; | ||
} | ||
|
||
const Content = styled.div` | ||
padding: 74px 0 111px; | ||
text-align: center; | ||
font-size: 20px; | ||
line-height: 27px; | ||
color: ${({ theme }) => theme.textColor}; | ||
`; | ||
|
||
const ImgBlock = styled.div` | ||
height: 80px; | ||
width: 80px; | ||
border-radius: 50%; | ||
background: ${({ theme }) => theme.greyColor20}; | ||
margin: 0 auto 10px; | ||
text-align: center; | ||
padding: 20px 0; | ||
`; | ||
|
||
const Description = styled.div` | ||
font-weight: normal; | ||
font-size: 14px; | ||
line-height: 19px; | ||
color: ${({ theme }) => theme.greyColor60}; | ||
margin-top: 5px; | ||
`; | ||
|
||
export const EmptyResourceBlock: React.FC<EmptyResourceBlockProps> = ({ text, description }) => ( | ||
<Content> | ||
<ImgBlock> | ||
<div className={styles.content}> | ||
<div className={styles.imgBlock}> | ||
<img src="/cactus.png" height={40} alt="cactus" /> | ||
</ImgBlock> | ||
</div> | ||
{text} | ||
<Description>{description}</Description> | ||
</Content> | ||
<div className={styles.description}>{description}</div> | ||
</div> | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.content { | ||
height: 100%; | ||
width: 100%; | ||
padding: 34px 0 13px; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
|
||
.logoImg { | ||
width: 90px; | ||
height: 94px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.mainInfo { | ||
min-width: 550px; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,21 @@ | ||
import React from "react"; | ||
import { useIntl } from "react-intl"; | ||
import { Link } from "react-router-dom"; | ||
import styled from "styled-components"; | ||
|
||
import { Version } from "../Version"; | ||
|
||
const Content = styled.div` | ||
height: 100%; | ||
width: 100%; | ||
padding: 34px 0 13px; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
`; | ||
|
||
const LogoImg = styled.img` | ||
width: 90px; | ||
height: 94px; | ||
margin-bottom: 20px; | ||
`; | ||
|
||
const MainInfo = styled.div` | ||
min-width: 550px; | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
`; | ||
import styles from "./BaseClearView.module.scss"; | ||
|
||
export const BaseClearView: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => { | ||
const { formatMessage } = useIntl(); | ||
return ( | ||
<Content> | ||
<MainInfo> | ||
<div className={styles.content}> | ||
<div className={styles.mainInfo}> | ||
<Link to=".."> | ||
<LogoImg src="/logo.png" alt={formatMessage({ id: "ui.goBack" })} /> | ||
<img className={styles.logoImg} src="/logo.png" alt={formatMessage({ id: "ui.goBack" })} /> | ||
</Link> | ||
{children} | ||
</MainInfo> | ||
</div> | ||
<Version /> | ||
</Content> | ||
</div> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the EditorHeader style have a similar style to one of the Text or Heading components?