diff --git a/src/components/Message.tsx b/src/components/message/Message.tsx similarity index 95% rename from src/components/Message.tsx rename to src/components/message/Message.tsx index 4ea4a048..523add39 100644 --- a/src/components/Message.tsx +++ b/src/components/message/Message.tsx @@ -1,13 +1,13 @@ import React, { FC, useCallback, useState } from 'react' import { Card, Icon, Image } from 'semantic-ui-react' import Moment from 'react-moment' -import { Message as MessageType } from '../api/Message' +import { Message as MessageType } from '../../api/Message' import Lightbox from 'react-image-lightbox' import 'react-image-lightbox/style.css' -import { replaceMagic } from '../lib/helper' +import { replaceMagic } from '../../lib/helper' import MessageModalDelete from './MessageModalDelete' import MessageMap from './MessageMap' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' interface Props { message: MessageType diff --git a/src/components/MessageAttachmentsButton.tsx b/src/components/message/MessageAttachmentsButton.tsx similarity index 90% rename from src/components/MessageAttachmentsButton.tsx rename to src/components/message/MessageAttachmentsButton.tsx index 3650234f..3618eb56 100644 --- a/src/components/MessageAttachmentsButton.tsx +++ b/src/components/message/MessageAttachmentsButton.tsx @@ -1,8 +1,8 @@ import React, { createRef, FC, useCallback } from 'react' import { Button } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' -import { useUploadApi, Upload } from '../api/Upload' -import useAuth from './useAuth' +import { Ticker } from '../../api/Ticker' +import { useUploadApi, Upload } from '../../api/Upload' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/MessageAttachmentsPreview.tsx b/src/components/message/MessageAttachmentsPreview.tsx similarity index 96% rename from src/components/MessageAttachmentsPreview.tsx rename to src/components/message/MessageAttachmentsPreview.tsx index 0f3db515..15341765 100644 --- a/src/components/MessageAttachmentsPreview.tsx +++ b/src/components/message/MessageAttachmentsPreview.tsx @@ -1,6 +1,6 @@ import React, { FC, useCallback } from 'react' import { Button, ButtonProps, Image } from 'semantic-ui-react' -import { Upload } from '../api/Upload' +import { Upload } from '../../api/Upload' interface Props { attachments: Upload[] diff --git a/src/components/MessageForm.tsx b/src/components/message/MessageForm.tsx similarity index 95% rename from src/components/MessageForm.tsx rename to src/components/message/MessageForm.tsx index f4bf080f..216f0a9c 100644 --- a/src/components/MessageForm.tsx +++ b/src/components/message/MessageForm.tsx @@ -6,19 +6,19 @@ import React, { useEffect, useState, } from 'react' -import { useMessageApi } from '../api/Message' +import { useMessageApi } from '../../api/Message' import { Button, Form, Message as Error, TextAreaProps, } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import { SubmitHandler, useForm } from 'react-hook-form' import { useQueryClient } from '@tanstack/react-query' import MessageFormCounter from './MessageFormCounter' -import useAuth from './useAuth' -import { Upload } from '../api/Upload' +import useAuth from '../useAuth' +import { Upload } from '../../api/Upload' import MessageAttachmentsButton from './MessageAttachmentsButton' import MessageAttachmentsPreview from './MessageAttachmentsPreview' import MessageMapModal from './MessageMapModal' diff --git a/src/components/MessageFormCounter.tsx b/src/components/message/MessageFormCounter.tsx similarity index 100% rename from src/components/MessageFormCounter.tsx rename to src/components/message/MessageFormCounter.tsx diff --git a/src/components/MessageList.tsx b/src/components/message/MessageList.tsx similarity index 84% rename from src/components/MessageList.tsx rename to src/components/message/MessageList.tsx index c4b52288..8f174a94 100644 --- a/src/components/MessageList.tsx +++ b/src/components/message/MessageList.tsx @@ -1,10 +1,10 @@ import React, { FC } from 'react' import { Dimmer, Feed, Loader } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' -import { useMessageApi } from '../api/Message' -import Message from '../components/Message' +import { Ticker } from '../../api/Ticker' +import { useMessageApi } from '../../api/Message' +import Message from './Message' import { useQuery } from '@tanstack/react-query' -import useAuth from './useAuth' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/MessageMap.tsx b/src/components/message/MessageMap.tsx similarity index 91% rename from src/components/MessageMap.tsx rename to src/components/message/MessageMap.tsx index f82626a0..40740a03 100644 --- a/src/components/MessageMap.tsx +++ b/src/components/message/MessageMap.tsx @@ -1,8 +1,8 @@ import { latLng } from 'leaflet' import React, { FC } from 'react' import { GeoJSON, MapContainer, TileLayer } from 'react-leaflet' -import { Message } from '../api/Message' -import { Ticker } from '../api/Ticker' +import { Message } from '../../api/Message' +import { Ticker } from '../../api/Ticker' interface Props { message: Message diff --git a/src/components/MessageMapModal.tsx b/src/components/message/MessageMapModal.tsx similarity index 98% rename from src/components/MessageMapModal.tsx rename to src/components/message/MessageMapModal.tsx index bf165261..0691c755 100644 --- a/src/components/MessageMapModal.tsx +++ b/src/components/message/MessageMapModal.tsx @@ -4,7 +4,7 @@ import { FeatureGroup, GeoJSON, MapContainer, TileLayer } from 'react-leaflet' import { EditControl } from 'react-leaflet-draw' import { Button, Modal } from 'semantic-ui-react' import { FeatureCollection, Geometry } from 'geojson' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' interface Props { callback: (features: FeatureCollection) => void diff --git a/src/components/MessageModalDelete.tsx b/src/components/message/MessageModalDelete.tsx similarity index 92% rename from src/components/MessageModalDelete.tsx rename to src/components/message/MessageModalDelete.tsx index 299fde16..8e9e2539 100644 --- a/src/components/MessageModalDelete.tsx +++ b/src/components/message/MessageModalDelete.tsx @@ -1,8 +1,8 @@ import React, { FC, useCallback, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' import { Confirm } from 'semantic-ui-react' -import { Message, useMessageApi } from '../api/Message' -import useAuth from './useAuth' +import { Message, useMessageApi } from '../../api/Message' +import useAuth from '../useAuth' interface Props { message: Message diff --git a/src/components/Clock.tsx b/src/components/navigation/Clock.tsx similarity index 100% rename from src/components/Clock.tsx rename to src/components/navigation/Clock.tsx diff --git a/src/views/Navigation.tsx b/src/components/navigation/Navigation.tsx similarity index 93% rename from src/views/Navigation.tsx rename to src/components/navigation/Navigation.tsx index c8d07398..9f86ec87 100644 --- a/src/views/Navigation.tsx +++ b/src/components/navigation/Navigation.tsx @@ -1,9 +1,9 @@ import React, { FC, useCallback } from 'react' import { Container, Dropdown, Image, Menu } from 'semantic-ui-react' -import Clock from '../components/Clock' -import logo from '../assets/logo.png' +import Clock from './Clock' +import logo from '../../assets/logo.png' import { useNavigate, useLocation } from 'react-router-dom' -import useAuth from '../components/useAuth' +import useAuth from '../useAuth' const Navigation: FC = () => { const { user, logout } = useAuth() diff --git a/src/components/InactiveSettingsCard.tsx b/src/components/settings/InactiveSettingsCard.tsx similarity index 95% rename from src/components/InactiveSettingsCard.tsx rename to src/components/settings/InactiveSettingsCard.tsx index 79ca3fd1..e10563e5 100644 --- a/src/components/InactiveSettingsCard.tsx +++ b/src/components/settings/InactiveSettingsCard.tsx @@ -10,10 +10,10 @@ import { List, Loader, } from 'semantic-ui-react' -import { useSettingsApi } from '../api/Settings' -import ErrorView from '../views/ErrorView' +import { useSettingsApi } from '../../api/Settings' +import ErrorView from '../../views/ErrorView' import InactiveSettingsModalForm from './InactiveSettingsModalForm' -import useAuth from './useAuth' +import useAuth from '../useAuth' const InactiveSettingsCard: FC = () => { const { token } = useAuth() diff --git a/src/components/InactiveSettingsForm.tsx b/src/components/settings/InactiveSettingsForm.tsx similarity index 96% rename from src/components/InactiveSettingsForm.tsx rename to src/components/settings/InactiveSettingsForm.tsx index f70ee225..98c0f1e9 100644 --- a/src/components/InactiveSettingsForm.tsx +++ b/src/components/settings/InactiveSettingsForm.tsx @@ -13,8 +13,8 @@ import { InputOnChangeData, TextAreaProps, } from 'semantic-ui-react' -import { InactiveSetting, Setting, useSettingsApi } from '../api/Settings' -import useAuth from './useAuth' +import { InactiveSetting, Setting, useSettingsApi } from '../../api/Settings' +import useAuth from '../useAuth' interface Props { setting: Setting diff --git a/src/components/InactiveSettingsModalForm.tsx b/src/components/settings/InactiveSettingsModalForm.tsx similarity index 95% rename from src/components/InactiveSettingsModalForm.tsx rename to src/components/settings/InactiveSettingsModalForm.tsx index 237196c0..9c5fdf0e 100644 --- a/src/components/InactiveSettingsModalForm.tsx +++ b/src/components/settings/InactiveSettingsModalForm.tsx @@ -1,6 +1,6 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Header, Modal } from 'semantic-ui-react' -import { InactiveSetting, Setting } from '../api/Settings' +import { InactiveSetting, Setting } from '../../api/Settings' import InactiveSettingsForm from './InactiveSettingsForm' interface Props { diff --git a/src/components/RefreshIntervalCard.tsx b/src/components/settings/RefreshIntervalCard.tsx similarity index 92% rename from src/components/RefreshIntervalCard.tsx rename to src/components/settings/RefreshIntervalCard.tsx index b154fb59..3316fc02 100644 --- a/src/components/RefreshIntervalCard.tsx +++ b/src/components/settings/RefreshIntervalCard.tsx @@ -1,10 +1,10 @@ import React, { FC } from 'react' import { useQuery } from '@tanstack/react-query' import { Button, Card, Dimmer, Icon, List, Loader } from 'semantic-ui-react' -import { useSettingsApi } from '../api/Settings' -import ErrorView from '../views/ErrorView' +import { useSettingsApi } from '../../api/Settings' +import ErrorView from '../../views/ErrorView' import RefreshIntervalModalForm from './RefreshIntervalModalForm' -import useAuth from './useAuth' +import useAuth from '../useAuth' const RefreshIntervalCard: FC = () => { const { token } = useAuth() diff --git a/src/components/RefreshIntervalForm.tsx b/src/components/settings/RefreshIntervalForm.tsx similarity index 94% rename from src/components/RefreshIntervalForm.tsx rename to src/components/settings/RefreshIntervalForm.tsx index a0580dba..8dab6e35 100644 --- a/src/components/RefreshIntervalForm.tsx +++ b/src/components/settings/RefreshIntervalForm.tsx @@ -2,8 +2,8 @@ import React, { FC, FormEvent, useCallback, useEffect } from 'react' import { SubmitHandler, useForm } from 'react-hook-form' import { useQueryClient } from '@tanstack/react-query' import { Form, InputOnChangeData } from 'semantic-ui-react' -import { Setting, useSettingsApi } from '../api/Settings' -import useAuth from './useAuth' +import { Setting, useSettingsApi } from '../../api/Settings' +import useAuth from '../useAuth' interface Props { setting: Setting diff --git a/src/components/RefreshIntervalModalForm.tsx b/src/components/settings/RefreshIntervalModalForm.tsx similarity index 96% rename from src/components/RefreshIntervalModalForm.tsx rename to src/components/settings/RefreshIntervalModalForm.tsx index 6108adb2..cad247fc 100644 --- a/src/components/RefreshIntervalModalForm.tsx +++ b/src/components/settings/RefreshIntervalModalForm.tsx @@ -1,6 +1,6 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Header, Modal } from 'semantic-ui-react' -import { Setting } from '../api/Settings' +import { Setting } from '../../api/Settings' import RefreshIntervalForm from './RefreshIntervalForm' interface Props { diff --git a/src/components/LocationSearch.tsx b/src/components/ticker/LocationSearch.tsx similarity index 100% rename from src/components/LocationSearch.tsx rename to src/components/ticker/LocationSearch.tsx diff --git a/src/components/TelegramCard.tsx b/src/components/ticker/TelegramCard.tsx similarity index 97% rename from src/components/TelegramCard.tsx rename to src/components/ticker/TelegramCard.tsx index 9ee4bed7..31f5d675 100644 --- a/src/components/TelegramCard.tsx +++ b/src/components/ticker/TelegramCard.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' import { Button, Card, Container, Icon } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import TelegramModalForm from './TelegramModalForm' interface Props { diff --git a/src/components/TelegramForm.tsx b/src/components/ticker/TelegramForm.tsx similarity index 95% rename from src/components/TelegramForm.tsx rename to src/components/ticker/TelegramForm.tsx index 4f83344a..6fc819e1 100644 --- a/src/components/TelegramForm.tsx +++ b/src/components/ticker/TelegramForm.tsx @@ -7,8 +7,8 @@ import { InputOnChangeData, Message, } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' -import useAuth from './useAuth' +import { Ticker, useTickerApi } from '../../api/Ticker' +import useAuth from '../useAuth' interface Props { callback: () => void diff --git a/src/components/TelegramModalForm.tsx b/src/components/ticker/TelegramModalForm.tsx similarity index 96% rename from src/components/TelegramModalForm.tsx rename to src/components/ticker/TelegramModalForm.tsx index 30f2df37..1f8d30cc 100644 --- a/src/components/TelegramModalForm.tsx +++ b/src/components/ticker/TelegramModalForm.tsx @@ -1,6 +1,6 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Modal } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import TelegramForm from './TelegramForm' interface Props { diff --git a/src/components/Ticker.tsx b/src/components/ticker/Ticker.tsx similarity index 76% rename from src/components/Ticker.tsx rename to src/components/ticker/Ticker.tsx index ee49f537..05608148 100644 --- a/src/components/Ticker.tsx +++ b/src/components/ticker/Ticker.tsx @@ -1,15 +1,15 @@ import React, { FC } from 'react' import { Button, Grid, Header } from 'semantic-ui-react' -import { Ticker as Model } from '../api/Ticker' -import MessageForm from '../components/MessageForm' -import TickerCard from '../components/TickerCard' -import MessageList from '../components/MessageList' -import useAuth from '../components/useAuth' -import TickerUsersCard from '../components/TickerUserCard' -import TickerResetModal from '../components/TickerResetModal' -import TwitterCard from '../components/TwitterCard' -import TelegramCard from '../components/TelegramCard' -import useFeature from './useFeature' +import { Ticker as Model } from '../../api/Ticker' +import MessageForm from '../message/MessageForm' +import TickerCard from './TickerCard' +import MessageList from '../message/MessageList' +import useAuth from '../useAuth' +import TickerUsersCard from './TickerUserCard' +import TickerResetModal from './TickerResetModal' +import TwitterCard from './TwitterCard' +import TelegramCard from './TelegramCard' +import useFeature from '../useFeature' interface Props { ticker: Model diff --git a/src/components/TickerCard.tsx b/src/components/ticker/TickerCard.tsx similarity index 97% rename from src/components/TickerCard.tsx rename to src/components/ticker/TickerCard.tsx index 0b0a03b5..bf62f74f 100644 --- a/src/components/TickerCard.tsx +++ b/src/components/ticker/TickerCard.tsx @@ -2,7 +2,7 @@ import React, { FC } from 'react' import { Button, Card, Icon, Label } from 'semantic-ui-react' import ReactMarkdown from 'react-markdown' import TickerModalForm from './TickerModalForm' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' interface Props { ticker: Ticker diff --git a/src/components/TickerForm.tsx b/src/components/ticker/TickerForm.tsx similarity index 98% rename from src/components/TickerForm.tsx rename to src/components/ticker/TickerForm.tsx index ca8c45b7..a9e8a689 100644 --- a/src/components/TickerForm.tsx +++ b/src/components/ticker/TickerForm.tsx @@ -16,10 +16,10 @@ import { Message, TextAreaProps, } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' +import { Ticker, useTickerApi } from '../../api/Ticker' import { SubmitHandler, useForm } from 'react-hook-form' import { useQueryClient } from '@tanstack/react-query' -import useAuth from './useAuth' +import useAuth from '../useAuth' import LocationSearch, { Result } from './LocationSearch' import { MapContainer, Marker, TileLayer } from 'react-leaflet' diff --git a/src/components/TickerList.tsx b/src/components/ticker/TickerList.tsx similarity index 95% rename from src/components/TickerList.tsx rename to src/components/ticker/TickerList.tsx index 7b43093f..a4eaaf9a 100644 --- a/src/components/TickerList.tsx +++ b/src/components/ticker/TickerList.tsx @@ -1,9 +1,9 @@ import React, { FC } from 'react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import { Button, Table } from 'semantic-ui-react' import TickerModalForm from './TickerModalForm' import TickerListItems from './TickerListItems' -import useAuth from './useAuth' +import useAuth from '../useAuth' interface Props { tickers: Ticker[] diff --git a/src/components/TickerListItem.tsx b/src/components/ticker/TickerListItem.tsx similarity index 95% rename from src/components/TickerListItem.tsx rename to src/components/ticker/TickerListItem.tsx index ead2af73..27b56882 100644 --- a/src/components/TickerListItem.tsx +++ b/src/components/ticker/TickerListItem.tsx @@ -1,10 +1,10 @@ import React, { FC, useCallback } from 'react' import { useNavigate } from 'react-router' import { Button, Icon, Table } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import TickerModalDelete from './TickerModalDelete' import TickerModalForm from './TickerModalForm' -import useAuth from './useAuth' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/TickerListItems.tsx b/src/components/ticker/TickerListItems.tsx similarity index 90% rename from src/components/TickerListItems.tsx rename to src/components/ticker/TickerListItems.tsx index 4a5bbafb..f06785f1 100644 --- a/src/components/TickerListItems.tsx +++ b/src/components/ticker/TickerListItems.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' import { Table } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import TickerListItem from './TickerListItem' interface Props { diff --git a/src/components/TickerModalDelete.tsx b/src/components/ticker/TickerModalDelete.tsx similarity index 92% rename from src/components/TickerModalDelete.tsx rename to src/components/ticker/TickerModalDelete.tsx index 410796b9..d03ab64f 100644 --- a/src/components/TickerModalDelete.tsx +++ b/src/components/ticker/TickerModalDelete.tsx @@ -1,8 +1,8 @@ import React, { FC, useCallback, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' import { Confirm } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' -import useAuth from './useAuth' +import { Ticker, useTickerApi } from '../../api/Ticker' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/TickerModalForm.tsx b/src/components/ticker/TickerModalForm.tsx similarity index 96% rename from src/components/TickerModalForm.tsx rename to src/components/ticker/TickerModalForm.tsx index a26c4d59..7d438bb0 100644 --- a/src/components/TickerModalForm.tsx +++ b/src/components/ticker/TickerModalForm.tsx @@ -1,6 +1,6 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Header, Modal } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' +import { Ticker } from '../../api/Ticker' import TickerForm from './TickerForm' interface Props { diff --git a/src/components/TickerResetModal.tsx b/src/components/ticker/TickerResetModal.tsx similarity index 95% rename from src/components/TickerResetModal.tsx rename to src/components/ticker/TickerResetModal.tsx index d66f67f4..bbead9a3 100644 --- a/src/components/TickerResetModal.tsx +++ b/src/components/ticker/TickerResetModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Modal } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' -import useAuth from './useAuth' +import { Ticker, useTickerApi } from '../../api/Ticker' +import useAuth from '../useAuth' import { useQueryClient } from '@tanstack/react-query' interface Props { diff --git a/src/components/TickerUserAddForm.tsx b/src/components/ticker/TickerUserAddForm.tsx similarity index 93% rename from src/components/TickerUserAddForm.tsx rename to src/components/ticker/TickerUserAddForm.tsx index e98595ad..744b774b 100644 --- a/src/components/TickerUserAddForm.tsx +++ b/src/components/ticker/TickerUserAddForm.tsx @@ -2,9 +2,9 @@ import React, { FC, useCallback, useEffect } from 'react' import { SubmitHandler, useForm } from 'react-hook-form' import { useQuery, useQueryClient } from '@tanstack/react-query' import { Dropdown, DropdownProps, Form } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' -import { User, useUserApi } from '../api/User' -import useAuth from './useAuth' +import { Ticker, useTickerApi } from '../../api/Ticker' +import { User, useUserApi } from '../../api/User' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/TickerUserCard.tsx b/src/components/ticker/TickerUserCard.tsx similarity index 94% rename from src/components/TickerUserCard.tsx rename to src/components/ticker/TickerUserCard.tsx index 9baa0571..3233ac2a 100644 --- a/src/components/TickerUserCard.tsx +++ b/src/components/ticker/TickerUserCard.tsx @@ -1,10 +1,10 @@ import React, { FC } from 'react' import { useQuery } from '@tanstack/react-query' import { Button, Card, Dimmer, Loader } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' +import { Ticker, useTickerApi } from '../../api/Ticker' import TickerUserList from './TickerUserList' import TickerUserModalAdd from './TickerUserModalAdd' -import useAuth from './useAuth' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/TickerUserList.tsx b/src/components/ticker/TickerUserList.tsx similarity index 89% rename from src/components/TickerUserList.tsx rename to src/components/ticker/TickerUserList.tsx index cb35f823..9208a7ba 100644 --- a/src/components/TickerUserList.tsx +++ b/src/components/ticker/TickerUserList.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react' import { List } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' -import { User } from '../api/User' +import { Ticker } from '../../api/Ticker' +import { User } from '../../api/User' import TickerUsersListItem from './TickerUserListItem' interface Props { diff --git a/src/components/TickerUserListItem.tsx b/src/components/ticker/TickerUserListItem.tsx similarity index 91% rename from src/components/TickerUserListItem.tsx rename to src/components/ticker/TickerUserListItem.tsx index 7930cc72..5177058e 100644 --- a/src/components/TickerUserListItem.tsx +++ b/src/components/ticker/TickerUserListItem.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react' import { Button, List } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' -import { User } from '../api/User' +import { Ticker } from '../../api/Ticker' +import { User } from '../../api/User' import TickerUserModalDelete from './TickerUserModalDelete' interface Props { diff --git a/src/components/TickerUserModalAdd.tsx b/src/components/ticker/TickerUserModalAdd.tsx similarity index 94% rename from src/components/TickerUserModalAdd.tsx rename to src/components/ticker/TickerUserModalAdd.tsx index 119b22ea..92a498d3 100644 --- a/src/components/TickerUserModalAdd.tsx +++ b/src/components/ticker/TickerUserModalAdd.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Modal } from 'semantic-ui-react' -import { Ticker } from '../api/Ticker' -import { User } from '../api/User' +import { Ticker } from '../../api/Ticker' +import { User } from '../../api/User' import TickerUserAddForm from './TickerUserAddForm' interface Props { diff --git a/src/components/TickerUserModalDelete.tsx b/src/components/ticker/TickerUserModalDelete.tsx similarity index 89% rename from src/components/TickerUserModalDelete.tsx rename to src/components/ticker/TickerUserModalDelete.tsx index 0ca5ac5c..b11a11a6 100644 --- a/src/components/TickerUserModalDelete.tsx +++ b/src/components/ticker/TickerUserModalDelete.tsx @@ -1,9 +1,9 @@ import React, { FC, useCallback, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' import { Confirm } from 'semantic-ui-react' -import { Ticker, useTickerApi } from '../api/Ticker' -import { User } from '../api/User' -import useAuth from './useAuth' +import { Ticker, useTickerApi } from '../../api/Ticker' +import { User } from '../../api/User' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/TickersDropdown.tsx b/src/components/ticker/TickersDropdown.tsx similarity index 94% rename from src/components/TickersDropdown.tsx rename to src/components/ticker/TickersDropdown.tsx index 619bc254..1966594f 100644 --- a/src/components/TickersDropdown.tsx +++ b/src/components/ticker/TickersDropdown.tsx @@ -6,8 +6,8 @@ import React, { useState, } from 'react' import { Dropdown, DropdownItemProps, DropdownProps } from 'semantic-ui-react' -import { useTickerApi } from '../api/Ticker' -import useAuth from './useAuth' +import { useTickerApi } from '../../api/Ticker' +import useAuth from '../useAuth' interface Props { name: string diff --git a/src/components/TwitterCard.tsx b/src/components/ticker/TwitterCard.tsx similarity index 96% rename from src/components/TwitterCard.tsx rename to src/components/ticker/TwitterCard.tsx index 5319319c..a5505580 100644 --- a/src/components/TwitterCard.tsx +++ b/src/components/ticker/TwitterCard.tsx @@ -2,9 +2,9 @@ import React, { FC, useCallback } from 'react' import { useQueryClient } from '@tanstack/react-query' import TwitterLogin from 'react-twitter-auth' import { Button, Card, Container, Icon } from 'semantic-ui-react' -import { ApiUrl } from '../api/Api' -import { Ticker, useTickerApi } from '../api/Ticker' -import useAuth from './useAuth' +import { ApiUrl } from '../../api/Api' +import { Ticker, useTickerApi } from '../../api/Ticker' +import useAuth from '../useAuth' interface Props { ticker: Ticker diff --git a/src/components/UserForm.tsx b/src/components/user/UserForm.tsx similarity index 94% rename from src/components/UserForm.tsx rename to src/components/user/UserForm.tsx index d3c37e36..c630f15b 100644 --- a/src/components/UserForm.tsx +++ b/src/components/user/UserForm.tsx @@ -14,10 +14,10 @@ import { InputOnChangeData, } from 'semantic-ui-react' import { SubmitHandler, useForm } from 'react-hook-form' -import { User, useUserApi } from '../api/User' +import { User, useUserApi } from '../../api/User' import { useQueryClient } from '@tanstack/react-query' -import TickersDropdown from './TickersDropdown' -import useAuth from './useAuth' +import TickersDropdown from '../ticker/TickersDropdown' +import useAuth from '../useAuth' interface Props { user?: User @@ -35,7 +35,7 @@ interface FormValues { const UserForm: FC = props => { const user = props.user const { token } = useAuth() - const { postUser, putUser } = useUserApi(token!) + const { postUser, putUser } = useUserApi(token) const { handleSubmit, register, setValue } = useForm({ defaultValues: { email: user?.email, diff --git a/src/components/UserList.tsx b/src/components/user/UserList.tsx similarity index 93% rename from src/components/UserList.tsx rename to src/components/user/UserList.tsx index 18e68942..89d1ccd6 100644 --- a/src/components/UserList.tsx +++ b/src/components/user/UserList.tsx @@ -3,9 +3,9 @@ import { Button, Dimmer, Loader, Table } from 'semantic-ui-react' import { useQuery } from '@tanstack/react-query' import UserListItems from './UserListItems' import UserModalForm from './UserModalForm' -import useAuth from './useAuth' -import { useUserApi } from '../api/User' -import ErrorView from '../views/ErrorView' +import useAuth from '../useAuth' +import { useUserApi } from '../../api/User' +import ErrorView from '../../views/ErrorView' const UserList: FC = () => { const { token } = useAuth() diff --git a/src/components/UserListItem.tsx b/src/components/user/UserListItem.tsx similarity index 96% rename from src/components/UserListItem.tsx rename to src/components/user/UserListItem.tsx index 104167fb..e2a621ac 100644 --- a/src/components/UserListItem.tsx +++ b/src/components/user/UserListItem.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react' import Moment from 'react-moment' import { Button, Icon, Label, Table } from 'semantic-ui-react' -import { User } from '../api/User' +import { User } from '../../api/User' import UserModalDelete from './UserModalDelete' import UserModalForm from './UserModalForm' diff --git a/src/components/UserListItems.tsx b/src/components/user/UserListItems.tsx similarity index 91% rename from src/components/UserListItems.tsx rename to src/components/user/UserListItems.tsx index 0c11d16d..e49cff05 100644 --- a/src/components/UserListItems.tsx +++ b/src/components/user/UserListItems.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' import { Table } from 'semantic-ui-react' -import { User } from '../api/User' +import { User } from '../../api/User' import UserListItem from './UserListItem' interface Props { diff --git a/src/components/UserModalDelete.tsx b/src/components/user/UserModalDelete.tsx similarity index 88% rename from src/components/UserModalDelete.tsx rename to src/components/user/UserModalDelete.tsx index 8987db04..fa43cc2e 100644 --- a/src/components/UserModalDelete.tsx +++ b/src/components/user/UserModalDelete.tsx @@ -1,8 +1,8 @@ import React, { FC, useCallback, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' import { Confirm } from 'semantic-ui-react' -import { User, useUserApi } from '../api/User' -import useAuth from './useAuth' +import { User, useUserApi } from '../../api/User' +import useAuth from '../useAuth' interface Props { user: User @@ -11,7 +11,7 @@ interface Props { const UserModalDelete: FC = props => { const { token } = useAuth() - const { deleteUser } = useUserApi(token!) + const { deleteUser } = useUserApi(token) const [open, setOpen] = useState(false) const queryClient = useQueryClient() const user = props.user diff --git a/src/components/UserModalForm.tsx b/src/components/user/UserModalForm.tsx similarity index 96% rename from src/components/UserModalForm.tsx rename to src/components/user/UserModalForm.tsx index 107371bf..5f88a4dd 100644 --- a/src/components/UserModalForm.tsx +++ b/src/components/user/UserModalForm.tsx @@ -1,6 +1,6 @@ import React, { FC, useCallback, useState } from 'react' import { Button, Header, Modal } from 'semantic-ui-react' -import { User } from '../api/User' +import { User } from '../../api/User' import UserForm from './UserForm' interface Props { diff --git a/src/views/HomeView.tsx b/src/views/HomeView.tsx index cb0b82c5..87be8c74 100644 --- a/src/views/HomeView.tsx +++ b/src/views/HomeView.tsx @@ -7,11 +7,11 @@ import { Loader, Message, } from 'semantic-ui-react' -import TickerList from '../components/TickerList' +import TickerList from '../components/ticker/TickerList' import useAuth from '../components/useAuth' import { useTickerApi } from '../api/Ticker' import { useQuery } from '@tanstack/react-query' -import TickerModalForm from '../components/TickerModalForm' +import TickerModalForm from '../components/ticker/TickerModalForm' import Layout from './Layout' import ErrorView from './ErrorView' import { Navigate } from 'react-router' diff --git a/src/views/Layout.tsx b/src/views/Layout.tsx index 3bddc2cf..814a3b26 100644 --- a/src/views/Layout.tsx +++ b/src/views/Layout.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' import { Container } from 'semantic-ui-react' -import Navigation from './Navigation' +import Navigation from '../components/navigation/Navigation' interface Props { children: React.ReactNode diff --git a/src/views/SettingsView.tsx b/src/views/SettingsView.tsx index 62e3c6cd..a950315e 100644 --- a/src/views/SettingsView.tsx +++ b/src/views/SettingsView.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react' import { Grid, Header } from 'semantic-ui-react' -import RefreshIntervalCard from '../components/RefreshIntervalCard' -import InactiveSettingsCard from '../components/InactiveSettingsCard' +import RefreshIntervalCard from '../components/settings/RefreshIntervalCard' +import InactiveSettingsCard from '../components/settings/InactiveSettingsCard' import Layout from './Layout' const SettingsView: FC = () => { diff --git a/src/views/TickerView.tsx b/src/views/TickerView.tsx index ca311d35..1919eb18 100644 --- a/src/views/TickerView.tsx +++ b/src/views/TickerView.tsx @@ -4,7 +4,7 @@ import { useTickerApi } from '../api/Ticker' import { useQuery } from '@tanstack/react-query' import { useParams } from 'react-router-dom' import useAuth from '../components/useAuth' -import Ticker from '../components/Ticker' +import Ticker from '../components/ticker/Ticker' import Layout from './Layout' import ErrorView from './ErrorView' diff --git a/src/views/UsersView.tsx b/src/views/UsersView.tsx index a8f17b04..6baab93c 100644 --- a/src/views/UsersView.tsx +++ b/src/views/UsersView.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' import { Grid, Header } from 'semantic-ui-react' -import UserList from '../components/UserList' +import UserList from '../components/user/UserList' import Layout from './Layout' const UsersView: FC = () => {