From 12399517e4c366e9345c725057670082bafbf411 Mon Sep 17 00:00:00 2001 From: Reza Rahemtola Date: Sun, 26 Jun 2022 12:21:19 +0200 Subject: [PATCH] fix: relative imports removed --- pages/_app.tsx | 10 +++++----- pages/dashboard.tsx | 14 ++++++------- pages/login.tsx | 10 +++++----- pages/signup.tsx | 14 ++++++------- src/components/AuthPage.tsx | 2 +- src/components/ContactCard.tsx | 2 +- src/components/ContactCards.tsx | 5 ++--- src/components/DisplayFileCards.tsx | 11 +++++----- src/components/FileCards.tsx | 7 +++---- src/components/FileEditButtons.tsx | 4 ++-- src/components/Modal.tsx | 2 +- src/components/ProfileCard.tsx | 3 +-- src/components/ProgramCards.tsx | 31 ++++++++++++++--------------- src/components/ResponsiveBar.tsx | 7 +++---- src/components/SideBar.tsx | 1 - src/lib/auth.ts | 2 +- src/lib/user.ts | 8 +++----- src/theme/components/button.ts | 4 ++-- src/theme/index.ts | 14 ++++++------- 19 files changed, 71 insertions(+), 80 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index c4ae678c..96b03c7f 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -5,13 +5,13 @@ import { AppProps } from 'next/app'; import { ChakraProvider, Center, Spinner, useToast } from '@chakra-ui/react'; import theme from 'theme'; -import '../src/theme/index.css'; +import 'theme/index.css'; -import User from '../src/lib/user'; -import Auth from '../src/lib/auth'; +import User from 'lib/user'; +import Auth from 'lib/auth'; -import UserContext from '../src/contexts/user'; -import AuthContext from '../src/contexts/auth'; +import UserContext from 'contexts/user'; +import AuthContext from 'contexts/auth'; const App = ({ Component, pageProps }: AppProps) => { const [auth, setAuth] = useState(undefined); diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index 213c51c3..6bce8913 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -21,18 +21,18 @@ import { CheckIcon } from '@chakra-ui/icons'; import EthCrypto from 'eth-crypto'; -import { useUserContext } from '../src/contexts/user'; +import { useUserContext } from 'contexts/user'; -import type { IPCFile, IPCContact, IPCProgram } from '../src/types/types'; +import type { IPCFile, IPCContact, IPCProgram } from 'types/types'; -import Modal from '../src/components/Modal'; +import Modal from 'components/Modal'; -import { generateFileKey } from '../src/utils/generateFileKey'; +import { generateFileKey } from 'utils/generateFileKey'; -import { getFileContent, extractFilename } from '../src/utils/fileManipulation'; +import { getFileContent, extractFilename } from 'utils/fileManipulation'; -import { ResponsiveBar } from '../src/components/ResponsiveBar'; -import { DisplayFileCards } from '../src/components/DisplayFileCards'; +import { ResponsiveBar } from 'components/ResponsiveBar'; +import { DisplayFileCards } from 'components/DisplayFileCards'; const Dashboard = (): JSX.Element => { const toast = useToast(); diff --git a/pages/login.tsx b/pages/login.tsx index fd2857ef..6c1c84f7 100644 --- a/pages/login.tsx +++ b/pages/login.tsx @@ -4,13 +4,13 @@ import Link from 'next/link'; import { Button, FormControl, Text, Textarea, useToast, VStack } from '@chakra-ui/react'; -import { useAuthContext } from '../src/contexts/auth'; -import { useUserContext } from '../src/contexts/user'; +import { useAuthContext } from 'contexts/auth'; +import { useUserContext } from 'contexts/user'; -import OutlineButton from '../src/components/OutlineButton'; -import AuthPage from '../src/components/AuthPage'; +import OutlineButton from 'components/OutlineButton'; +import AuthPage from 'components/AuthPage'; -import colors from '../src/theme/foundations/colors'; +import colors from 'theme/foundations/colors'; const Login = (): JSX.Element => { const auth = useAuthContext(); diff --git a/pages/signup.tsx b/pages/signup.tsx index faa334ce..90c9393d 100644 --- a/pages/signup.tsx +++ b/pages/signup.tsx @@ -4,16 +4,16 @@ import Link from 'next/link'; import { Button, Text, Textarea, useDisclosure, useToast, VStack } from '@chakra-ui/react'; -import { useAuthContext } from '../src/contexts/auth'; -import { useUserContext } from '../src/contexts/user'; +import { useAuthContext } from 'contexts/auth'; +import { useUserContext } from 'contexts/user'; -import { AuthReturnType } from '../src/lib/auth'; +import { AuthReturnType } from 'lib/auth'; -import Modal from '../src/components/Modal'; -import OutlineButton from '../src/components/OutlineButton'; -import AuthPage from '../src/components/AuthPage'; +import Modal from 'components/Modal'; +import OutlineButton from 'components/OutlineButton'; +import AuthPage from 'components/AuthPage'; -import colors from '../src/theme/foundations/colors'; +import colors from 'theme/foundations/colors'; const Signup = (): JSX.Element => { const auth = useAuthContext(); diff --git a/src/components/AuthPage.tsx b/src/components/AuthPage.tsx index 6d03369a..fc16235b 100644 --- a/src/components/AuthPage.tsx +++ b/src/components/AuthPage.tsx @@ -1,6 +1,6 @@ import { Text, VStack } from '@chakra-ui/react'; -import colors from '../theme/foundations/colors'; +import colors from 'theme/foundations/colors'; type AuthPageProps = { children: JSX.Element; diff --git a/src/components/ContactCard.tsx b/src/components/ContactCard.tsx index 827d122e..b683fe9a 100644 --- a/src/components/ContactCard.tsx +++ b/src/components/ContactCard.tsx @@ -1,5 +1,5 @@ import { Box, Flex, Text, VStack } from '@chakra-ui/react'; -import type { IPCContact } from '../types/types'; +import type { IPCContact } from 'types/types'; type FileCardProps = { contact: IPCContact; diff --git a/src/components/ContactCards.tsx b/src/components/ContactCards.tsx index 6277a2d4..b05d0a65 100644 --- a/src/components/ContactCards.tsx +++ b/src/components/ContactCards.tsx @@ -1,8 +1,7 @@ -import React from 'react'; import { Box, Button, Divider, Tooltip, VStack } from '@chakra-ui/react'; import { CopyIcon, DeleteIcon, EditIcon } from '@chakra-ui/icons'; -import type { IPCContact } from '../types/types'; -import { ContactCard } from './ContactCard'; +import type { IPCContact } from 'types/types'; +import { ContactCard } from 'components/ContactCard'; type ContactCardsProps = { contacts: IPCContact[]; diff --git a/src/components/DisplayFileCards.tsx b/src/components/DisplayFileCards.tsx index 2da0b0d0..214505c1 100644 --- a/src/components/DisplayFileCards.tsx +++ b/src/components/DisplayFileCards.tsx @@ -1,9 +1,8 @@ -import React from 'react'; -import type { IPCContact, IPCFile, IPCProgram } from '../types/types'; -import { FileCards } from './FileCards'; -import { ProgramCards } from './ProgramCards'; -import { ContactCards } from './ContactCards'; -import { ProfileCard } from './ProfileCard'; +import type { IPCContact, IPCFile, IPCProgram } from 'types/types'; +import { FileCards } from 'components/FileCards'; +import { ProgramCards } from 'components/ProgramCards'; +import { ContactCards } from 'components/ContactCards'; +import { ProfileCard } from 'components/ProfileCard'; type FileCardsProps = { myFiles: IPCFile[]; diff --git a/src/components/FileCards.tsx b/src/components/FileCards.tsx index 14a92fdb..d8226215 100644 --- a/src/components/FileCards.tsx +++ b/src/components/FileCards.tsx @@ -1,10 +1,9 @@ import { Button, Icon } from '@chakra-ui/react'; import { DownloadIcon } from '@chakra-ui/icons'; import { MdPeopleAlt } from 'react-icons/md'; -import React from 'react'; -import FileCard from './FileCard'; -import { FileEditButtons } from './FileEditButtons'; -import type { IPCFile } from '../types/types'; +import FileCard from 'components/FileCard'; +import { FileEditButtons } from 'components/FileEditButtons'; +import type { IPCFile } from 'types/types'; type FileCardsProps = { files: IPCFile[]; diff --git a/src/components/FileEditButtons.tsx b/src/components/FileEditButtons.tsx index 7b981176..c35da231 100644 --- a/src/components/FileEditButtons.tsx +++ b/src/components/FileEditButtons.tsx @@ -1,9 +1,9 @@ import { Button, Icon } from '@chakra-ui/react'; import { EditIcon } from '@chakra-ui/icons'; import { MdUpdate } from 'react-icons/md'; -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { useUserContext } from 'contexts/user'; -import type { IPCFile } from '../types/types'; +import type { IPCFile } from 'types/types'; type FileEditButtonsProps = { file: IPCFile; diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index f6f47052..e5215345 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -2,7 +2,7 @@ import { Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, ModalOverlay import colors from 'theme/foundations/colors'; -import OutlineButton from './OutlineButton'; +import OutlineButton from 'components/OutlineButton'; type PopupProps = { isOpen: boolean; diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index f7e70554..4920418c 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -1,7 +1,6 @@ import { Box, VStack, Text, Flex, Tooltip, Button } from '@chakra-ui/react'; import { CopyIcon, EditIcon } from '@chakra-ui/icons'; -import React from 'react'; -import type { IPCContact } from '../types/types'; +import type { IPCContact } from 'types/types'; type ProfileCardProps = { profile: IPCContact; diff --git a/src/components/ProgramCards.tsx b/src/components/ProgramCards.tsx index 0615fce5..309afbf8 100644 --- a/src/components/ProgramCards.tsx +++ b/src/components/ProgramCards.tsx @@ -1,6 +1,7 @@ import { Button } from '@chakra-ui/react'; -import ProgramCard from './ProgramCard'; -import type { IPCProgram } from '../types/types'; + +import ProgramCard from 'components/ProgramCard'; +import type { IPCProgram } from 'types/types'; type ProgramCardsProps = { programs: IPCProgram[]; @@ -10,20 +11,18 @@ export const ProgramCards = ({ programs }: ProgramCardsProps): JSX.Element => ( <> {programs.map((program: IPCProgram) => ( - <> - - + ))} diff --git a/src/components/ResponsiveBar.tsx b/src/components/ResponsiveBar.tsx index dad17cca..dcb0b6bf 100644 --- a/src/components/ResponsiveBar.tsx +++ b/src/components/ResponsiveBar.tsx @@ -15,10 +15,9 @@ import { } from '@chakra-ui/react'; import { HamburgerIcon } from '@chakra-ui/icons'; -import React from 'react'; -import colors from '../theme/foundations/colors'; -import Sidebar from './SideBar'; -import { UploadButton, DeployButton } from './CustomButtons'; +import colors from 'theme/foundations/colors'; +import Sidebar from 'components/SideBar'; +import { UploadButton, DeployButton } from 'components/CustomButtons'; type BarProps = { onOpen: () => void; diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx index 01d5a55d..144034ac 100644 --- a/src/components/SideBar.tsx +++ b/src/components/SideBar.tsx @@ -1,7 +1,6 @@ import { Tab, TabList, Tabs, Text, VStack } from '@chakra-ui/react'; import colors from 'theme/foundations/colors'; -import React from 'react'; type SideBarPropsType = { contactTab: string; diff --git a/src/lib/auth.ts b/src/lib/auth.ts index fab0732c..94f41443 100644 --- a/src/lib/auth.ts +++ b/src/lib/auth.ts @@ -1,6 +1,6 @@ import { accounts } from 'aleph-sdk-ts'; -import User from './user'; +import User from 'lib/user'; type AuthReturnType = { user: User | undefined; diff --git a/src/lib/user.ts b/src/lib/user.ts index 275b59af..0c5e000c 100644 --- a/src/lib/user.ts +++ b/src/lib/user.ts @@ -2,11 +2,9 @@ import { accounts } from 'aleph-sdk-ts'; import { mnemonicToPrivateKey } from 'utils/mnemonicToPrivateKey'; -import Drive from './drive'; - -import Contact from './contact'; - -import Computing from './computing'; +import Drive from 'lib/drive'; +import Contact from 'lib/contact'; +import Computing from 'lib/computing'; class User { public account: accounts.base.Account | undefined; diff --git a/src/theme/components/button.ts b/src/theme/components/button.ts index 57ec4ca6..19f8b439 100644 --- a/src/theme/components/button.ts +++ b/src/theme/components/button.ts @@ -1,5 +1,5 @@ -import colors from '../foundations/colors'; -import radius from '../foundations/borderRadius'; +import colors from 'theme/foundations/colors'; +import radius from 'theme/foundations/borderRadius'; const Button = { baseStyle: { diff --git a/src/theme/index.ts b/src/theme/index.ts index ccb266d3..93ceab9a 100644 --- a/src/theme/index.ts +++ b/src/theme/index.ts @@ -2,14 +2,14 @@ import { extendTheme } from '@chakra-ui/react'; import { createBreakpoints } from '@chakra-ui/theme-tools'; // Foundation overrides -import fonts from './foundations/fonts'; -import colors from './foundations/colors'; -import radius from './foundations/borderRadius'; -import shadows from './foundations/shadows'; +import fonts from 'theme/foundations/fonts'; +import colors from 'theme/foundations/colors'; +import radius from 'theme/foundations/borderRadius'; +import shadows from 'theme/foundations/shadows'; -import Button from './components/button'; -import Link from './components/link'; -import Text from './components/text'; +import Button from 'theme/components/button'; +import Link from 'theme/components/link'; +import Text from 'theme/components/text'; const breakpoints = createBreakpoints({ xs: '320px',