Skip to content

Commit

Permalink
Relative path removal
Browse files Browse the repository at this point in the history
  • Loading branch information
sadanandpai committed Jul 15, 2024
1 parent 37bf1c0 commit 72651a9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useContext } from 'react';
import ReactSelect, { MultiValueProps, OptionProps } from 'react-select';
import { components } from 'react-select';
import { OptionType } from '../../../../../../shared/data/types/common';
import PropTypes from 'prop-types';
import { ThemeContext } from '@/components/ThemeWrapper';
import { OptionType } from '@fmc/data/types';

const Option = (props) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { Link } from 'react-router-dom';
import styles from './challenge-grid.module.scss';
import { useMemo } from 'react';
import { contributors } from '@fmc/data/content';
import { OptionType } from '@fmc/data/types';
import { ETag, OptionType } from '@fmc/data/types';
import { Difficulties } from '@fmc/data/constants';
import { Search } from 'lucide-react';
import { ETag } from '../../../../../../../shared/data/types/challenge';

interface Props {
searchInput: string;
Expand Down Expand Up @@ -79,7 +78,7 @@ const ChallengeFilters = ({
className={styles.segmentBtn1}
onClick={() => {
setIsSegmentBtn1(true);
setSelectedChallengesByTags([ETag?.interview]);
setSelectedChallengesByTags([ETag.interview]);
}}
>
Interview
Expand All @@ -89,7 +88,7 @@ const ChallengeFilters = ({
className={styles.segmentBtn2}
onClick={() => {
setIsSegmentBtn1(false);
setSelectedChallengesByTags([ETag?.all]);
setSelectedChallengesByTags([ETag.all]);
}}
>
All
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useEffect, useState } from 'react';
import { IChallenge, OptionType } from '@fmc/data/types';
import { ETag, IChallenge, OptionType } from '@fmc/data/types';
import { contributors } from '@fmc/data/content';
import Challenge from './challenge';
import styles from './challenge-grid.module.scss';
import { getChallengesByid } from '../../../../../../../shared/data/utils/challenges.helper';
import ChallengeFilters from './challenge-filter';
import { ETag } from '../../../../../../../shared/data/types/challenge';
import { getChallengesByid } from '@fmc/data/utils';

interface Props {
challenges: IChallenge[];
Expand Down
2 changes: 1 addition & 1 deletion shared/data/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type { IChallenge } from './challenge';
export { ETag, type IChallenge } from './challenge';
export { EDifficulty } from './challenge';
export type { IContributor } from './contributor';
export type { OptionType } from './common';
1 change: 1 addition & 0 deletions shared/data/utils/challenges.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export function getChallengesByDifficulties(challenges: IChallenge[], difficulti
const difficultyValues = difficulties.map((difficulty) => difficulty.value);
return challenges.filter((challenge) => difficultyValues.includes(challenge.difficulty));
}

export function getChallengesByTags(challenges: IChallenge[], tags: ETag[]) {
if (!tags || tags.length === 0) return challenges;
return challenges.filter((challenge) => {
Expand Down
2 changes: 1 addition & 1 deletion shared/data/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { filterChallengeByKey } from './challenges.helper';
export { filterChallengeByKey, getChallengesByid } from './challenges.helper';

0 comments on commit 72651a9

Please sign in to comment.