Skip to content
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

Refactor/replace markdown #1046

Merged
merged 48 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
41891fa
refactor: markdown component WIP
Jun 21, 2023
79ac2bb
refactor: markdown component v1
1emu Jun 21, 2023
96fe405
refactor: heading css and markdown changes
1emu Jun 21, 2023
7fd1e9f
refactor: update link component
1emu Jun 22, 2023
1ce86c5
refactor: markdown replacement test
1emu Jun 22, 2023
ae60b2e
Merge remote-tracking branch 'upstream/master' into refactor/replace-…
1emu Jun 22, 2023
828dfd4
refactor: add as span to text, Markdown improvements
1emu Jun 22, 2023
eca9fd2
refactor: add List component
1emu Jun 23, 2023
cf867b8
refactor: replace markdown in updates
1emu Jun 23, 2023
38df696
refactor: replace markdown in category banner
1emu Jun 23, 2023
f56a6d1
refactor: replace markdown in helper and helpertext
1emu Jun 23, 2023
be76a8b
refactor: replace markdown in proposal view
1emu Jun 23, 2023
86f3577
refactor: replace markdown in grant submit
1emu Jun 23, 2023
2d9c5e8
refactor: replace markdown in snapshot redirect
1emu Jun 23, 2023
5223c84
refactor: replace markdown in UpdateProposalStatusModal
1emu Jun 23, 2023
78cf8bb
refactor: replace markdown in proposal submit pages
1emu Jun 23, 2023
e3f1d93
refactor: replace markdown in home section header
1emu Jun 23, 2023
46b8d18
refactor: address pr comments, replace components in ExternalLinkWarn…
1emu Jun 26, 2023
a5dfc90
refactor: add new font size for headings, replace markdown and headin…
1emu Jun 26, 2023
9d1e266
refactor: semi-bold header in external link
1emu Jun 26, 2023
ecb6d70
refactor: VotingPowerDelegationCandidatesList & copy fix
1emu Jun 26, 2023
0c68940
refactor: replace markdown in sublabel
1emu Jun 26, 2023
0d95601
refactor: replace markdown in error message
1emu Jun 26, 2023
13d5cf3
refactor: replace markdown in components wip
1emu Jun 26, 2023
73e7057
refactor: replace markdown in components wip
1emu Jun 26, 2023
f58aafc
refactor: replace markdown in GrantBeneficiaryItem
1emu Jun 27, 2023
7296078
refactor: replace markdown in BudgetInput
1emu Jun 27, 2023
d5dd52e
refactor: replace markdown in SidebarSnapshotRedirect
1emu Jun 27, 2023
4382603
refactor: remove unnecessary defaults
1emu Jun 27, 2023
44bbbae
refactor: replace markdown in IdentityConnectModal
1emu Jun 27, 2023
1f77641
refactor: replace markdown in PostConnection
1emu Jun 27, 2023
62d96cc
refactor: replace markdown in ProposalProcess
1emu Jun 27, 2023
ee4f7a1
refactor: replace markdown in GetInvolvedQuestion
1emu Jun 27, 2023
5d217dd
refactor: replace markdown in NumberSelector
1emu Jun 27, 2023
40f2fb9
refactor: normalize font weights
1emu Jun 27, 2023
85574ab
refactor: normalize font weights
1emu Jun 27, 2023
47f1339
Merge remote-tracking branch 'upstream/master' into refactor/replace-…
1emu Jun 27, 2023
83fd0a4
refactor: rename Text to Typography and move some components there 2
1emu Jun 27, 2023
a95227f
refactor: Link styles
1emu Jun 27, 2023
a30d086
refactor: move ListItem
1emu Jun 29, 2023
6d7a539
refactor: rename font weight 300
1emu Jun 29, 2023
b7da295
refactor: rename font weight 400
1emu Jun 29, 2023
903ecab
refactor: rename font weight 600
1emu Jun 29, 2023
e9d63f3
refactor: add medium font weight var
1emu Jun 29, 2023
6952a6a
refactor: replace font weight 400
1emu Jun 29, 2023
fbf28f5
refactor: replace font weight 600
1emu Jun 29, 2023
655c5f0
refactor: extract repeated markdowns to ProposalMarkdown
1emu Jun 29, 2023
fd9321a
Merge remote-tracking branch 'upstream/master' into refactor/replace-…
1emu Jun 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"react-hook-form": "^7.43.5",
"react-intl": "^6.4.4",
"react-loading-skeleton": "^3.1.0",
"react-markdown": "^7.1.2",
"react-select": "^5.3.2",
"remark-parse": "^9.0.0",
"remark-stringify": "^9.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/components/ActionCard/ActionCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

.ui.card.ActionCard h3 {
font-style: normal;
font-weight: 600;
font-weight: var(--weight-semi-bold);
font-size: 15px;
margin: 0;
}

