Skip to content

Commit

Permalink
Merge pull request #379 from systemli/restructure-components
Browse files Browse the repository at this point in the history
🚚 Restructure components
  • Loading branch information
0x46616c6b authored Oct 8, 2022
2 parents f618328 + 724ca6c commit 86a52bb
Show file tree
Hide file tree
Showing 49 changed files with 101 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Geometry, any>) => void
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<InactiveSetting>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
20 changes: 10 additions & 10 deletions src/components/Ticker.tsx β†’ src/components/ticker/Ticker.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -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[]
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 86a52bb

Please sign in to comment.