repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/share/use-share.test.tsx
client/src/components/share/use-share.test.tsx
import { renderHook } from '@testing-library/react-hooks'; import { useTranslation } from 'react-i18next'; import { describe, test, expect } from 'vitest'; import { hastag, nextLine, space, useShare, twitterData, blueSkyData, threadsData } from './use-share'; describe('useShare', () => { test('useShare...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/share/index.tsx
client/src/components/share/index.tsx
import React from 'react'; import { ShareTemplate } from './share-template'; import { ShareProps } from './types'; import { useShare } from './use-share'; export const Share = ({ superBlock, block }: ShareProps): JSX.Element => { const redirectURLs = useShare({ superBlock, block }); return ( <ShareTe...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/share/use-share.tsx
client/src/components/share/use-share.tsx
import { useTranslation } from 'react-i18next'; import { ShareProps } from './types'; export const space = '%20'; export const hastag = '%23'; export const nextLine = '%0A'; const freecodecampLearnDomainURL = 'www.freecodecamp.org/learn'; export const twitterData = { action: 'intent/post', domain: 'x.com', deve...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/share/share-template.tsx
client/src/components/share/share-template.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { faXTwitter, faBluesky, faInstagram } from '@fortawesome/free-brands-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { ShareRedirectProps } from './types'; export const ShareTemplate: React.Com...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/share/types.ts
client/src/components/share/types.ts
export interface ShareProps { superBlock: string; block: string; } export interface ShareRedirectProps { xRedirectURL: string; blueSkyRedirectURL: string; threadsRedirectURL: string; }
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/SolutionViewer/exam-results-modal.tsx
client/src/components/SolutionViewer/exam-results-modal.tsx
import { connect } from 'react-redux'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { Row, Button, Modal, Spacer } from '@freecodecamp/ui'; import type { GeneratedExamResults } from '../../redux/prop-types'; import { closeModal } from '../../templates/Challenges/redux/actions'; imp...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/SolutionViewer/solution-viewer.tsx
client/src/components/SolutionViewer/solution-viewer.tsx
import Prism from 'prismjs'; import React from 'react'; import { Panel } from '@freecodecamp/ui'; import type { ChallengeFile } from '../../redux/prop-types'; type Props = { challengeFiles: Solution[] | null; solution?: string; }; type Solution = Pick<ChallengeFile, 'ext' | 'contents' | 'fileKey'>; function Solu...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/SolutionViewer/project-modal.tsx
client/src/components/SolutionViewer/project-modal.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Modal } from '@freecodecamp/ui'; import { CompletedChallenge } from '../../redux/prop-types'; import SolutionViewer from './solution-viewer'; type ProjectModalProps = { challengeFiles: CompletedChallenge['challengeFiles'] | ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/skeleton-sprite.tsx
client/src/components/helpers/skeleton-sprite.tsx
import React from 'react'; import styles from './skeleton-styles'; function SkeletonSprite(): JSX.Element { return ( <div className='sprite-container'> <style dangerouslySetInnerHTML={{ __html: styles }} /> <svg className='sprite-svg'> <rect className='sprite' fill='var(-...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/border-color-picker.test.ts
client/src/components/helpers/border-color-picker.test.ts
import { describe, it, expect } from 'vitest'; import borderColorPicker from './border-color-picker'; describe('Border color picker helper', () => { it('should get color for non donators and non top contributors', () => { expect(borderColorPicker(false, false)).toEqual('default-border'); }); it('should get ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/loader.test.tsx
client/src/components/helpers/loader.test.tsx
import { describe, it, expect } from 'vitest'; import { render, screen } from '@testing-library/react'; import React from 'react'; import Loader from './loader'; describe('<Loader />', () => { it('renders to the DOM', () => { const { container } = render(<Loader />); expect(container).toBeTruthy(); }); ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/use-claimable-certs-notification.tsx
client/src/components/helpers/use-claimable-certs-notification.tsx
import { useEffect, useRef } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { claimableCertsSelector, userFetchStateSelector } from '../../redux/selectors'; import { createFlashMessage } from '../Flash/redux'; import { FlashMessages } from '../Flash/redux/flash-messages'; export funct...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/loader.tsx
client/src/components/helpers/loader.tsx
import React, { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import Spinner from 'react-spinkit'; import './loader.css'; interface LoaderProps { fullScreen?: boolean; loaderDelay?: number; messageDelay?: number; } function Loader({ fullScreen, loaderDelay, messageDel...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/button-link.tsx
client/src/components/helpers/button-link.tsx
import React from 'react'; import { Button } from '@freecodecamp/ui'; import Link from './link'; type ButtonSize = 'small' | 'medium' | 'large'; interface Props extends React.AnchorHTMLAttributes<HTMLAnchorElement> { children: React.ReactNode; href: string; className?: string; size?: ButtonSize; onClick?: ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/border-color-picker.ts
client/src/components/helpers/border-color-picker.ts
export default function borderColorPicker( isDonating?: boolean, isTopContributor?: boolean ): string { if (isDonating && isTopContributor) return 'purple-border'; else if (isTopContributor) return 'blue-border'; else if (isDonating) return 'gold-border'; else return 'default-border'; }
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/full-width-row.tsx
client/src/components/helpers/full-width-row.tsx
import { Col, Row } from '@freecodecamp/ui'; import React from 'react'; interface FullWidthRowProps { children: React.ReactNode; className?: string; } const FullWidthRow = ({ children, className }: FullWidthRowProps): JSX.Element => ( <Row className={className}> <Col sm={8} smOffset={2} xs={12}> {...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/skeleton-styles.ts
client/src/components/helpers/skeleton-styles.ts
const styles = ` .sprite-container { height: 100%; width: 100%; } .sprite-svg { height: 100%; width: 100%; background: var(--theme-color); } @-webkit-keyframes shimmer{ 0% { -webkit-transform: translateX(0%); transform: translateX(0%); stroke-width: 2px; } 5%{ opacity:100%; } 35% ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/lazy-image.tsx
client/src/components/helpers/lazy-image.tsx
import React, { useState } from 'react'; import './image-loader.css'; interface LazyImageProps { alt?: string; className?: string; height?: number; loadedClassName?: string; loadingClassName?: string; offsetVertical?: number; src?: string; style?: React.CSSProperties; width?: number; } const LazyIm...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/link.tsx
client/src/components/helpers/link.tsx
import { GatsbyLinkProps, Link as GatsbyLink } from 'gatsby'; import React from 'react'; interface LinkProps extends Omit<GatsbyLinkProps<Record<string, unknown>>, 'ref'> { children?: React.ReactNode; external?: boolean; sameTab?: boolean; to: string; } const Link = ({ children, to, external, sameTa...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/link.test.tsx
client/src/components/helpers/link.test.tsx
/* eslint-disable @typescript-eslint/ban-ts-comment */ import { describe, it, expect } from 'vitest'; import React from 'react'; import { create } from 'react-test-renderer'; import Link from './link'; describe('<Link />', () => { const externalLink = create(<Link external={true} to='/home' />).toJSON(); const ga...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/avatar-renderer.tsx
client/src/components/helpers/avatar-renderer.tsx
import { Image } from '@freecodecamp/ui'; import React, { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import isURL from 'validator/lib/isURL'; import DefaultAvatar from '../../assets/icons/default-avatar'; import borderColorPicker from './border-color-picker'; interface AvatarRe...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/index.ts
client/src/components/helpers/index.ts
export { default as FullWidthRow } from './full-width-row'; export { default as Loader } from './loader'; export { default as SkeletonSprite } from './skeleton-sprite'; export { default as Link } from './link'; export { default as LazyImage } from './lazy-image'; export { default as AvatarRenderer } from './avatar-rend...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/form/block-save-button.tsx
client/src/components/helpers/form/block-save-button.tsx
import { Button, type ButtonProps } from '@freecodecamp/ui'; import React from 'react'; import { useTranslation } from 'react-i18next'; function BlockSaveButton({ children, bgSize, ...restProps }: { children?: React.ReactNode; disabled?: boolean; bgSize?: ButtonProps['size']; }): JSX.Element { const { t ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/helpers/form/block-save-button.test.tsx
client/src/components/helpers/form/block-save-button.test.tsx
import { describe, test, expect } from 'vitest'; import { render, screen } from '@testing-library/react'; import React from 'react'; import BlockSaveButton from './block-save-button'; describe('<BlockSaveButton />', () => { test('<BlockSaveButton /> snapshot', () => { const { container } = render(<BlockSaveButt...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/landing-top.tsx
client/src/components/landing/components/landing-top.tsx
import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { useFeature } from '@growthbook/growthbook-react'; import { Container, Col, Row, Spacer } from '@freecodecamp/ui'; import { clientLocale } from '../../../../config/env.json'; import { AmazonLogo, AppleLogo, MicrosoftLogo, ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/certifications.tsx
client/src/components/landing/components/certifications.tsx
import React from 'react'; import { Col, Spacer } from '@freecodecamp/ui'; import Map from '../../Map/index'; import BigCallToAction from './big-call-to-action'; const Certifications = (): JSX.Element => { return ( <Col className='certification-section' md={8} mdOffset={2} sm={10} ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/testimonials.tsx
client/src/components/landing/components/testimonials.tsx
import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import emmaImg from '../../../assets/images/landing/Emma.png'; import sarahImg from '../../../assets/images/landing/Sarah.png'; import shawnImg from '../../../assets/images/landing/Shawn.png'; import { LazyImage } from '../../helpers'; i...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/as-seen-in.tsx
client/src/components/landing/components/as-seen-in.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Container } from '@freecodecamp/ui'; import { AsSeenInText } from '../../../assets/images/components'; const AsSeenIn = (): JSX.Element => { const { t } = useTranslation(); return ( <Container fluid={true} classNam...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/campers-image.tsx
client/src/components/landing/components/campers-image.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import Media from 'react-responsive'; import wideImg from '../../../assets/images/landing/wide-image.png'; import { LazyImage } from '../../helpers'; const LARGE_SCREEN_SIZE = 1200; function CampersImage(): JSX.Element { const { t } = useTra...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/faq.tsx
client/src/components/landing/components/faq.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Col, Spacer } from '@freecodecamp/ui'; import BigCallToAction from './big-call-to-action'; interface FaqItem { question: string; answer: string[]; } const Faq = (): JSX.Element => { const { t } = useTranslation(); const faqIt...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/big-call-to-action.tsx
client/src/components/landing/components/big-call-to-action.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import Login from '../../Header/components/login'; const BigCallToAction = ({ text, testLabel }: { text?: string; testLabel?: string; }): JSX.Element => { const { t } = useTranslation(); return ( <Login block={true} ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/benefits.tsx
client/src/components/landing/components/benefits.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Col, Row, Container, Spacer } from '@freecodecamp/ui'; import FreeIcon from '../../../assets/icons/free'; import CapIcon from '../../../assets/icons/cap'; import CommunityIcon from '../../../assets/icons/community'; import CurriculumIc...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/two-button-cta.tsx
client/src/components/landing/components/two-button-cta.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import envData from '../../../../config/env.json'; import { isSignedInSelector } from '../../../redux/selectors'; import callGA from '../../../analytics/call-ga';...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/landing/components/two-button-cta.test.tsx
client/src/components/landing/components/two-button-cta.test.tsx
import React from 'react'; import { render, screen } from '@testing-library/react'; import { Provider } from 'react-redux'; import { describe, expect, test, vi } from 'vitest'; import { createStore } from '../../../redux/create-store'; import TwoButtonCTA from './two-button-cta'; vi.mock('../../../utils/get-words'); ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/account.tsx
client/src/components/settings/account.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Spacer } from '@freecodecamp/ui'; import { FullWidthRow } from '../helpers'; import SoundSettings from './sound'; import KeyboardShortcutsSettings from './keyboard-shortcuts'; import ScrollbarWidthSettings from './scrollbar-wid...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/toggle-button-setting.tsx
client/src/components/settings/toggle-button-setting.tsx
import React from 'react'; import ToggleCheck from '../../assets/icons/toggle-check'; import type { ToggleSettingProps } from './toggle-radio-setting'; import './toggle-setting.css'; export default function ToggleButtonSetting({ action, explain, flag, flagName, toggleFlag, offLabel, onLabel, dataPlaywr...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/user-token.tsx
client/src/components/settings/user-token.tsx
import React, { Component } from 'react'; import type { TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { Panel, Button, Spacer } from '@freecodecamp/ui'; import { deleteUserToken } from '../../redux/actions'; import { FullWidthRow } from '../h...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/section-header.tsx
client/src/components/settings/section-header.tsx
import React from 'react'; import FullWidthRow from '../helpers/full-width-row'; type SectionHeaderProps = { children: string | React.ReactNode | React.ReactElement; }; function SectionHeader({ children }: SectionHeaderProps): JSX.Element { return ( <FullWidthRow> <h2 className='text-center'>{children}...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/danger-zone.tsx
client/src/components/settings/danger-zone.tsx
import React, { useState } from 'react'; import type { TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import type { Dispatch } from 'redux'; import { Panel, Button, Spacer } from '@freecodecamp/ui'; import ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/scrollbar-width.tsx
client/src/components/settings/scrollbar-width.tsx
import React, { ChangeEvent, useState, useRef } from 'react'; import store from 'store'; import { useTranslation } from 'react-i18next'; import { Spacer } from '@freecodecamp/ui'; import { getScrollbarWidth } from '../../utils/scrollbar-width'; import './scrollbar-width.css'; const ticks = [5, 10, 15, 20, 25]; export...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/sound.tsx
client/src/components/settings/sound.tsx
import React, { ChangeEvent, useState } from 'react'; import store from 'store'; import { useTranslation } from 'react-i18next'; import './sound.css'; import { Spacer } from '@freecodecamp/ui'; import { playTone } from '../../utils/tone'; import ToggleButtonSetting from './toggle-button-setting'; type SoundProps = { ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/toggle-radio-setting.tsx
client/src/components/settings/toggle-radio-setting.tsx
import React from 'react'; import './toggle-setting.css'; export type ToggleSettingProps = { action: string; explain?: string; flag: boolean; flagName: string; toggleFlag: () => void; offLabel: string; onLabel: string; dataPlaywrightTestOffLabel?: string; dataPlaywrightTestOnLabel?: string; }; expor...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/honesty.tsx
client/src/components/settings/honesty.tsx
import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Panel, Button } from '@freecodecamp/ui'; import { FullWidthRow } from '../helpers'; import SectionHeader from './section-header'; import './honesty.css'; type HonestyProps = { isHonest: boolean; updateIsHonest: (obj: { isH...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/exam-token.tsx
client/src/components/settings/exam-token.tsx
import React, { useState } from 'react'; import { Button, Panel, Modal, Spacer } from '@freecodecamp/ui'; import { useTranslation } from 'react-i18next'; import { FullWidthRow } from '../helpers'; import { generateExamToken } from '../../utils/ajax'; import envData from '../../../config/env.json'; const { deploymentEn...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/honesty.test.tsx
client/src/components/settings/honesty.test.tsx
import React from 'react'; import { render, fireEvent, screen } from '@testing-library/react'; import { describe, test, expect, vi } from 'vitest'; import Honesty from './honesty'; describe('<Honesty />', () => { const updateIsHonestMock = vi.fn(); test('<Honesty /> snapshot when isHonest is false', () => { c...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/certification.test.tsx
client/src/components/settings/certification.test.tsx
import { render, screen } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; import { describe, it, expect, vi } from 'vitest'; vi.mock('../../utils/get-words'); import { createStore } from '../../redux/create-store'; import { Ext } from '../../redux/prop-types'; import ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/delete-modal.tsx
client/src/components/settings/delete-modal.tsx
import React, { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Button, ControlLabel, FormControl, FormGroup, Modal, Spacer } from '@freecodecamp/ui'; type DeleteModalProps = { delete: (x?: never) => void; onHide: () => void; show: boolean; }; function Delete...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/reset-modal.tsx
client/src/components/settings/reset-modal.tsx
import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Button, ControlLabel, FormControl, FormGroup, Modal, Spacer } from '@freecodecamp/ui'; type ResetModalProps = { onHide: () => void; reset: (x?: never) => void; show: boolean; }; function ResetModal(prop...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/email.tsx
client/src/components/settings/email.tsx
import { HelpBlock, Callout, FormGroup, FormGroupProps, FormControl, ControlLabel, Button, Spacer } from '@freecodecamp/ui'; import React, { useState } from 'react'; import type { TFunction } from 'i18next'; import { Trans, withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; i...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/privacy.tsx
client/src/components/settings/privacy.tsx
import React, { useState } from 'react'; import { useTranslation, withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import type { Dispatch } from 'redux'; import { createSelector } from 'reselect'; import { Button, Spacer } from '@freecodecamp/ui'...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/keyboard-shortcuts.tsx
client/src/components/settings/keyboard-shortcuts.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Spacer } from '@freecodecamp/ui'; import ToggleButtonSetting from './toggle-button-setting'; type KeyboardShortcutsProps = { keyboardShortcuts: boolean; toggleKeyboardShortcuts: (sound: boolean) => void; explain?: string; }; ex...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/certification.tsx
client/src/components/settings/certification.tsx
import { find } from 'lodash-es'; import React, { MouseEvent, useState } from 'react'; import { withTranslation } from 'react-i18next'; import type { TFunction } from 'i18next'; import { Element } from 'react-scroll'; import { connect } from 'react-redux'; import { Table, Button, Spacer } from '@freecodecamp/ui'; impo...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/settings/settings-sidebar-nav.tsx
client/src/components/settings/settings-sidebar-nav.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Link as ScrollLink } from 'react-scroll'; import { currentCertifications, legacyCertifications, legacyFullStackCertification, upcomingCertifications } from '../../../../shared-dist/config/certification-settings'; import env from...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/staging-warning-modal/staging-warning-modal.test.tsx
client/src/components/staging-warning-modal/staging-warning-modal.test.tsx
import React from 'react'; import { render, screen, fireEvent } from '@testing-library/react'; import store from 'store'; import { describe, it, expect, beforeAll, afterEach, vi } from 'vitest'; import StagingWarningModal from '.'; describe('StagingWarningModal', () => { beforeAll(() => { // The Modal component ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/staging-warning-modal/index.tsx
client/src/components/staging-warning-modal/index.tsx
import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Button, Modal, Spacer } from '@freecodecamp/ui'; import store from 'store'; function StagingWarningModal(): JSX.Element { const { t } = useTranslation(); const [show, setShow] = useState(!store.get('acceptedStagingWa...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/signout-modal/signout-modal.test.ts
client/src/components/signout-modal/signout-modal.test.ts
import { describe, it, expect } from 'vitest'; import { pathAfterSignout } from '.'; describe('pathAfterSignout', () => { it('should default to the supplied path', () => { const unexceptionalPath = 'a/normal/path/'; expect(pathAfterSignout(unexceptionalPath)).toBe(unexceptionalPath); }); it('should red...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/signout-modal/index.tsx
client/src/components/signout-modal/index.tsx
import React from 'react'; import { bindActionCreators, Dispatch, AnyAction } from 'redux'; import { createSelector } from 'reselect'; import { connect } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { Button, Modal, Spacer } from '@freecodecamp/ui'; import { closeSignoutModal } from '../....
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Footer/footer.test.tsx
client/src/components/Footer/footer.test.tsx
import React from 'react'; import renderer from 'react-test-renderer'; import { describe, expect, it } from 'vitest'; import Footer from '.'; describe('<Footer />', () => { it('matches snapshot', () => { const tree = renderer.create(<Footer />).toJSON(); expect(tree).toMatchSnapshot(); }); });
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Footer/index.tsx
client/src/components/Footer/index.tsx
import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Col, Spacer } from '@freecodecamp/ui'; import appleStoreBadge from '../../assets/images/footer-ads/apple-store-badge.svg'; import googlePlayBadge from '../../assets/images/footer-ads/google-play-badge.svg'; import { Link } from ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/growth-book/growth-book-wrapper.tsx
client/src/components/growth-book/growth-book-wrapper.tsx
import React, { useEffect, useMemo } from 'react'; import { GrowthBook, GrowthBookProvider } from '@growthbook/growthbook-react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { userSelector, userFetchStateSelector } from '../../redux/selectors'; import envData from '../../../...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/growth-book/codeally-button.tsx
client/src/components/growth-book/codeally-button.tsx
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React from 'react'; import { useFeature } from '@growthbook/growthbook-react'; import { useTranslation } from 'react-i18next'; import { Button } from '@freecodecamp/ui'; import...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/growth-book/growth-book-redux-connector.tsx
client/src/components/growth-book/growth-book-redux-connector.tsx
import { useEffect } from 'react'; import { useFeature } from '@growthbook/growthbook-react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { isSignedInSelector, isRandomCompletionThresholdSelector, userIdSelector, userFetchStateSelector } from '../../redux/selectors'...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/growth-book/codeally-down.tsx
client/src/components/growth-book/codeally-down.tsx
import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Callout, Spacer } from '@freecodecamp/ui'; import { useFeature } from '@growthbook/growthbook-react'; const Down = () => { const { t } = useTranslation(); return ( <Callout variant='caution' label={t('misc.caution')}> ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/growth-book/growth-book-wrapper.test.tsx
client/src/components/growth-book/growth-book-wrapper.test.tsx
import React from 'react'; import { vi, describe, test, expect, beforeEach } from 'vitest'; import { render, waitFor } from '@testing-library/react'; import GrowthBookWrapper from './growth-book-wrapper'; interface MinimalUser { completedChallenges: unknown[]; email: string; joinDate: string; } interface TestWr...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/growth-book/ona-note.tsx
client/src/components/growth-book/ona-note.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Callout } from '@freecodecamp/ui'; import { useFeatureValue } from '@growthbook/growthbook-react'; import { SuperBlocks } from '../../../../shared-dist/config/curriculum'; import { Link } from '../helpers'; type OnaNoteProps = { supe...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/seo/seo.test.tsx
client/src/components/seo/seo.test.tsx
import React from 'react'; import { render } from '@testing-library/react'; import Helmet from 'react-helmet'; import { describe, it, expect, vi, afterEach } from 'vitest'; import SEO from './index'; const mockUseStaticQuery = { site: { siteMetadata: { title: 'freeCodeCamp' } } }; vi.mock('gatsby',...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/seo/index.tsx
client/src/components/seo/index.tsx
import { useStaticQuery, graphql } from 'gatsby'; import React from 'react'; import Helmet from 'react-helmet'; import { useTranslation } from 'react-i18next'; import { SuperBlocks } from '../../../../shared-dist/config/curriculum'; interface SEOProps { title?: string; } interface SiteData { site: { siteMetad...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/donate-form.tsx
client/src/components/Donation/donate-form.tsx
/* eslint-disable @typescript-eslint/unbound-method */ import type { Token } from '@stripe/stripe-js'; import React, { Component } from 'react'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import Spinner from 'react-spinkit'; import { createSelector } from 'reselect'; import ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/donation-modal-body.tsx
client/src/components/Donation/donation-modal-body.tsx
import React, { useEffect, useState, useRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useFeature } from '@growthbook/growthbook-react'; import { Col, Row, Modal, Spacer } from '@freecodecamp/ui'; import { closeDonationModal } from '../../redux/actions'; import { PaymentContext } from '../...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/patreon-button.tsx
client/src/components/Donation/patreon-button.tsx
import React from 'react'; import { DonationAmount, donationUrls, PaymentProvider } from '../../../../shared-dist/config/donation-settings'; import envData from '../../../config/env.json'; import PatreonLogo from '../../assets/images/components/patreon-logo'; import { PostPayment } from './types'; const { patreo...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/security-lock-icon.tsx
client/src/components/Donation/security-lock-icon.tsx
import React from 'react'; import { faLock } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; const SecurityLockIcon = (): JSX.Element => { return ( <> <FontAwesomeIcon icon={faLock} /> &nbsp;&nbsp; </> ); }; export default SecurityLoc...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/paypal-button-script-loader.tsx
client/src/components/Donation/paypal-button-script-loader.tsx
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { scriptLoader, scriptRemover } from '../../utils/script-loaders'; import type { DonationApprovalData } from './types'; type PayPalButtonScriptLoaderProps = { isMinimalForm: boolean | undefined; clientId: string; createOrder: ( ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/utils.ts
client/src/components/Donation/utils.ts
const numToCommas = (num: number) => Intl.NumberFormat('en-US').format(num); const EDUCATION_HOURS_PER_DOLLAR = 50; export const CENTS_IN_DOLLAR = 100; export const convertToTimeContributed = (amount: number) => numToCommas((amount / CENTS_IN_DOLLAR) * EDUCATION_HOURS_PER_DOLLAR); export const formattedAmountLabel = ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/donate-completion.tsx
client/src/components/Donation/donate-completion.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import Spinner from 'react-spinkit'; import { Alert, Spacer } from '@freecodecamp/ui'; import { Link } from '../helpers'; type DonateCompletionProps = { error: string | null; processing: boolean; redirecting: boolean; reset: () => unkn...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/card-update-alert-handler.tsx
client/src/components/Donation/card-update-alert-handler.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import Spinner from 'react-spinkit'; import { Alert } from '@freecodecamp/ui'; type CardUpdateAlertHandlerProps = { error: string | null; redirecting: boolean; reset: () => void; success: boolean; }; function CardUpdateAlertHandler({ ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/multi-tier-donation-form.tsx
client/src/components/Donation/multi-tier-donation-form.tsx
import React, { useState, useEffect } from 'react'; import { Tabs, TabsContent, TabsTrigger, TabsList, Col, Row, Spacer } from '@freecodecamp/ui'; import { useFeature } from '@growthbook/growthbook-react'; import { useTranslation } from 'react-i18next'; import { PaymentContext, subscriptionAmounts, ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/donation-modal.tsx
client/src/components/Donation/donation-modal.tsx
import { WindowLocation } from '@gatsbyjs/reach-router'; import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { scroller } from 'react-scroll'; import { bindActionCreators, Dispatch, AnyAction } from 'redux'; import { createSelector } from 'reselect'; import { Modal } from '...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/wallets-button.tsx
client/src/components/Donation/wallets-button.tsx
import { PaymentRequestButtonElement, ElementsConsumer } from '@stripe/react-stripe-js'; import type { PaymentRequest, Stripe } from '@stripe/stripe-js'; import React, { useState, useEffect, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { LocalStorageThemes } from '../../redux/...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/paypal-button.tsx
client/src/components/Donation/paypal-button.tsx
import React, { Component, Ref } from 'react'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { paypalConfigurator, paypalConfigTypes, defaultDonation, PaymentProvider, type DonationDuration, type DonationAmount } fro...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/stripe-card-form.tsx
client/src/components/Donation/stripe-card-form.tsx
import { CardNumberElement, CardExpiryElement, useStripe, useElements } from '@stripe/react-stripe-js'; import type { StripeCardNumberElementChangeEvent, StripeCardExpiryElementChangeEvent } from '@stripe/stripe-js'; import React, { useState } from 'react'; import { PaymentProvider } from '../../../../shar...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/types.ts
client/src/components/Donation/types.ts
import type { PaymentIntentResult } from '@stripe/stripe-js'; import { SuperBlocks } from '../../../../shared-dist/config/curriculum'; export type PaymentContext = 'modal' | 'donate page' | 'certificate'; export type PaymentProvider = 'patreon' | 'paypal' | 'stripe' | 'stripe card'; export type HandleAuthentication =...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/Donation/donation-text-components.tsx
client/src/components/Donation/donation-text-components.tsx
import React, { useState } from 'react'; import { useTranslation, Trans } from 'react-i18next'; import { useFeature } from '@growthbook/growthbook-react'; import { Spacer } from '@freecodecamp/ui'; import Caret from '../../assets/icons/caret'; import GreenPass from '../../assets/icons/green-pass'; const POBOX = ( <...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/archived-warning/index.tsx
client/src/components/archived-warning/index.tsx
import React from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Callout } from '@freecodecamp/ui'; import { Link } from '../helpers'; import './index.css'; const ArchivedWarning = () => { const { t } = useTranslation(); return ( <Callout variant='note' label={t('misc.note')}> ...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/profile.tsx
client/src/components/profile/profile.tsx
import React, { useState } from 'react'; import Helmet from 'react-helmet'; import type { TFunction } from 'i18next'; import { useTranslation } from 'react-i18next'; import { Callout, Container, Modal, Row, Spacer } from '@freecodecamp/ui'; import { FullWidthRow, Link } from '../helpers'; import Portfolio from './compo...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/profile.test.tsx
client/src/components/profile/profile.test.tsx
import { describe, it, expect, vi } from 'vitest'; import { render, screen } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import { UserThemes } from '../../redux/types'; import Profile from './profile'; vi.mock('../../analytics')...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/time-line.tsx
client/src/components/profile/components/time-line.tsx
import Loadable from '@loadable/component'; import { graphql, useStaticQuery } from 'gatsby'; import { reverse, sortBy } from 'lodash-es'; import React, { useMemo, useState } from 'react'; import type { TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; i...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/bio.tsx
client/src/components/profile/components/bio.tsx
import React from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCalendar, faLocationDot, faPen } from '@fortawesome/free-solid-svg-icons'; import { useTranslation } from 'react-i18next'; import { Button, Spacer } from '@freecodecamp/ui'; import { AvatarRenderer, FullWidthRo...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/certifications.tsx
client/src/components/profile/components/certifications.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Spacer } from '@freecodecamp/ui'; import type { CurrentCert, User } from '../../../redux/prop-types'; import { FullWidthRow, ButtonLink } from '../../helpers'; import { getCertifications } from './utils/certification'; import './certi...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/about.tsx
client/src/components/profile/components/about.tsx
import React, { useEffect, useState } from 'react'; import { FormGroup, FormControl, HelpBlock, Alert, ControlLabel } from '@freecodecamp/ui'; import type { TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import isURL from 'validator/lib/isURL'; import { connect } from 'react-red...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/internet.tsx
client/src/components/profile/components/internet.tsx
import { faCheck } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React, { useState } from 'react'; import type { TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import isURL from 'validator/lib/isURL'; import { FormContr...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/portfolio-projects.tsx
client/src/components/profile/components/portfolio-projects.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; import { Spacer } from '@freecodecamp/ui'; import type { PortfolioProjectData } from '../../../redux/prop-types'; import './portfolio-projects.css'; import { FullWidthRow } from '../../helpers'; interface PortfolioProjectsProps { portfolioPro...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/username.tsx
client/src/components/profile/components/username.tsx
/* eslint-disable @typescript-eslint/unbound-method */ import { FormControl, Alert, FormGroup, ControlLabel } from '@freecodecamp/ui'; import React, { Component } from 'react'; import type { TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { bind...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/time-line.test.tsx
client/src/components/profile/components/time-line.test.tsx
/* eslint-disable @typescript-eslint/ban-ts-comment */ /* eslint-disable @typescript-eslint/no-unsafe-call */ import { useStaticQuery } from 'gatsby'; import React from 'react'; import { beforeEach, describe, it, expect, vi } from 'vitest'; vi.mock('../../../utils/get-words'); import { render, screen } from '../../.....
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/stats.tsx
client/src/components/profile/components/stats.tsx
import React, { useState, useEffect } from 'react'; import { startOfDay, addDays, isEqual } from 'date-fns'; import { useTranslation } from 'react-i18next'; import { Spacer } from '@freecodecamp/ui'; import { last } from 'lodash-es'; import { uniqBy } from 'lodash'; import { FullWidthRow } from '../../helpers'; impor...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/heat-map.test.tsx
client/src/components/profile/components/heat-map.test.tsx
import { describe, it, expect, beforeEach, afterEach, vi, MockInstance } from 'vitest'; import { render, screen } from '@testing-library/react'; import React from 'react'; import envData from '../../../../config/env.json'; import { getLangCode } from '../../../../../shared-dist/config/i18n'; import HeatM...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/social-icons.tsx
client/src/components/profile/components/social-icons.tsx
import { faLinkedin, faGithub, faXTwitter, faBluesky } from '@fortawesome/free-brands-svg-icons'; import { faLink } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { Col,...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/heat-map.tsx
client/src/components/profile/components/heat-map.tsx
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import CalendarHeatMap from 'react-calendar-heatmap'; import { addDays, addMonths, isEqual, startOfDay } from 'date-fns'; import React, { Component } from 'react'; import type { TFunction } from 'i18next'; import { useTranslation } from 'react...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/portfolio.tsx
client/src/components/profile/components/portfolio.tsx
import { findIndex, find, isEqual } from 'lodash-es'; import { nanoid } from 'nanoid'; import React, { useState } from 'react'; import type { TFunction } from 'i18next'; import { FormGroup, FormControl, ControlLabel, HelpBlock, FormGroupProps, Button, Spacer } from '@freecodecamp/ui'; import { withTransla...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/stats.test.tsx
client/src/components/profile/components/stats.test.tsx
import { describe, it, test, expect, beforeEach, vi } from 'vitest'; import { render, screen, within } from '@testing-library/react'; import React from 'react'; import Stats, { calculateStreaks } from './stats'; const props: { calendar: { [key: number]: number }; points: number } = { calendar: {}, points: 10 }; d...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false
freeCodeCamp/freeCodeCamp
https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/client/src/components/profile/components/timeline-pagination.tsx
client/src/components/profile/components/timeline-pagination.tsx
import React from 'react'; import { useTranslation } from 'react-i18next'; interface TimelinePaginationProps { firstPage: () => void; lastPage: () => void; nextPage: () => void; pageNo: number; prevPage: () => void; totalPages: number; } const TimelinePagination = (props: TimelinePaginationProps): JSX.El...
typescript
BSD-3-Clause
7d58ef2062b457d9370a7f730fc875f92ad28a80
2026-01-04T15:25:31.297347Z
false