Skip to content

Commit

Permalink
Merge pull request #257 from I3uckwheat/fix/directory-refactor
Browse files Browse the repository at this point in the history
Fix/216 directory refactor
  • Loading branch information
I3uckwheat authored Apr 24, 2021
2 parents 3c31697 + ee8389b commit a5ddd13
Show file tree
Hide file tree
Showing 58 changed files with 66 additions and 1,289 deletions.
10 changes: 3 additions & 7 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import React, { useState } from 'react';
import './reset.css';
import './App.css';

import WelcomeScreen from './components/screens/WelcomeScreen/WelcomeScreen';
import HostScreenController from './components/screenControllers/HostScreenController/HostScreenController';
import PlayerScreenController from './components/screenControllers/PlayerScreenController/PlayerScreenController';
import WelcomeScreen from './screens/WelcomeScreen/WelcomeScreen';
import HostScreenController from './screenControllers/HostScreenController/HostScreenController';
import PlayerScreenController from './screenControllers/PlayerScreenController/PlayerScreenController';
import { PlayerProvider } from './contexts/PlayerContext/PlayerContext';
import HostProvider from './contexts/HostContext/HostContext';

Expand Down
88 changes: 0 additions & 88 deletions frontend/src/components/SocketTest.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import styled from 'styled-components';
import PropTypes from 'prop-types';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

import Button from '../Buttons/Button';
import Header from '../Header/Header';
import Button from '../../components/Buttons/Button';
import Header from '../../components/Header/Header';