.ui.card.ActionCard p {
font-style: normal;
font-weight: 400;
font-weight: var(--weight-normal);
font-size: 15px;
line-height: 24px;
margin: 0;
Expand Down Expand Up @@ -53,7 +53,7 @@
border-radius: 4px;
color: var(--white-900);
font-style: normal;
font-weight: 600;
font-weight: var(--weight-semi-bold);
font-size: 10px;
letter-spacing: -0.2px;
text-transform: uppercase;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useState } from 'react'
import { Button } from 'decentraland-ui/dist/components/Button/Button'
import { Close } from 'decentraland-ui/dist/components/Close/Close'

import Text from '../Common/Text/Text'
import Text from '../Common/Typography/Text'

import './Banner.css'

Expand Down
18 changes: 4 additions & 14 deletions src/components/Category/CategoryBanner.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
.CategoryBanner {
width: 100%;
height: 100%;
padding: 20px;
display: flex;
align-items: center;
align-content: stretch;
position: relative;
padding: 16px 20px;
background-color: transparent;
margin-bottom: 8px;
cursor: default;
background-color: var(--background-disabled);
border-radius: 8px;
background-color: var(--background-disabled);
}

.CategoryBanner__Icon {
Expand Down Expand Up @@ -42,7 +40,7 @@
border-radius: 4px;
z-index: 1;
padding: 4px 5px;
font-weight: 600;
font-weight: var(--weight-semi-bold);
font-size: 10px;
line-height: 5px;
letter-spacing: -0.2px;
Expand All @@ -55,10 +53,10 @@
background-color: var(--black-400);
}

.CategoryBanner__PausedText .dg.Paragraph {
.CategoryBanner__PausedText {
margin-top: 4px;
font-size: 13px !important;
font-style: italic;
font-style: italic !important;
}

.CategoryBanner--poi,
Expand Down Expand Up @@ -163,11 +161,3 @@
height: 100%;
width: auto;
}

.CategoryBanner .dg.Paragraph {
margin-bottom: 0;
}

.CategoryBanner .dg.Paragraph.Paragraph--tiny {
font-size: 15px;
}
10 changes: 6 additions & 4 deletions src/components/Category/CategoryBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'

import classNames from 'classnames'
import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown'

import { HiringType, PoiType, ProposalType, isHiringType } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
import { navigate } from '../../utils/locations'
import Link from '../Common/Link'
import Text from '../Common/Text/Text'
import Link from '../Common/Typography/Link'
import Markdown from '../Common/Typography/Markdown'
import Text from '../Common/Typography/Text'
import AddPoi from '../Icon/ProposalCategories/AddPoi'
import BanName from '../Icon/ProposalCategories/BanName'
import Catalyst from '../Icon/ProposalCategories/Catalyst'
Expand Down Expand Up @@ -99,7 +99,9 @@ export default function CategoryBanner({ active = true, isNew, type, onClick, hr
)}
</div>
<Text>{t(`category.${type}_description`)}</Text>
{!active && <Markdown className="CategoryBanner__PausedText">{t(`category.${type}_paused`)}</Markdown>}
{!active && (
<Markdown componentsClassNames={{ p: 'CategoryBanner__PausedText' }}>{t(`category.${type}_paused`)}</Markdown>
)}
</div>
</Component>
)
Expand Down
6 changes: 3 additions & 3 deletions src/components/Category/CategoryOption.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}

.CategoryOption.CategoryOption--active .dg.Paragraph.Paragraph--semi-bold {
font-weight: 500;
font-weight: var(--weight-semi-bold);
}

.CategoryOption.CategoryOption--catalyst:hover,
Expand Down Expand Up @@ -84,7 +84,7 @@
}

.CategoryOption__Counter {
font-weight: 600;
font-weight: var(--weight-semi-bold);
font-size: 10px;
line-height: 13px;
color: var(--black-600);
Expand Down Expand Up @@ -138,7 +138,7 @@
.CategoryOption__SubcategoryItem:hover,
.CategoryOption__SubcategoryItem--active {
color: var(--black-800);
font-weight: 500;
font-weight: var(--weight-semi-bold);
}

.CategoryOption__SubcategoryItem--active {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Category/CategoryOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ProposalType, toProposalType } from '../../entities/Proposal/types'
import { CategoryIconVariant } from '../../helpers/styles'
import useFormatMessage from '../../hooks/useFormatMessage'
import { navigate } from '../../utils/locations'
import Text from '../Common/Text/Text'
import Text from '../Common/Typography/Text'
import Arrow from '../Icon/Arrow'
import All from '../Icon/ProposalCategories/All'
import Grant from '../Icon/ProposalCategories/Grant'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Category/CategoryPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media'

import { ProposalType } from '../../entities/Proposal/types'
import locations from '../../utils/locations'
import Link from '../Common/Link'
import Pill, { PillColor } from '../Common/Pill'
import Link from '../Common/Typography/Link'

const ColorsConfig: Record<ProposalType, PillColor> = {
[ProposalType.POI]: PillColor.Green,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/ArticleSectionHeading.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
margin-bottom: 1rem;
font-size: 13px;
color: var(--black-600);
font-weight: 600;
font-weight: var(--weight-semi-bold);
text-transform: uppercase;
}
4 changes: 2 additions & 2 deletions src/components/Common/BoxTabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
border-left: none;
border-bottom: 2px solid var(--primary);
color: var(--black-800) !important;
font-weight: 500 !important;
font-weight: var(--weight-medium) !important;
}

