challenges files structure refactor

This commit is contained in:
Mateusz Tylka 2023-05-05 11:27:23 +02:00
parent 84160ce939
commit 6c65af9bd7
10 changed files with 33 additions and 33 deletions

View File

@ -1,4 +1,4 @@
import CHALLENGES_ACTION from '../pages/Challanges/ChallengesActionEnum';
import CHALLENGES_ACTION from '../pages/Challanges/model/ChallengesActionEnum';
import { API } from '../utils/globals';
const getChallenges = (dispatch) => {

View File

@ -6,7 +6,7 @@ import styled from 'styled-components';
import FilterBy from '../FilterBy';
import filterOptions from './filterOptions';
import Media from 'react-media';
import CHALLENGES_ACTION from '../../../pages/Challanges/ChallengesActionEnum';
import CHALLENGES_ACTION from '../../../pages/Challanges/model/ChallengesActionEnum';
const FiltersMenuStyle = styled(FlexColumn)`
position: fixed;

View File

@ -4,12 +4,12 @@ import theme from '../../utils/theme';
import getChallenges from '../../api/getChallenges';
import { CHALLENGES_STATUS_FILTER } from '../../utils/globals';
import FiltersMenu from '../../components/challenges_list/FiltersMenu';
import statusFilterHandle from './statusFilterHandle';
import ChallengesMobile from './ChallengesMobile';
import ChallengesDesktop from './ChallengesDesktop';
import challengeSearchQueryHandler from './challengeSearchQueryHandler';
import ChallengesReducer from './ChallengesReducer';
import CHALLENGES_ACTION from './ChallengesActionEnum';
import statusFilterHandle from './functions/statusFilterHandle';
import ChallengesMobile from './components/ChallengesMobile';
import ChallengesDesktop from './components/ChallengesDesktop';
import challengeSearchQueryHandler from './functions/challengeSearchQueryHandler';
import ChallengesReducer from './model/ChallengesReducer';
import CHALLENGES_ACTION from './model/ChallengesActionEnum';
const Challenges = () => {
const [state, dispatch] = React.useReducer(ChallengesReducer, {

View File

@ -1,14 +1,14 @@
import React from 'react';
import ChallengesStyle from './ChallengesStyle';
import { FlexColumn, FlexRow } from '../../utils/containers';
import Pager from '../../components/generic/Pager';
import { H1, Body } from '../../utils/fonts';
import Search from '../../components/generic/Search';
import { CALC_PAGES } from '../../utils/globals';
import renderChallenges from './renderChallenges';
import Loading from '../../components/generic/Loading';
import cupIco from '../../assets/cup_ico.svg';
import { Svg } from '../../utils/containers';
import ChallengesStyle from '../ChallengesStyle';
import { FlexColumn, FlexRow } from '../../../utils/containers';
import Pager from '../../../components/generic/Pager';
import { H1, Body } from '../../../utils/fonts';
import Search from '../../../components/generic/Search';
import { CALC_PAGES } from '../../../utils/globals';
import renderChallenges from '../functions/renderChallenges';
import Loading from '../../../components/generic/Loading';
import cupIco from '../../../assets/cup_ico.svg';
import { Svg } from '../../../utils/containers';
const ChallengesDesktop = (props) => {
return (

View File

@ -1,13 +1,13 @@
import React from 'react';
import ChallengesStyle from './ChallengesStyle';
import { FlexColumn } from '../../utils/containers';
import Pager from '../../components/generic/Pager';
import { H1 } from '../../utils/fonts';
import Search from '../../components/generic/Search';
import { CALC_PAGES } from '../../utils/globals';
import renderChallenges from './renderChallenges';
import Loading from '../../components/generic/Loading';
import CHALLENGES_ACTION from './ChallengesActionEnum';
import ChallengesStyle from '../ChallengesStyle';
import { FlexColumn } from '../../../utils/containers';
import Pager from '../../../components/generic/Pager';
import { H1 } from '../../../utils/fonts';
import Search from '../../../components/generic/Search';
import { CALC_PAGES } from '../../../utils/globals';
import renderChallenges from '../functions/renderChallenges';
import Loading from '../../../components/generic/Loading';
import CHALLENGES_ACTION from '../model/ChallengesActionEnum';
const ChallengesMobile = (props) => {
return (

View File

@ -1,4 +1,4 @@
import CHALLENGES_ACTION from './ChallengesActionEnum';
import CHALLENGES_ACTION from '../model/ChallengesActionEnum';
const challengeSearchQueryHandler = (event, challengesFromAPI, dispatch) => {
let searchQuery = event.target.value;

View File

@ -1,6 +1,6 @@
import { ELEMENTS_PER_PAGE } from '../../utils/globals';
import MiniChallenge from '../../components/challenges_list/MiniChallenge';
import { Grid } from '../../utils/containers';
import { ELEMENTS_PER_PAGE } from '../../../utils/globals';
import MiniChallenge from '../../../components/challenges_list/MiniChallenge';
import { Grid } from '../../../utils/containers';
import styled from 'styled-components';
const ChallengesGrid = styled(Grid)`

View File

@ -1,5 +1,5 @@
import { CHALLENGES_STATUS_FILTER } from '../../utils/globals';
import CHALLENGES_ACTION from './ChallengesActionEnum';
import { CHALLENGES_STATUS_FILTER } from '../../../utils/globals';
import CHALLENGES_ACTION from '../model/ChallengesActionEnum';
const dateIsOlder = (newerDate, olderDate) => {
if (newerDate.year > olderDate.year) return true;