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(9): Component folder structure #2891

Merged
merged 3 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions components/ChallengeMaterial/ChallengeMaterial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import MdInput from '../MdInput'
import { updateCache } from '../../helpers/updateCache'
import { GlobalContext } from '../../helpers/globalContext'
import { SubmissionComments } from '../SubmissionComments'
import { SelectIteration } from '../SelectIteration'
import SelectIteration from '../SelectIteration'
import Error, { StatusCode } from '../Error'
import { ReviewStatus } from '../ReviewStatus'
import ReviewStatus from '../ReviewStatus'
import useBreakpoint from '../../helpers/useBreakpoint'
import MDXcomponents from '../../helpers/mdxComponents'
dayjs.extend(relativeTime)
Expand Down
4 changes: 2 additions & 2 deletions components/ReviewCard/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import Markdown from 'markdown-to-jsx'
import MdInput from '../MdInput'
import DiffView from '../DiffView'
import { updateCache } from '../../helpers/updateCache'
import { SelectIteration } from '../SelectIteration'
import SelectIteration from '../SelectIteration'
import Error, { StatusCode } from '../Error'
import { ReviewStatus } from '../ReviewStatus'
import ReviewStatus from '../ReviewStatus'
import styles from './reviewCard.module.scss'
dayjs.extend(relativeTime)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import { ReviewStatus } from './ReviewStatus'
import { SubmissionStatus } from '../graphql'
import ReviewStatus from './ReviewStatus'
import { SubmissionStatus } from '../../graphql'

describe('ReviewComment component', () => {
const data = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react'
import dayjs from 'dayjs'
import LocalizedFormat from 'dayjs/plugin/localizedFormat'
import { SubmissionStatus } from '../graphql/index'
import styles from '../scss/reviewerComment.module.scss'
import ReviewerProfile from './ReviewerProfile'
import { SubmissionStatus } from '../../graphql/index'
import styles from './reviewStatus.module.scss'
import ReviewerProfile from '../ReviewerProfile'
import Markdown from 'markdown-to-jsx'
dayjs.extend(LocalizedFormat)

export const ReviewStatus: React.FC<{
const ReviewStatus: React.FC<{
username?: string
name?: string
comment?: string | null
Expand Down Expand Up @@ -60,3 +60,5 @@ export const ReviewStatus: React.FC<{
</div>
)
}

export default ReviewStatus
1 change: 1 addition & 0 deletions components/ReviewStatus/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './ReviewStatus'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react'
import styles from '../scss/scrollTopArrow.module.scss'
import styles from './scrollTopArrow.module.scss'
import throttle from 'lodash/throttle'
import Image from 'next/image'

Expand Down
1 change: 1 addition & 0 deletions components/ScrollTopArrow/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './ScrollTopArrow'
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { SelectIteration } from './SelectIteration'
import SelectIteration from './SelectIteration'
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import userEvent from '@testing-library/user-event'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react'
import styles from '../scss/selectIteration.module.scss'
import styles from './selectIteration.module.scss'
import { ApolloError } from '@apollo/client'
import {
Submission,
GetPreviousSubmissionsQuery,
SubmissionStatus
} from '../graphql'
} from '../../graphql'
import { Badge, Button } from 'react-bootstrap'

type IterationLink = {
Expand Down Expand Up @@ -101,7 +101,7 @@ const SelectDisplay: React.FC<Omit<SelectIteration, 'error'>> = ({
return <></>
}

export const SelectIteration: React.FC<SelectIteration> = ({
const SelectIteration: React.FC<SelectIteration> = ({
loading,
error,
data,
Expand Down Expand Up @@ -132,3 +132,5 @@ export const SelectIteration: React.FC<SelectIteration> = ({
</div>
)
}

export default SelectIteration
1 change: 1 addition & 0 deletions components/SelectIteration/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './SelectIteration'
2 changes: 1 addition & 1 deletion stories/components/ReviewStatus.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { ReviewStatus } from '../../components/ReviewStatus'
import ReviewStatus from '../../components/ReviewStatus'
import { SubmissionStatus } from '../../graphql'

export default {
Expand Down
2 changes: 1 addition & 1 deletion stories/components/SelectIteration.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloError } from '@apollo/client'
import React from 'react'
import { SelectIteration } from '../../components/SelectIteration'
import SelectIteration from '../../components/SelectIteration'
import { GetPreviousSubmissionsQuery } from '../../graphql'

export default {
Expand Down