const propTypes = {
title: PropTypes.shape({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { useState } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';

import HamburgerMenu from '../Buttons/HamburgerMenu/HamburgerMenu.js';
import Header from '../Header/Header.js';
import Modal from '../Modal/Modal.js';
import HamburgerMenu from '../components/Buttons/HamburgerMenu/HamburgerMenu.js';
import Header from '../components/Header/Header.js';
import Modal from '../components/Modal/Modal.js';

const propTypes = {
left: PropTypes.node.isRequired,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import { HostContext } from '../../contexts/HostContext/HostContext';
import HostPregameScreen from '../../screens/HostPregameScreen/HostPregameScreen';
import WinnerSelectScreen from '../../screens/WinnerSelectScreen/WinnerSelectScreen';
import HostBlackCardScreen from '../../screens/HostBlackCardScreen/HostBlackCardScreen';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import { HostContext } from '../../contexts/HostContext/HostContext';

import HostScreenController from './HostScreenController';
import HostPregameScreen from '../../screens/HostPregameScreen/HostPregameScreen';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';
import PlayerJoinScreen from '../../screens/PlayerJoinScreen/PlayerJoinScreen';
import PlayerMessageScreen from '../../screens/PlayerMessageScreen/PlayerMessageScreen';
import PlayerHandScreen from '../../screens/PlayerHandScreen/PlayerHandScreen';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import React from 'react';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

import PlayerScreenController from './PlayerScreenController';
import PlayerJoinScreen from '../../screens/PlayerJoinScreen/PlayerJoinScreen';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useContext, useState } from 'react';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

import CardHandLayout from '../../CardHandLayout/CardHandLayout';
import CzarHand from '../../CzarHand/CzarHand';
import CardHandLayout from '../../layouts/CardHandLayout/CardHandLayout';
import CzarHand from '../../components/CzarHand/CzarHand';

export default function CzarHandScreen() {
const { state, dispatch } = useContext(PlayerContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, screen, act } from '@testing-library/react';
import renderer from 'react-test-renderer';
import userEvent from '@testing-library/user-event';
import CzarHandScreen from './CzarHandScreen';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

describe('CzarHandScreen', () => {
describe('render', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useContext, useEffect } from 'react';
import styled from 'styled-components';
import HostLayout from '../../layouts/HostLayout';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import PlayerList from '../../PlayerList/PlayerList';
import InGameSettingsModal from '../../HostSettingsMenu/InGameSettingsModal.js';
import JoinCode from '../../JoinCode/JoinCode';
import BlackCard from '../../Cards/BlackCard';
import { HostContext } from '../../contexts/HostContext/HostContext';
import PlayerList from '../../components/PlayerList/PlayerList';
import InGameSettingsModal from '../../components/HostSettingsMenu/InGameSettingsModal.js';
import JoinCode from '../../components/JoinCode/JoinCode';
import BlackCard from '../../components/Cards/BlackCard';

const LeftPanelWrapper = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { render, screen, waitFor } from '@testing-library/react';
import renderer from 'react-test-renderer';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import { HostContext } from '../../contexts/HostContext/HostContext';
import HostBlackCardScreen from './HostBlackCardScreen';

jest.mock('../../GameSettings/GameSettings', () => () => (
jest.mock('../../components/GameSettings/GameSettings', () => () => (
<div data-testid="game-settings" />
));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useContext, useEffect } from 'react';
import styled from 'styled-components';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import { HostContext } from '../../contexts/HostContext/HostContext';
import HostLayout from '../../layouts/HostLayout';
import PlayerList from '../../PlayerList/PlayerList';
import GameSettings from '../../GameSettings/GameSettings';
import PregameSettingsModal from '../../HostSettingsMenu/PregameSettingsModal';
import JoinCode from '../../JoinCode/JoinCode';
import Button from '../../Buttons/Button';
import LoadingIndicator from '../../LoadingIndicator/LoadingIndicator';
import PlayerList from '../../components/PlayerList/PlayerList';
import GameSettings from '../../components/GameSettings/GameSettings';
import PregameSettingsModal from '../../components/HostSettingsMenu/PregameSettingsModal';
import JoinCode from '../../components/JoinCode/JoinCode';
import Button from '../../components/Buttons/Button';
import LoadingIndicator from '../../components/LoadingIndicator/LoadingIndicator';

const LeftPanelWrapper = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import { render, screen, act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import renderer from 'react-test-renderer';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import { HostContext } from '../../contexts/HostContext/HostContext';
import HostPregameScreen from './HostPregameScreen';

jest.mock('../../GameSettings/GameSettings', () => () => (
jest.mock('../../components/GameSettings/GameSettings', () => () => (
<div data-testid="game-settings" />
));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useContext, useEffect } from 'react';
import styled from 'styled-components';
import HostLayout from '../../layouts/HostLayout';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import PlayerList from '../../PlayerList/PlayerList';
import InGameSettingsModal from '../../HostSettingsMenu/InGameSettingsModal.js';
import JoinCode from '../../JoinCode/JoinCode';
import BlackCard from '../../Cards/BlackCard';
import WhiteCard from '../../Cards/WhiteCard';
import { HostContext } from '../../contexts/HostContext/HostContext';
import PlayerList from '../../components/PlayerList/PlayerList';
import InGameSettingsModal from '../../components/HostSettingsMenu/InGameSettingsModal.js';
import JoinCode from '../../components/JoinCode/JoinCode';
import BlackCard from '../../components/Cards/BlackCard';
import WhiteCard from '../../components/Cards/WhiteCard';

const LeftPanelWrapper = styled.div`
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import renderer from 'react-test-renderer';
import { HostContext } from '../../../contexts/HostContext/HostContext';
import { HostContext } from '../../contexts/HostContext/HostContext';
import HostWinnerScreen from './HostWinnerScreen';

describe('Host Winner Screen', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState, useContext } from 'react';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

import CardHandLayout from '../../CardHandLayout/CardHandLayout';
import PlayerHand from '../../PlayerHand/PlayerHand';
import CardHandLayout from '../../layouts/CardHandLayout/CardHandLayout';
import PlayerHand from '../../components/PlayerHand/PlayerHand';

export default function PlayerHandScreen() {
const { state, dispatch } = useContext(PlayerContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, screen, act } from '@testing-library/react';
import renderer from 'react-test-renderer';
import userEvent from '@testing-library/user-event';
import PlayerHandScreen from './PlayerHandScreen';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

describe('PlayerHandScreen', () => {
describe('render', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useContext, useState } from 'react';
import styled from 'styled-components';
import Button from '../../Buttons/Button';
import Header from '../../Header/Header';
import Footer from '../../Footer/Footer';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import Button from '../../components/Buttons/Button';
import Header from '../../components/Header/Header';
import Footer from '../../components/Footer/Footer';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

const propTypes = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PlayerJoinScreen from './PlayerJoinScreen';
import {
PlayerContext,
PlayerProvider,
} from '../../../contexts/PlayerContext/PlayerContext';
} from '../../contexts/PlayerContext/PlayerContext';

describe('PlayerJoin', () => {
describe('render', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import cardTrioDiagonal from '../../../assets/card-trio-diagonal.svg';
import blackCardDiagonal from '../../../assets/black-card-diagonal.svg';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import LoadingIndicator from '../../LoadingIndicator/LoadingIndicator';
import cardTrioDiagonal from '../../assets/card-trio-diagonal.svg';
import blackCardDiagonal from '../../assets/black-card-diagonal.svg';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';
import LoadingIndicator from '../../components/LoadingIndicator/LoadingIndicator';

const propTypes = {
bigText: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import PlayerMessageScreen from './PlayerMessageScreen';
import { PlayerContext } from '../../../contexts/PlayerContext/PlayerContext';
import { PlayerContext } from '../../contexts/PlayerContext/PlayerContext';

describe('Player message screen', () => {
describe('Rendering', () => {
Expand Down
Loading

0 comments on commit a5ddd13

Please sign in to comment.