mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore: remove unused code (#50507)
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface SpacerPropTypes {
|
||||
style: Record<string, unknown>;
|
||||
}
|
||||
|
||||
function Spacer(props: SpacerPropTypes): JSX.Element {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<svg
|
||||
className='tick'
|
||||
aria-hidden='true'
|
||||
height='50'
|
||||
viewBox='-10 -45 200 200'
|
||||
width='50'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
{...props}
|
||||
>
|
||||
<g>
|
||||
<title>{t('icons.spacer')}</title>
|
||||
<rect fillOpacity='0' height='200' width='200' />
|
||||
</g>
|
||||
</svg>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Spacer.displayName = 'Spacer';
|
||||
|
||||
export default Spacer;
|
||||
@@ -21,7 +21,7 @@ window.$ = jQuery;
|
||||
|
||||
document.__initTestFrame = initTestFrame;
|
||||
|
||||
export interface InitTestFrameArg {
|
||||
interface InitTestFrameArg {
|
||||
code: {
|
||||
contents?: string;
|
||||
editableContents?: string;
|
||||
|
||||
@@ -28,7 +28,7 @@ type UniversalNavProps = Omit<
|
||||
fetchState: { pending: boolean };
|
||||
searchBarRef?: React.RefObject<HTMLDivElement>;
|
||||
};
|
||||
export const UniversalNav = ({
|
||||
const UniversalNav = ({
|
||||
displayMenu,
|
||||
showMenu,
|
||||
hideMenu,
|
||||
|
||||
@@ -14,10 +14,7 @@ interface HeaderProps {
|
||||
user: User;
|
||||
skipButtonText: string;
|
||||
}
|
||||
export class Header extends React.Component<
|
||||
HeaderProps,
|
||||
{ displayMenu: boolean }
|
||||
> {
|
||||
class Header extends React.Component<HeaderProps, { displayMenu: boolean }> {
|
||||
menuButtonRef: React.RefObject<HTMLButtonElement>;
|
||||
searchBarRef: React.RefObject<any>;
|
||||
static displayName: string;
|
||||
|
||||
@@ -120,7 +120,7 @@ function renderLearnMap(currentSuperBlock: MapProps['currentSuperBlock']) {
|
||||
);
|
||||
}
|
||||
|
||||
export function Map({
|
||||
function Map({
|
||||
forLanding = false,
|
||||
currentSuperBlock = null
|
||||
}: MapProps): React.ReactElement {
|
||||
|
||||
@@ -12,24 +12,17 @@ const initialState = {
|
||||
};
|
||||
|
||||
const types = createTypes(
|
||||
[
|
||||
'toggleSearchDropdown',
|
||||
'toggleSearchFocused',
|
||||
'updateSearchIndexName',
|
||||
'updateSearchQuery'
|
||||
],
|
||||
['toggleSearchDropdown', 'toggleSearchFocused', 'updateSearchQuery'],
|
||||
ns
|
||||
);
|
||||
|
||||
export const toggleSearchDropdown = createAction(types.toggleSearchDropdown);
|
||||
export const toggleSearchFocused = createAction(types.toggleSearchFocused);
|
||||
export const updateSearchIndexName = createAction(types.updateSearchIndexName);
|
||||
export const updateSearchQuery = createAction(types.updateSearchQuery);
|
||||
|
||||
export const isSearchDropdownEnabledSelector = state =>
|
||||
state[ns].isSearchDropdownEnabled;
|
||||
export const isSearchBarFocusedSelector = state => state[ns].isSearchBarFocused;
|
||||
export const searchIndexNameSelector = state => state[ns].indexName;
|
||||
export const searchQuerySelector = state => state[ns].query;
|
||||
|
||||
export const reducer = handleActions(
|
||||
@@ -43,10 +36,6 @@ export const reducer = handleActions(
|
||||
...state,
|
||||
isSearchBarFocused: payload
|
||||
}),
|
||||
[types.updateSearchIndexName]: (state, { payload }) => ({
|
||||
...state,
|
||||
indexName: payload
|
||||
}),
|
||||
[types.updateSearchQuery]: (state, { payload }) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
@@ -48,7 +48,16 @@ const SEO: React.FC<SEOProps> = ({ title, children }) => {
|
||||
site: {
|
||||
siteMetadata: { title: defaultTitle, siteUrl }
|
||||
}
|
||||
}: SiteData = useStaticQuery(query);
|
||||
}: SiteData = useStaticQuery(graphql`
|
||||
query SEO {
|
||||
site {
|
||||
siteMetadata {
|
||||
title
|
||||
siteUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
const seo = {
|
||||
title: title || defaultTitle
|
||||
@@ -99,14 +108,3 @@ const SEO: React.FC<SEOProps> = ({ title, children }) => {
|
||||
SEO.displayName = 'SEO';
|
||||
|
||||
export default SEO;
|
||||
|
||||
export const query = graphql`
|
||||
query SEO {
|
||||
site {
|
||||
siteMetadata {
|
||||
title
|
||||
siteUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -7,12 +7,10 @@ export const completedChallengesSelector = state =>
|
||||
userSelector(state).completedChallenges || [];
|
||||
export const partiallyCompletedChallengesSelector = state =>
|
||||
userSelector(state).partiallyCompletedChallenges || [];
|
||||
export const completionCountSelector = state => state[MainApp].completionCount;
|
||||
const completionCountSelector = state => state[MainApp].completionCount;
|
||||
export const currentChallengeIdSelector = state =>
|
||||
state[MainApp].currentChallengeId;
|
||||
|
||||
export const emailSelector = state => userSelector(state).email;
|
||||
|
||||
export const isDonatingSelector = state => userSelector(state).isDonating;
|
||||
export const isOnlineSelector = state => state[MainApp].isOnline;
|
||||
export const isServerOnlineSelector = state => state[MainApp].isServerOnline;
|
||||
|
||||
Reference in New Issue
Block a user