Skip to content

Commit

Permalink
refactor: remove unused component and reorder files
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp committed Sep 11, 2023
1 parent a9a0d7d commit 528771c
Show file tree
Hide file tree
Showing 37 changed files with 32 additions and 86 deletions.
2 changes: 1 addition & 1 deletion src/components/AddressSelect/AddressesSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext
import isEthereumAddress from 'validator/lib/isEthereumAddress'

import useFormatMessage from '../../hooks/useFormatMessage'
import Username from '../User/Username'
import Username from '../Common/Username'

import './AddressesSelect.css'

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Delegation/DelegatesTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Table } from 'decentraland-ui/dist/components/Table/Table'

import { Delegate } from '../../hooks/useDelegatesInfo'
import Time, { abbreviateTimeDifference } from '../../utils/date/Time'
import Username from '../Common/Username'
import Arrow from '../Icon/Arrow'
import Username from '../User/Username'

import './DelegatesTable.css'
import './DelegatesTableRow.css'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Delegation/DelegatorCardProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useIntl } from 'react-intl'
import useFormatMessage from '../../hooks/useFormatMessage'
import locations from '../../utils/locations'
import Link from '../Common/Typography/Link'
import Username from '../Common/Username'
import ChevronRightCircleOutline from '../Icon/ChevronRightCircleOutline'
import Username from '../User/Username'

import './DelegatorCardProfile.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Delegation/VotingPowerListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react'

import classNames from 'classnames'

import Username from '../Common/Username'
import VotingPower from '../Token/VotingPower'
import Username from '../User/Username'

import './VotingPowerListItem.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/OpenProposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Time from '../../utils/date/Time'
import locations from '../../utils/locations'
import CategoryPill from '../Category/CategoryPill'
import Link from '../Common/Typography/Link'
import Username from '../Common/Username'
import ChevronRight from '../Icon/ChevronRight'
import Username from '../User/Username'

import './OpenProposal.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/TopVotersRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import { Header } from 'decentraland-ui/dist/components/Header/Header'
import { Table } from 'decentraland-ui/dist/components/Table/Table'

import Username from '../User/Username'
import Username from '../Common/Username'

