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

chore: remove unused lib #1062

Merged
merged 5 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions package-lock.json

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

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"homepage": "https://github.com/decentraland/governance#readme",
"dependencies": {
"@dcl/ui-env": "1.2.1",
"@gatsbyjs/reach-router": "^1.3.6",
"@jparnaudo/react-crypto-icons": "^1.0.5",
"@snapshot-labs/snapshot.js": "0.4.52",
"@tanstack/react-query": "^4.29.7",
Expand All @@ -64,7 +63,6 @@
"dotenv": "^16.0.0",
"ethers": "^5.7.1",
"flickity": "^2.3.0",
"gatsby-link": "^4.23.0",
"gatsby": "4.23.0",
"gatsby-plugin-image": "^2.10.0",
"gatsby-plugin-manifest": "^4.10.1",
Expand Down Expand Up @@ -113,7 +111,6 @@
"@types/jest": "^26.0.24",
"@types/node": "^16.11.6",
"@types/numeral": "^2.0.1",
"@types/reach__router": "^1.3.10",
"@types/react": "^17.0.2",
"@types/react-chartjs-2": "^2.5.7",
"@types/react-dom": "^17.0.2",
Expand Down
4 changes: 0 additions & 4 deletions src/@types/gatsby__reach-router/index.d.ts

This file was deleted.

7 changes: 6 additions & 1 deletion src/components/Proposal/Comments/ProposalComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ import React from 'react'
import DOMPurify from 'dompurify'
import isEthereumAddress from 'validator/lib/isEthereumAddress'

import { getUserProfileUrl } from '../../../entities/User/utils'
import { FORUM_URL } from '../../../constants'
import useProfile from '../../../hooks/useProfile'
import Time from '../../../utils/date/Time'
import locations from '../../../utils/locations'
import Avatar from '../../Common/Avatar'
import Link from '../../Common/Typography/Link'
import Text from '../../Common/Typography/Text'
import ValidatedProfile from '../../Icon/ValidatedProfile'

import './ProposalComment.css'

function getUserProfileUrl(user: string, address?: string) {
return address ? locations.profile({ address }) : `${FORUM_URL}/u/${user}`
}

type Props = {
user: string
avatarUrl: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/Proposal/View/ProposalMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import Markdown from '../../Common/Typography/Markdown'

import './ProposalDetailSection.css'
import './ProposalMarkdown.css'

const PROPOSAL_MARKDOWN_STYLES = {
h2: 'ProposalMarkdown__Description__Title',
Expand Down
10 changes: 4 additions & 6 deletions src/components/Proposal/View/VestingContract.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
.VestingContract .dg.Paragraph {
font-size: 15px;
line-height: 24px;
.VestingContract__Description {
margin: 9px 0;
}

.VestingContract .dg.Paragraph .dg.Bold {
font-weight: var(--weight-semi-bold);
letter-spacing: -0.1px;
.VestingContract__Description__StrongText {
font-weight: var(--weight-medium) !important;
letter-spacing: -0.1px !important;
}
7 changes: 6 additions & 1 deletion src/components/Proposal/View/VestingContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ function VestingContract({ vestingAddress }: Props) {
<Pill color="green" style="shiny" size="small">
{t('page.proposal_detail.grant.vesting_label')}
</Pill>
<Markdown>{t('page.proposal_detail.grant.vesting_description')}</Markdown>
<Markdown
className="VestingContract__Description"
componentsClassNames={{ strong: 'VestingContract__Description__StrongText' }}
>
{t('page.proposal_detail.grant.vesting_description')}
</Markdown>
<Button href={url} target="_blank" rel="noopener noreferrer" primary size="small">
{t('page.proposal_detail.grant.vesting_button')}
</Button>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Search/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function handleSearch(textSearch: string, location: Location) {
navigate(locations.proposals(newParams))
}

export default function SearchInput(props: React.HTMLAttributes<HTMLDivElement>) {
export default function SearchInput(props: React.HTMLAttributes<HTMLInputElement>) {
const t = useFormatMessage()
const location = useLocation()
const { search } = useProposalsSearchParams()
Expand Down Expand Up @@ -67,7 +67,7 @@ export default function SearchInput(props: React.HTMLAttributes<HTMLDivElement>)
}

return (
<div className={'SearchContainer'}>
<div className="SearchContainer">
<input
{...props}
className={classNames('SearchInput', open && 'SearchInput--open', props.className)}
Expand Down
5 changes: 0 additions & 5 deletions src/entities/User/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { hashMessage, recoverAddress } from 'ethers/lib/utils'
import { DiscoursePostInTopic } from '../../clients/Discourse'
import { FORUM_URL } from '../../constants'
import { env } from '../../utils/env'
import locations from '../../utils/locations'
import { ProposalComment, ProposalCommentsInDiscourse } from '../Proposal/types'
import { isSameAddress } from '../Snapshot/utils'

Expand All @@ -18,10 +17,6 @@ function getDefaultAvatarSizeUrl(avatar_url: string) {
return avatar_url.replace('{size}', DEFAULT_AVATAR_SIZE)
}

export function getUserProfileUrl(user: string, address?: string) {
return address ? locations.profile({ address }) : `${FORUM_URL}/u/${user}`
}

function getAvatarUrl(post: DiscoursePostInTopic) {
const defaultSizeUrl = getDefaultAvatarSizeUrl(post.avatar_template)
return defaultSizeUrl.includes('letter') ? defaultSizeUrl : FORUM_URL + defaultSizeUrl
Expand Down
5 changes: 2 additions & 3 deletions src/migrations/1616763227514_create-proposals.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.createTable(Model.tableName, {
Expand Down
5 changes: 2 additions & 3 deletions src/migrations/1620309514931_create-scores-table.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Votes/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.createTable(Model.tableName, {
Expand Down
5 changes: 2 additions & 3 deletions src/migrations/1620612951825_create-subscriptions-table.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Subscription/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.createTable(Model.tableName, {
Expand Down
5 changes: 2 additions & 3 deletions src/migrations/1621211102392_add-index-to-proposals.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addIndex(Model.tableName, ['deleted', 'status', 'start_at'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumns(Model.tableName, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumns(Model.tableName, {
Expand Down
8 changes: 4 additions & 4 deletions src/migrations/1621389964418_fix-date-types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import ProposalModel from '../entities/Proposal/model'
import VotesModel from '../entities/Votes/model'
import SubscriptionModel from '../entities/Subscription/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.alterColumn(ProposalModel.tableName, 'start_at', { type: 'TIMESTAMPTZ' })
Expand All @@ -18,4 +17,5 @@ export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.alterColumn(SubscriptionModel.tableName, 'created_at', { type: 'TIMESTAMPTZ' })
}

export async function down(pgm: MigrationBuilder): Promise<void> {}
// eslint-disable-next-line @typescript-eslint/no-empty-function
export async function down(): Promise<void> {}
6 changes: 2 additions & 4 deletions src/migrations/1621881181594_recreate-subscriptions-table.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
/* eslint-disable @typescript-eslint/no-empty-function */

export async function up(): Promise<void> {
}
export async function up(): Promise<void> {}

export async function down(): Promise<void> {
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumns(Model.tableName, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumns(Model.tableName, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Proposal/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumns(Model.tableName, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {

Expand Down Expand Up @@ -41,9 +40,9 @@ export async function up(pgm: MigrationBuilder): Promise<void> {
UPDATE proposals SET vesting_address = '0x07b9fbb0b836f55dd4c19e79b1d673b3c83dcaaa' WHERE id = 'a37682b0-7798-11ec-8188-4352ce3d30e7';
`

pgm.sql(sql);
pgm.sql(sql)

}

export async function down(pgm: MigrationBuilder): Promise<void> {
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
export async function down(): Promise<void> {}
5 changes: 2 additions & 3 deletions src/migrations/1644958697301_add-textsearch-to-proposals.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import ProposalModel from "../entities/Proposal/model"

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.addColumns(ProposalModel.tableName, {
Expand Down
5 changes: 2 additions & 3 deletions src/migrations/1647277794115_create-proposal-updates.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/camelcase */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate';
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'
import Model from '../entities/Updates/model'

export const shorthands: ColumnDefinitions | undefined = undefined;
export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.createTable(Model.tableName, {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/locations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NavigateOptions } from '@reach/router'
import API from 'decentraland-gatsby/dist/utils/api/API'
import { navigate as gatsbyNavigate } from 'gatsby-link'
import { navigate as gatsbyNavigate } from 'gatsby'

import { HiringType, PoiType, ProposalStatus, ProposalType } from '../entities/Proposal/types'

Expand Down