.BoxTabs .tab {
display: flex;
align-items: center;
padding: 7px 0;
font-size: 13px !important;
font-weight: 500 !important;
font-weight: var(--weight-medium) !important;
line-height: 18px;
text-transform: uppercase !important;
color: var(--black-600) !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

.DistributionBarPopup__Title {
line-height: 18px;
font-weight: 400;
font-weight: var(--weight-normal);
font-size: 13px;
text-transform: uppercase;
font-style: normal;
Expand All @@ -26,7 +26,7 @@

.DistributionBarPopup__Content {
font-style: normal;
font-weight: 600;
font-weight: var(--weight-semi-bold);
font-size: 15px;
letter-spacing: 0.4px;
color: var(--white-900);
Expand Down
12 changes: 6 additions & 6 deletions src/components/Common/Empty.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
height: 100%;
}

.Empty .ui.header {
.Empty__Header {
margin-top: 0;
margin-bottom: 7px;
}

.Empty .dg.Paragraph {
.Empty__Description {
margin-bottom: 0 !important;
font-size: 15px;
line-height: 24px;
Expand All @@ -23,10 +23,10 @@
margin-bottom: 24px;
}

.Empty__Action {
margin-top: 15px !important;
.Empty__Link {
text-transform: uppercase;
}

.Empty .Link {
text-transform: uppercase;
.Empty__Action {
margin-top: 15px !important;
}
18 changes: 12 additions & 6 deletions src/components/Common/Empty.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import React from 'react'

import classNames from 'classnames'
import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown'
import { Button } from 'decentraland-ui/dist/components/Button/Button'
import { Header } from 'decentraland-ui/dist/components/Header/Header'

import Watermelon from '../Icon/Watermelon'

import Heading from './Typography/Heading'
import Link from './Typography/Link'
import Markdown from './Typography/Markdown'

import './Empty.css'
import Link from './Link'

export enum ActionType {
BUTTON,
LINK,
}

interface Props {
title?: string | null
description?: string | null
Expand Down Expand Up @@ -41,10 +43,14 @@ export default function Empty({
return (
<div className={classNames('Empty', className)}>
{icon ? icon : <Watermelon />}
{!!title && <Header>{title}</Header>}
{!!description && <Markdown>{description}</Markdown>}
{!!title && (
<Heading size="sm" weight="semi-bold" className="Empty__Header">
{title}
</Heading>
)}
{!!description && <Markdown componentsClassNames={{ p: 'Empty__Description' }}>{description}</Markdown>}
{showAction && actionType === ActionType.LINK && (
<Link className="Empty__Action" href={linkHref} onClick={onLinkClick}>
<Link className={classNames('Empty__Action', 'Empty__Link')} href={linkHref} onClick={onLinkClick}>
{linkText}
</Link>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Pill.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
padding: 0 8px;
border-radius: 42px;
border: 1px solid;
font-weight: 600;
font-weight: var(--weight-semi-bold);
text-transform: uppercase;
}

Expand Down
11 changes: 4 additions & 7 deletions src/components/Common/SubLabel.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
.SubLabel {
margin-bottom: 15px;
font-weight: var(--weight-normal) !important;
line-height: 20px !important;
}

.SubLabel,
.SubLabel .dg.Paragraph {
font-style: normal;
font-weight: 400;
font-size: 15px;
line-height: 20px !important;
color: var(--black-600);
.SubLabel, .SubLabel__Strong {
color: var(--black-600) !important;
}
11 changes: 7 additions & 4 deletions src/components/Common/SubLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'

import Markdown from 'decentraland-gatsby/dist/components/Text/Markdown'

import Text from './Text/Text'
import Markdown from './Typography/Markdown'
import Text from './Typography/Text'

import './SubLabel.css'

Expand All @@ -13,7 +12,11 @@ interface Props {

const SubLabel = ({ children, isMarkdown }: Props) => {
if (isMarkdown) {
return <Markdown className="SubLabel">{children}</Markdown>
return (
<Markdown className="SubLabel" componentsClassNames={{ p: 'SubLabel', strong: 'SubLabel__Strong' }}>
{children}
</Markdown>
)
}

return (
Expand Down
Loading