Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP(3): Component folder structure #2125

Merged
merged 4 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { render } from '@testing-library/react'
import Breadcrumbs from './Breadcrumbs.tsx'
import Breadcrumbs from './Breadcrumbs'

// Imported to be able to use expect(...).toBeInTheDocument()
import '@testing-library/jest-dom'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import { useRouter } from 'next/router'
import Link from 'next/link'
import styles from '../scss/breadcrumbs.module.scss'
import styles from './breadcrumbs.module.scss'
import { Dropdown } from 'react-bootstrap'
import { GetAppQuery } from '../graphql'
import { GetAppQuery } from '../../graphql'
import { ChevronRightIcon } from '@primer/octicons-react'
import { lowerCase } from 'lodash'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use './_variables.module';
@use '../../scss/_variables.module';

@mixin flexRow {
display: flex;
Expand Down
1 change: 1 addition & 0 deletions components/Breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Breadcrumbs'
File renamed without changes.
1 change: 1 addition & 0 deletions components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Card'
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ import {
within
} from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { mockUseBreakpoint } from '../__mocks__/useBreakpoint.mock'
import ChallengeMaterial from './ChallengeMaterial'
import { mockUseBreakpoint } from '../../__mocks__/useBreakpoint.mock'
import ChallengeMaterial from '.'
import { MockedProvider } from '@apollo/client/testing'
import ADD_COMMENT from '../graphql/queries/addComment'
import SET_STAR from '../graphql/queries/setStar'
import GET_PREVIOUS_SUBMISSIONS from '../graphql/queries/getPreviousSubmissions'
import GET_LESSON_MENTORS from '../graphql/queries/getLessonMentors'
import lessonMentorsData from '../__dummy__/getLessonMentorsData'
import ADD_COMMENT from '../../graphql/queries/addComment'
import SET_STAR from '../../graphql/queries/setStar'
import GET_PREVIOUS_SUBMISSIONS from '../../graphql/queries/getPreviousSubmissions'
import GET_LESSON_MENTORS from '../../graphql/queries/getLessonMentors'
import lessonMentorsData from '../../__dummy__/getLessonMentorsData'
import '@testing-library/jest-dom'
import { SubmissionStatus } from '../graphql'
import getPreviousSubmissionsData from '../__dummy__/getPreviousSubmissionsData'
import dummySessionData from '../__dummy__/sessionData'
import { ContextProvider, GlobalContext } from '../helpers/globalContext'
import { SubmissionStatus } from '../../graphql'
import getPreviousSubmissionsData from '../../__dummy__/getPreviousSubmissionsData'
import dummySessionData from '../../__dummy__/sessionData'
import { ContextProvider, GlobalContext } from '../../helpers/globalContext'
import _ from 'lodash'

jest.mock('../helpers/updateCache')
import { updateCache } from '../helpers/updateCache'
jest.mock('../../helpers/updateCache')
import { updateCache } from '../../helpers/updateCache'

jest.useFakeTimers('modern').setSystemTime(new Date('2000-11-22').getTime())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ import {
Submission,
UserLesson,
useGetPreviousSubmissionsQuery
} from '../graphql/index'
import NavLink from './NavLink'
} from '../../graphql/index'
import NavLink from '../NavLink'
import Markdown from 'markdown-to-jsx'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import LocalizedFormat from 'dayjs/plugin/localizedFormat'
import { GiveStarCard } from '../components/GiveStarCard'
import { GiveStarCard } from '../GiveStarCard'
import _ from 'lodash'
import Modal from 'react-bootstrap/Modal'
import { SubmissionStatus, useAddCommentMutation } from '../graphql'
import DiffView from './DiffView'
import { Button } from './theme/Button'
import { MdInput } from './MdInput'
import { updateCache } from '../helpers/updateCache'
import { GlobalContext } from '../helpers/globalContext'
import { SubmissionComments } from './SubmissionComments'
import { SelectIteration } from './SelectIteration'
import Error, { StatusCode } from './Error'
import { ReviewStatus } from './ReviewStatus'
import useBreakpoint from '../helpers/useBreakpoint'
import { SubmissionStatus, useAddCommentMutation } from '../../graphql'
import DiffView from '../DiffView'
import { Button } from '../theme/Button'
import { MdInput } from '../MdInput'
import { updateCache } from '../../helpers/updateCache'
import { GlobalContext } from '../../helpers/globalContext'
import { SubmissionComments } from '../SubmissionComments'
import { SelectIteration } from '../SelectIteration'
import Error, { StatusCode } from '../Error'
import { ReviewStatus } from '../ReviewStatus'
import useBreakpoint from '../../helpers/useBreakpoint'
dayjs.extend(relativeTime)
dayjs.extend(LocalizedFormat)

Expand Down
1 change: 1 addition & 0 deletions components/ChallengeMaterial/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './ChallengeMaterial'
2 changes: 1 addition & 1 deletion stories/components/ChallengeQuestionCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { ChallengeQuestionCard } from '../../components/ChallengeMaterial'
import { ChallengeQuestionCard } from '../../components/ChallengeMaterial/ChallengeMaterial'
import { MockedProvider } from '@apollo/client/testing'

export default {
Expand Down
2 changes: 1 addition & 1 deletion stories/components/ChallengeTitleCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { action } from '@storybook/addon-actions'
import { ChallengeTitleCard } from '../../components/ChallengeMaterial'
import { ChallengeTitleCard } from '../../components/ChallengeMaterial/ChallengeMaterial'

export default {
component: ChallengeTitleCard,
Expand Down
2 changes: 1 addition & 1 deletion stories/components/ChallengesCompletedCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MockedProvider } from '@apollo/client/testing'
import * as React from 'react'
import { ChallengesCompletedCard } from '../../components/ChallengeMaterial'
import { ChallengesCompletedCard } from '../../components/ChallengeMaterial/ChallengeMaterial'
import SET_STAR from '../../graphql/queries/setStar'
import GET_LESSON_MENTORS from '../../graphql/queries/getLessonMentors'
import lessonMentorsData from '../../__dummy__/getLessonMentorsData'
Expand Down