Skip to content

Commit

Permalink
refactor: remove alias imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed May 12, 2024
1 parent 776d53b commit 8bb4745
Show file tree
Hide file tree
Showing 181 changed files with 572 additions and 663 deletions.
3 changes: 1 addition & 2 deletions apps/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
"storybook": "^7.6.5",
"typescript": "^5.4.5",
"vite": "^5.2.9",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2"
"vite-plugin-svgr": "^4.2.0"
}
}
10 changes: 5 additions & 5 deletions apps/portal/src/App.Theme.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import '@talismn/ui/assets/css/talismn.css'

import ATApocRevelations from '@assets/fonts/AT-Apoc-Revelations.woff'
import SurtRegular from '@assets/fonts/Surt-Regular.woff'
import SurtSemiBold from '@assets/fonts/Surt-SemiBold.woff2'
import SurtSemiBoldExpanded from '@assets/fonts/Surt-SemiBoldExp.woff2'
import SurtSemiBoldExtended from '@assets/fonts/Surt-SemiBoldExtended.woff2'
import { Global, css } from '@emotion/react'
import { ThemeProvider, theme, type Theme } from '@talismn/ui'
import { type PropsWithChildren } from 'react'
import ATApocRevelations from './assets/fonts/AT-Apoc-Revelations.woff'
import SurtRegular from './assets/fonts/Surt-Regular.woff'
import SurtSemiBold from './assets/fonts/Surt-SemiBold.woff2'
import SurtSemiBoldExpanded from './assets/fonts/Surt-SemiBoldExp.woff2'
import SurtSemiBoldExtended from './assets/fonts/Surt-SemiBoldExtended.woff2'

/*
base style definitions
Expand Down
24 changes: 12 additions & 12 deletions apps/portal/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ import '@polkadot/api-augment/substrate'
import '@talismn/astar-types/augment-api'
import '@talismn/astar-types/types-lookup'

import FairyBreadBanner from '@components/legacy/archetypes/FairyBreadBanner'
import { TalismanHandLoader } from '@components/legacy/TalismanHandLoader'
import ErrorBoundary from '@components/widgets/ErrorBoundary'
import Development from '@components/widgets/development'
import { AccountWatcher, SignetWatcher } from '@domains/accounts'
import { BalancesWatcher } from '@domains/balances'
import { chainDeriveState, chainQueryMultiState, chainQueryState } from '@domains/common/recoils/query'
import { ExtensionWatcher, TalismanExtensionSynchronizer } from '@domains/extension'
import { EvmProvider } from '@domains/extension/wagmi'
import * as Portfolio from '@libs/portfolio'
import TalismanProvider from '@libs/talisman'
import router from '@routes'
import { PolkadotApiProvider } from '@talismn/react-polkadot-api'
import { PostHogProvider } from 'posthog-js/react'
import { Suspense } from 'react'
import { RouterProvider } from 'react-router-dom'
import { RecoilRoot } from 'recoil'
import ThemeProvider from './App.Theme'
import { TalismanHandLoader } from './components/legacy/TalismanHandLoader'
import FairyBreadBanner from './components/legacy/archetypes/FairyBreadBanner'
import ErrorBoundary from './components/widgets/ErrorBoundary'
import Development from './components/widgets/development'
import { AccountWatcher, SignetWatcher } from './domains/accounts'
import { BalancesWatcher } from './domains/balances'
import { chainDeriveState, chainQueryMultiState, chainQueryState } from './domains/common'
import { ExtensionWatcher, TalismanExtensionSynchronizer } from './domains/extension'
import { EvmProvider } from './domains/extension/wagmi'
import * as Portfolio from './libs/portfolio'
import TalismanProvider from './libs/talisman'
import router from './routes'

const Loader = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Await.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import Loader from '@icons/loader.svg?react'
import Loader from '../../assets/icons/loader.svg?react'

export const StyledLoader = styled(({ className }: { className?: string }) => (
<div className={`await ${className ?? ''}`}>
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { device } from '@util/breakpoints'
import { device } from '../../util/breakpoints'

type BannerProps = {
backgroundImage?: string
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */
import IconLoading from '@assets/icons/loader.svg?react'
import IconLoading from '../../assets/icons/loader.svg?react'
import { css } from '@emotion/react'
import styled from '@emotion/styled'
import { omit } from 'lodash'
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/ChainLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Image } from '@components/legacy'
import { Image } from './'
import styled from '@emotion/styled'

