1
Fork 0

Move some files to ui/helpers dir

This commit is contained in:
viktorstrate 2021-04-03 17:54:25 +02:00
parent 95c174d3a5
commit a8ec5db9dc
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
22 changed files with 25 additions and 22 deletions

View File

@ -8,7 +8,7 @@ import { useQuery, gql } from '@apollo/client'
import { Authorized } from './components/routes/AuthorizedRoute'
import { Helmet } from 'react-helmet'
import Header from './components/header/Header'
import { authToken } from './authentication'
import { authToken } from './helpers/authentication'
export const ADMIN_QUERY = gql`
query adminQuery {

View File

@ -7,9 +7,9 @@ import { render, screen } from '@testing-library/react'
import Layout, { ADMIN_QUERY, MAPBOX_QUERY, SideMenu } from './Layout'
import { MemoryRouter } from 'react-router-dom'
import * as authentication from './authentication'
import * as authentication from './helpers/authentication'
jest.mock('./authentication.js')
jest.mock('./helpers/authentication.js')
test('Layout component', async () => {
render(

View File

@ -5,7 +5,7 @@ import { Button, Form, Message, Header } from 'semantic-ui-react'
import { Container } from './loginUtilities'
import { checkInitialSetupQuery, login } from './loginUtilities'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
const initialSetupMutation = gql`
mutation InitialSetup(

View File

@ -4,7 +4,7 @@ import { Redirect } from 'react-router-dom'
import styled from 'styled-components'
import { Button, Form, Message, Header } from 'semantic-ui-react'
import { checkInitialSetupQuery, login, Container } from './loginUtilities'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
import logoPath from '../../assets/photoview-logo.svg'

View File

@ -1,5 +1,5 @@
import { gql } from '@apollo/client'
import { saveTokenCookie } from '../../authentication'
import { saveTokenCookie } from '../../helpers/authentication'
import styled from 'styled-components'
import { Container as SemanticContainer } from 'semantic-ui-react'

View File

@ -5,7 +5,10 @@ import { Route, Switch } from 'react-router-dom'
import RouterProps from 'react-router-prop-types'
import { Form, Header, Icon, Input, Message } from 'semantic-ui-react'
import styled from 'styled-components'
import { getSharePassword, saveSharePassword } from '../../authentication'
import {
getSharePassword,
saveSharePassword,
} from '../../helpers/authentication'
import AlbumSharePage from './AlbumSharePage'
import MediaSharePage from './MediaSharePage'

View File

@ -10,7 +10,7 @@ import { onError } from '@apollo/client/link/error'
import { WebSocketLink } from '@apollo/client/link/ws'
import urlJoin from 'url-join'
import { clearTokenCookie } from './authentication'
import { clearTokenCookie } from './helpers/authentication'
import { MessageState } from './components/messages/Messages'
export const GRAPHQL_ENDPOINT = process.env.PHOTOVIEW_API_ENDPOINT

View File

@ -1,5 +1,5 @@
import React from 'react'
import { authToken } from '../authentication'
import { authToken } from '../helpers/authentication'
import { Checkbox, Dropdown, Button, Icon } from 'semantic-ui-react'
import styled from 'styled-components'
import PropTypes from 'prop-types'

View File

@ -7,7 +7,7 @@ import { Icon } from 'semantic-ui-react'
import { SidebarContext } from './sidebar/Sidebar'
import AlbumSidebar from './sidebar/AlbumSidebar'
import { useLazyQuery, gql } from '@apollo/client'
import { authToken } from '../authentication'
import { authToken } from '../helpers/authentication'
const Header = styled.h1`
margin: 24px 0 8px 0 !important;

View File

@ -3,7 +3,7 @@ import styled from 'styled-components'
import SearchBar from './Searchbar'
import logoPath from '../../assets/photoview-logo.svg'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
const Container = styled.div`
height: 60px;

View File

@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { useLazyQuery, gql } from '@apollo/client'
import debounce from '../../debounce'
import debounce from '../../helpers/debounce'
import { ProtectedImage } from '../photoGallery/ProtectedMedia'
import { NavLink } from 'react-router-dom'

View File

@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { animated, useTransition } from 'react-spring'
import { Message } from 'semantic-ui-react'
import styled from 'styled-components'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
import MessageProgress from './MessageProgress'
import SubscriptionsHook from './SubscriptionsHook'

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types'
import { useEffect } from 'react'
import { useSubscription, gql } from '@apollo/client'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
const notificationSubscription = gql`
subscription notificationSubscription {

View File

@ -1,7 +1,7 @@
import React, { useState, useRef, useEffect } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import debounce from '../../../debounce'
import debounce from '../../../helpers/debounce'
import ExitIcon from './icons/Exit'
import NextIcon from './icons/Next'

View File

@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import { Route, Redirect } from 'react-router-dom'
import { useQuery, gql } from '@apollo/client'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
export const ADMIN_QUERY = gql`
query adminQuery {

View File

@ -5,9 +5,9 @@ import AuthorizedRoute from './AuthorizedRoute'
import { render, screen } from '@testing-library/react'
import { MemoryRouter, Route } from 'react-router-dom'
import * as authentication from '../../authentication'
import * as authentication from '../../helpers/authentication'
jest.mock('../../authentication.js')
jest.mock('../../helpers/authentication.js')
describe('AuthorizedRoute component', () => {
const AuthorizedComponent = () => <div>authorized content</div>

View File

@ -3,7 +3,7 @@ import { Route, Switch, Redirect } from 'react-router-dom'
import { Loader } from 'semantic-ui-react'
import Layout from '../../Layout'
import { clearTokenCookie } from '../../authentication'
import { clearTokenCookie } from '../../helpers/authentication'
const AuthorizedRoute = React.lazy(() => import('./AuthorizedRoute'))

View File

@ -2,7 +2,7 @@ import PropTypes from 'prop-types'
import React, { useEffect } from 'react'
import { useLazyQuery, gql } from '@apollo/client'
import styled from 'styled-components'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
import { ProtectedImage, ProtectedVideo } from '../photoGallery/ProtectedMedia'
import SidebarShare from './Sharing'
import SidebarDownload from './SidebarDownload'

View File

@ -10,7 +10,7 @@ import {
Icon,
} from 'semantic-ui-react'
import copy from 'copy-to-clipboard'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
import styled from 'styled-components'
const sharePhotoQuery = gql`

View File

@ -4,7 +4,7 @@ import { Table } from 'semantic-ui-react'
import styled from 'styled-components'
import { MessageState } from '../messages/Messages'
import { useLazyQuery, gql } from '@apollo/client'
import { authToken } from '../../authentication'
import { authToken } from '../../helpers/authentication'
export const SIDEBAR_DOWNLOAD_QUERY = gql`
query sidebarDownloadQuery($mediaId: ID!) {