Skip to content

Commit

Permalink
fix: relative imports removed
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Jun 26, 2022
1 parent 2f2e2a6 commit 1239951
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 80 deletions.
10 changes: 5 additions & 5 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Auth | undefined>(undefined);
Expand Down
14 changes: 7 additions & 7 deletions pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
14 changes: 7 additions & 7 deletions pages/signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/components/AuthPage.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContactCard.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/components/ContactCards.tsx
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
11 changes: 5 additions & 6 deletions src/components/DisplayFileCards.tsx
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
7 changes: 3 additions & 4 deletions src/components/FileCards.tsx
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
4 changes: 2 additions & 2 deletions src/components/FileEditButtons.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/components/ProfileCard.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
31 changes: 15 additions & 16 deletions src/components/ProgramCards.tsx
Original file line number Diff line number Diff line change
@@ -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[];
Expand All @@ -10,20 +11,18 @@ export const ProgramCards = ({ programs }: ProgramCardsProps): JSX.Element => (
<>
{programs.map((program: IPCProgram) => (
<ProgramCard key={program.created_at} program={program}>
<>
<Button
as="a"
href={`https://aleph.sh/vm/${program.hash}`}
target="_blank"
variant="inline"
size="sm"
w="100%"
p="0px"
id="ipc-computingView-forwardUrl-button"
>
Go to site
</Button>
</>
<Button
as="a"
href={`https://aleph.sh/vm/${program.hash}`}
target="_blank"
variant="inline"
size="sm"
w="100%"
p="0px"
id="ipc-computingView-forwardUrl-button"
>
Go to site
</Button>
</ProgramCard>
))}
</>
Expand Down
7 changes: 3 additions & 4 deletions src/components/ResponsiveBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/components/SideBar.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { accounts } from 'aleph-sdk-ts';

import User from './user';
import User from 'lib/user';

type AuthReturnType = {
user: User | undefined;
Expand Down
8 changes: 3 additions & 5 deletions src/lib/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/theme/components/button.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
14 changes: 7 additions & 7 deletions src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 1239951

Please sign in to comment.