export default styled(({ chain, type, className }: { chain: any; type: string; size?: number; className?: string }) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import Copy from '@icons/copy.svg?react'
import Copy from '../../assets/icons/copy.svg?react'

type CopyButtonProps = {
className?: string
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/components/legacy/DesktopRequired.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, useModal } from '@components/legacy'
import { Button, useModal } from './'
import styled from '@emotion/styled'
import { isMobileBrowser } from '@util/helpers'
import { isMobileBrowser } from '../../util/helpers'
import { useEffect } from 'react'
import { useTranslation } from 'react-i18next'

Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Draggable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { type DragAndDropCallbacks, useDragAndDrop } from '@util/useDragAndDrop'
import { type DragAndDropCallbacks, useDragAndDrop } from '../../util/useDragAndDrop'
import { type ReactNode, useRef } from 'react'

type DraggableProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Droppable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { type DragAndDropCallbacks, useDragAndDrop } from '@util/useDragAndDrop'
import { type DragAndDropCallbacks, useDragAndDrop } from '../../util/useDragAndDrop'
import { type ReactNode, useRef } from 'react'

type DraggableProps = {
Expand Down
10 changes: 5 additions & 5 deletions apps/portal/src/components/legacy/Field.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import IconClear from '@assets/icons/x-circle.svg?react'
import { Pill } from '@components/legacy'
import styled from '@emotion/styled'
import ChevronDown from '@icons/chevron-down.svg?react'
import SearchIcon from '@icons/search.svg?react'
import { useBoolean } from '@util/hooks'
import { useEffect } from 'react'
import ChevronDown from '../../assets/icons/chevron-down.svg?react'
import SearchIcon from '../../assets/icons/search.svg?react'
import IconClear from '../../assets/icons/x-circle.svg?react'
import { useBoolean } from '../../util/hooks'
import { Pill } from './'

// framework

Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/components/legacy/Filter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Pill } from '@components/legacy'
import { Pill } from './'
import styled from '@emotion/styled'
import { useSet } from '@util/hooks'
import { useSet } from '../../util/hooks'
import { useEffect } from 'react'

const Filter = styled(({ value = [], options = {}, className, onChange = () => {}, ...rest }: any) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/LeftRightPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import ChevronRight from '@icons/chevron-right.svg?react'
import ChevronRight from '../../assets/icons/chevron-right.svg?react'

import { ButtonIcon } from './Button'

Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import useOnClickOutside from '@util/useOnClickOutside'
import useOnClickOutside from '../../util/useOnClickOutside'
import React, { useRef, useState } from 'react'

type MenuDropdownAlignment = 'left' | 'right'
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// TODO: remove legacy modal completely

import { AlertDialog } from '@talismn/ui'
import useKeyDown from '@util/useKeyDown'
import useKeyDown from '../../util/useKeyDown'
import { createContext, useCallback, useContext, useMemo, useState, type PropsWithChildren } from 'react'

type OpenModalOptions = {
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/components/legacy/NoCrowdloansPlaceholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crowdloanRowSkeleton from '@assets/crowdloan-row-skeleton.png'
import { Placeholder } from '@components/legacy/Placeholder'
import crowdloanRowSkeleton from '../../assets/crowdloan-row-skeleton.png'
import { Placeholder } from './Placeholder'
import styled from '@emotion/styled'
import React from 'react'

Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Pendor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Loader from '@icons/loader.svg?react'
import Loader from '../../assets/icons/loader.svg?react'
import { type PropsWithChildren, type ReactElement } from 'react'

export type PendorProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { device } from '@util/breakpoints'
import { device } from '../../util/breakpoints'

type PlaceholderProps = {
className?: string
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Poster.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import useImageWithFallback from '@util/useImageWithFallback'
import useImageWithFallback from '../../util/useImageWithFallback'
import { type PropsWithChildren } from 'react'

const Poster = styled(
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/src/components/legacy/SimplePlay.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from '@emotion/styled'
import PauseCircle from '@icons/pause-circle.svg?react'
import PlayCircle from '@icons/play-circle.svg?react'
import { useAudio } from '@util/useAudio'
import PauseCircle from '../../assets/icons/pause-circle.svg?react'
import PlayCircle from '../../assets/icons/play-circle.svg?react'
import { useAudio } from '../../util/useAudio'

export const SimplePlay = styled(({ className, src }: { className?: string; src: string }) => {
const { isPlaying, togglePlay } = useAudio(src)
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/components/legacy/Tags.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Pill } from '@components/legacy'
import { Pill } from './'
import styled from '@emotion/styled'
import { useSet } from '@util/hooks'
import { useSet } from '../../util/hooks'
import { useEffect } from 'react'

type StyledNoCrowdloansPlaceholderProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/TalismanHandLike.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TalismanHandLikeImg from '@assets/thumbs_up_red.gif'
import TalismanHandLikeImg from '../../assets/thumbs_up_red.gif'
import { type ImgHTMLAttributes } from 'react'

export const TalismanHandLike = (props: ImgHTMLAttributes<HTMLImageElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/TalismanHandLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TalismanHandLoading from '@assets/spin_red.gif'
import TalismanHandLoading from '../../assets/spin_red.gif'
import { type ImgHTMLAttributes } from 'react'

export const TalismanHandLoader = (props: ImgHTMLAttributes<HTMLImageElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/legacy/Toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { useBoolean } from '@util/hooks'
import { useBoolean } from '../../util/hooks'
import { useEffect } from 'react'

export type ToggleProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCrowdloanById } from '@libs/talisman'
import { Maybe } from '@util/monads'
import { useCrowdloanById } from '../../../../libs/talisman'
import { Maybe } from '../../../../util/monads'
import { type ReactNode, useMemo } from 'react'

export type BonusProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Parachain } from '@components/legacy/archetypes'
import XCircle from '@assets/icons/x-circle.svg?react'
import { Button, DesktopRequired, Field, MaterialLoader, useModal } from '@components/legacy'
import { TalismanHandLike } from '@components/legacy/TalismanHandLike'
import { TalismanHandLoader } from '@components/legacy/TalismanHandLoader'
import { useAccountSelector } from '@components/widgets/AccountSelector'
import { writeableSubstrateAccountsState } from '@domains/accounts'
import { Parachain } from '..'
import XCircle from '../../../../assets/icons/x-circle.svg?react'
import { Button, DesktopRequired, Field, MaterialLoader, useModal } from '../..'
import { TalismanHandLike } from '../../TalismanHandLike'
import { TalismanHandLoader } from '../../TalismanHandLoader'
import { useAccountSelector } from '../../../widgets/AccountSelector'
import { writeableSubstrateAccountsState } from '../../../../domains/accounts'
import { useTheme } from '@emotion/react'
import styled from '@emotion/styled'
import { ContributeEvent, useCrowdloanContribute } from '@libs/crowdloans'
import { Acala, Moonbeam, Polkadex, overrideByIds } from '@libs/crowdloans/crowdloanOverrides'
import { useCrowdloanById } from '@libs/talisman'
import { ContributeEvent, useCrowdloanContribute } from '../../../../libs/crowdloans'
import { Acala, Moonbeam, Polkadex, overrideByIds } from '../../../../libs/crowdloans/crowdloanOverrides'
import { useCrowdloanById } from '../../../../libs/talisman'
import { CircularProgressIndicator, Text } from '@talismn/ui'
import { isMobileBrowser } from '@util/helpers'
import { Maybe } from '@util/monads'
import { isMobileBrowser } from '../../../../util/helpers'
import { Maybe } from '../../../../util/monads'
import { useCallback, useEffect, useMemo, useState, type MouseEventHandler } from 'react'
import { useTranslation } from 'react-i18next'
import { useRecoilValue } from 'recoil'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Countdown as Cd, Pendor } from '@components/legacy'
import { Countdown as Cd, Pendor } from '../..'
import styled from '@emotion/styled'
import { useChainmetaValue, useCrowdloanById } from '@libs/talisman'
import { useChainmetaValue, useCrowdloanById } from '../../../../libs/talisman'
import { type ReactNode, useEffect, useState } from 'react'

type OngoingProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Crowdloan } from '@components/legacy/archetypes'
import { Await, Field, Grid, NoResults } from '@components/legacy'
import { Crowdloan } from '..'
import { Await, Field, Grid, NoResults } from '../..'
import styled from '@emotion/styled'
import { useCrowdloanContributions } from '@libs/crowdloans'
import { TitlePortal } from '@routes/layout'
import { useCrowdloanContributions } from '../../../../libs/crowdloans'
import { TitlePortal } from '../../../../routes/layout'
import { SearchBar } from '@talismn/ui'
import { device } from '@util/breakpoints'
import { device } from '../../../../util/breakpoints'
import { useTranslation } from 'react-i18next'
import { RootNav } from './RootNav'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Pendor, ProgressBar, Stat } from '@components/legacy'
import { Pendor, ProgressBar, Stat } from '../..'
import styled from '@emotion/styled'
import { useCrowdloanById } from '@libs/talisman'
import { useCrowdloanById } from '../../../../libs/talisman'
import { CheckCircle } from '@talismn/web-icons'
import { shortNumber } from '@util/helpers'
import { shortNumber } from '../../../../util/helpers'
import { useTranslation } from 'react-i18next'

const Raised = styled(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stat } from '@components/legacy'
import { Stat } from '../..'
import styled from '@emotion/styled'
import { useCrowdloanById } from '@libs/talisman'
import { useCrowdloanById } from '../../../../libs/talisman'

const Rewards = styled(({ id, className }: { id?: string; className?: string }) => {
const { crowdloan } = useCrowdloanById(id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Parachain } from '@components/legacy/archetypes'
import { Pill } from '@components/legacy'
import { Parachain } from '..'
import { Pill } from '../..'
import styled from '@emotion/styled'
import { useCrowdloanById, useParachainDetailsById } from '@libs/talisman'
import { useCrowdloanById, useParachainDetailsById } from '../../../../libs/talisman'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLatestCrowdloans, useParachainsDetailsIndexedById } from '@libs/talisman'
import { useLatestCrowdloans, useParachainsDetailsIndexedById } from '../../../../libs/talisman'
import { filter, find, orderBy } from 'lodash'
import { useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { device } from '@util/breakpoints'
import { device } from '../../../../util/breakpoints'
import { usePostHog } from 'posthog-js/react'
import { useCallback } from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { device } from '@util/breakpoints'
import { device } from '../../../../util/breakpoints'

export const TagLoading = styled(({ className }: { className?: string }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BaseFairyBreadBanner from '@components/recipes/FairyBreadBanner'
import BaseFairyBreadBanner from '../../recipes/FairyBreadBanner'
import { usePostHog } from 'posthog-js/react'
import { useCallback, useEffect, useState } from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from '@components/legacy'
import { DISCORD_JOIN_URL } from '@util/links'
import { Button } from '../..'
import { DISCORD_JOIN_URL } from '../../../../util/links'

export const JoinButton = ({ className = '' }: { className?: string }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Field } from '@components/legacy'
import { Field } from '../..'
import styled from '@emotion/styled'
import { useTranslation } from 'react-i18next'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled'
import { useParachainAssets } from '@libs/talisman'
import useImageWithFallback from '@util/useImageWithFallback'
import { useParachainAssets } from '../../../../libs/talisman'
import useImageWithFallback from '../../../../util/useImageWithFallback'

type ImageProps = {
id: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Pill } from '@components/legacy'
import { Pill } from '../..'
import styled from '@emotion/styled'
import { useParachainDetailsById } from '@libs/talisman'
import { useParachainDetailsById } from '../../../../libs/talisman'

export type LinksProps = {
id: number | string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { balancesState, selectedBalancesState, selectedCurrencyState } from '@domains/balances'
import { balancesState, selectedBalancesState, selectedCurrencyState } from '../../../../domains/balances'
import { BalanceFormatter } from '@talismn/balances'
import { useChains, useEvmNetworks, useTokenRates, useTokens } from '@talismn/balances-react'
import { formatDecimals } from '@talismn/util'
Expand Down
Loading

0 comments on commit 8bb4745

Please sign in to comment.