interface Props {
address: string
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Modal/Votes/VoteListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { abbreviateNumber } from '../../../entities/Votes/utils'
import useFormatMessage from '../../../hooks/useFormatMessage'
import locations, { navigate } from '../../../utils/locations'
import { formatChoice } from '../../../utils/votes/utils'
import Username from '../../User/Username'
import Username from '../../Common/Username'

export type VoteListItemModalProps = {
address: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import useVotesMatch from '../../../hooks/useVotesMatch'
import useVotingPowerDistribution from '../../../hooks/useVotingPowerDistribution'
import Time from '../../../utils/date/Time'
import Divider from '../../Common/Divider'
import Username from '../../Common/Username'
import ChevronLeft from '../../Icon/ChevronLeft'
import VotingPower from '../../Token/VotingPower'
import Username from '../../User/Username'
import { Candidate } from '../VotingPowerDelegationModal/VotingPowerDelegationCandidatesList'

import CandidateDetails from './CandidateDetails'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Profile/GrantBeneficiaryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import { abbreviateTimeDifference, formatDate } from '../../utils/date/Time'
import locations from '../../utils/locations'
import Link from '../Common/Typography/Link'
import Markdown from '../Common/Typography/Markdown'
import Username from '../Common/Username'
import ChevronRightCircleOutline from '../Icon/ChevronRightCircleOutline'
import CliffProgress from '../Projects/ProjectCard/CliffProgress'
import ProgressBarTooltip from '../Projects/ProjectCard/ProgressBarTooltip'
import VestingProgress from '../Projects/ProjectCard/VestingProgress'
import ProjectPill from '../Projects/ProjectPill'
import Username from '../User/Username'

import './GrantBeneficiaryItem.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Projects/ProjectCard/ProjectCardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useIntl } from 'react-intl'

import { ProjectWithUpdate } from '../../../entities/Proposal/types'
import useFormatMessage from '../../../hooks/useFormatMessage'
import Username from '../../User/Username'
import Username from '../../Common/Username'
import ProjectPill from '../ProjectPill'

import './ProjectCardHeader.css'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames'
import { Header } from 'decentraland-ui/dist/components/Header/Header'

import { ProjectWithUpdate } from '../../../entities/Proposal/types'
import Username from '../../User/Username'
import Username from '../../Common/Username'

import './ProjectCardHeadline.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Proposal/ProposalItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import useWinningChoice from '../../hooks/useWinningChoice'
import locations from '../../utils/locations'
import CategoryPill from '../Category/CategoryPill'
import Link from '../Common/Typography/Link'
import Username from '../Common/Username'
import Subscribe from '../Icon/Subscribe'
import Subscribed from '../Icon/Subscribed'
import CoauthorRequestLabel from '../Status/CoauthorRequestLabel'
import FinishLabel from '../Status/FinishLabel'
import LeadingOption from '../Status/LeadingOption'
import StatusPill from '../Status/StatusPill'
import Username from '../User/Username'

import './ProposalItem.css'

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { Fragment } from 'react'

import { Reaction } from '../../../entities/SurveyTopic/types'
import useFormatMessage from '../../../hooks/useFormatMessage'
import Pipe from '../../Common/Pipe'

import Pipe from './Pipe'
import ReactionCounter from './ReactionCounter'
import './SurveyTopicResult.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Proposal/View/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { useProposalDateText } from '../../../hooks/useProposalDateText'
import useProposalVotes from '../../../hooks/useProposalVotes'
import useWinningChoice from '../../../hooks/useWinningChoice'
import Link from '../../Common/Typography/Link'
import Username from '../../Common/Username'
import ChevronRight from '../../Icon/ChevronRight'
import Username from '../../User/Username'

import './ProposalCard.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Proposal/View/ProposalDetailCoauthors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Popup } from 'decentraland-ui/dist/components/Popup/Popup'

import { CoauthorAttributes, CoauthorStatus } from '../../../entities/Coauthor/types'
import useFormatMessage from '../../../hooks/useFormatMessage'
import Username from '../../Common/Username'
import Cancel from '../../Icon/Cancel'
import Check from '../../Icon/Check'
import Warning from '../../Icon/Warning'
import Username from '../../User/Username'

import './ProposalDetailCoauthors.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Proposal/View/ProposalDetailSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import useFormatMessage from '../../../hooks/useFormatMessage'
import Time from '../../../utils/date/Time'
import DateTooltip from '../../Common/DateTooltip'
import Link from '../../Common/Typography/Link'
import Username from '../../Common/Username'
import Open from '../../Icon/Open'
import Username from '../../User/Username'

import ProposalDetailCoauthors from './ProposalDetailCoauthors'
import './ProposalDetailSection.css'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames'
import { Button, ButtonProps } from 'decentraland-ui/dist/components/Button/Button'

import { ChoiceColor } from '../../../../entities/Votes/types'
import Username from '../../../User/Username'
import Username from '../../../Common/Username'
import TextWithTooltip from '../TextWithTooltip'

import './ChoiceButton.css'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Popup } from 'decentraland-ui/dist/components/Popup/Popup'

import useFormatMessage from '../../../../hooks/useFormatMessage'
import Markdown from '../../../Common/Typography/Markdown'
import Username from '../../../Common/Username'
import Info from '../../../Icon/Info'
import VotingPower from '../../../Token/VotingPower'
import Username from '../../../User/Username'

import './DelegationsLabel.css'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Updates/UpdateMarkdownView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import DateTooltip from '../Common/DateTooltip'
import Divider from '../Common/Divider'
import Markdown from '../Common/Typography/Markdown'
import Text from '../Common/Typography/Text'
import Username from '../Common/Username'
import { ContentSection } from '../Layout/ContentLayout'
import Username from '../User/Username'

import ProjectHealthStatus from './ProjectHealthStatus'
import './UpdateMarkdownView.css'
Expand Down
12 changes: 4 additions & 8 deletions src/components/User/UserStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import React, { Suspense } from 'react'
import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext'
import { Container } from 'decentraland-ui/dist/components/Container/Container'
import { Loader } from 'decentraland-ui/dist/components/Loader/Loader'
import { Mobile, NotMobile } from 'decentraland-ui/dist/components/Media/Media'
import { NotMobile, useMobileMediaQuery } from 'decentraland-ui/dist/components/Media/Media'

import { VpDistribution } from '../../clients/SnapshotGraphqlTypes'
import { isSameAddress } from '../../entities/Snapshot/utils'
import useFormatMessage from '../../hooks/useFormatMessage'
import useGovernanceProfile from '../../hooks/useGovernanceProfile'
import Username from '../Common/Username'
import VotingPowerDistribution from '../Modal/VotingPowerDelegationDetail/VotingPowerDistribution'
import { ProfileBox } from '../Profile/ProfileBox'
import ProfileSettings from '../Profile/ProfileSettings'
Expand All @@ -18,7 +19,6 @@ import Badges from './Badges/Badges'
import './UserStats.css'
import UserVotingStats from './UserVotingStats'
import UserVpStats from './UserVpStats'
import Username from './Username'
import ValidatedProfileCheck from './ValidatedProfileCheck'

interface Props {
Expand All @@ -31,6 +31,7 @@ const UserAvatar = React.lazy(() => import('./UserAvatar'))

export default function UserStats({ address, vpDistribution, isLoadingVpDistribution }: Props) {
const t = useFormatMessage()
const isMobile = useMobileMediaQuery()
const { profile, isLoadingGovernanceProfile, isProfileValidated } = useGovernanceProfile(address)
const [user] = useAuthContext()
const showSettings = isSameAddress(user, address) && !isLoadingGovernanceProfile && !isProfileValidated
Expand All @@ -40,12 +41,7 @@ export default function UserStats({ address, vpDistribution, isLoadingVpDistribu
<Container className="UserStats__Container">
<div className="UserStats__UserInfo">
<div className="UserStats__UsernameContainer">
<Mobile>
<Username address={address} size="small" className="UserStats__Username" />
</Mobile>
<NotMobile>
<Username address={address} size="medium" className="UserStats__Username" />
</NotMobile>
<Username address={address} size={isMobile ? 'small' : 'medium'} className="UserStats__Username" />
<ValidatedProfileCheck forumUsername={profile?.forum_username} isLoading={isLoadingGovernanceProfile} />
{showSettings && <ProfileSettings />}
</div>
Expand Down
23 changes: 0 additions & 23 deletions src/components/Welcome/WelcomeItem.css

This file was deleted.

27 changes: 0 additions & 27 deletions src/components/Welcome/WelcomeItem.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/submit/ban-name.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { NewProposalBanName, newProposalBanNameScheme } from '../../entities/Proposal/types'
import { isAlreadyBannedName, isValidName } from '../../entities/Proposal/utils'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/bid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import DecentralandLogo from '../../components/Icon/DecentralandLogo'
import OpenExternalLink from '../../components/Icon/OpenExternalLink'
import { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/User/LogIn'
import LogIn from '../../components/Layout/LogIn'
import { BID_MIN_PROJECT_DURATION } from '../../entities/Bid/constants'
import { BidRequest } from '../../entities/Bid/types'
import { asNumber, userModifiedForm } from '../../entities/Proposal/utils'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/draft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { SUBMISSION_THRESHOLD_DRAFT } from '../../entities/Proposal/constants'
import { NewProposalDraft, newProposalDraftScheme } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/governance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { SUBMISSION_THRESHOLD_GOVERNANCE } from '../../entities/Proposal/constants'
import { NewProposalDraft, NewProposalGovernance, newProposalGovernanceScheme } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/grant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import GrantRequestTeamSection, {
import DecentralandLogo from '../../components/Icon/DecentralandLogo'
import { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CategorySelector from '../../components/Projects/CategorySelector'
import LogIn from '../../components/User/LogIn'
import { GrantRequest, GrantRequestCategoryAssessment, NewGrantCategory } from '../../entities/Grant/types'
import { ProposalType } from '../../entities/Proposal/types'
import { asNumber, isGrantProposalSubmitEnabled, userModifiedForm } from '../../entities/Proposal/utils'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/linked-wearables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import PostLabel from '../../components/PostLabel'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { newProposalLinkedWearablesScheme } from '../../entities/Proposal/types'
import { asNumber, isValidImage } from '../../entities/Proposal/utils'
import { disableOnWheelInput, isHttpsURL } from '../../helpers'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/pitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import PostLabel from '../../components/PostLabel'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { SUBMISSION_THRESHOLD_PITCH } from '../../entities/Proposal/constants'
import { NewProposalPitch, newProposalPitchScheme } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/poll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { SUBMISSION_THRESHOLD_POLL } from '../../entities/Proposal/constants'
import { INVALID_PROPOSAL_POLL_OPTIONS, newProposalPollScheme } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/submit/tender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import ErrorMessage from '../../components/Error/ErrorMessage'
import MarkdownNotice from '../../components/Form/MarkdownNotice'
import ContentLayout, { ContentSection } from '../../components/Layout/ContentLayout'
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import LogIn from '../../components/User/LogIn'
import { SUBMISSION_THRESHOLD_PITCH } from '../../entities/Proposal/constants'
import { NewProposalTender, newProposalTenderScheme } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down

0 comments on commit 528771c

Please sign in to comment.