From b4ba70b4ab73a7c7a9b868bc881c8a4e62786817 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 12 Oct 2023 15:34:24 +0300 Subject: [PATCH] refactor: replace Row component (#51317) --- client/src/client-only-routes/show-certification.tsx | 4 ++-- client/src/client-only-routes/show-user.tsx | 5 ++--- client/src/components/Donation/donation-modal.tsx | 5 +++-- client/src/components/SolutionViewer/exam-results-modal.tsx | 6 ++++-- client/src/components/helpers/full-width-row.tsx | 3 +-- client/src/components/landing/components/landing-top.tsx | 3 +-- client/src/components/layouts/global.css | 2 +- .../components/profile/__snapshots__/profile.test.tsx.snap | 6 +++--- .../components/__snapshots__/timeline-buttons.test.js.snap | 2 +- client/src/components/profile/components/camper.tsx | 3 +-- client/src/components/profile/components/certifications.tsx | 3 +-- client/src/components/profile/components/heat-map.tsx | 2 +- client/src/components/profile/components/social-icons.tsx | 3 +-- client/src/components/profile/profile.tsx | 3 +-- client/src/pages/__snapshots__/email-sign-up.test.js.snap | 4 ++-- client/src/pages/blocked.tsx | 3 +-- client/src/pages/donate.tsx | 4 +--- client/src/pages/email-sign-up.tsx | 4 ++-- client/src/pages/learn.tsx | 3 +-- client/src/pages/update-email.tsx | 3 +-- client/src/templates/Challenges/codeally/show.tsx | 4 ++-- client/src/templates/Challenges/exam/show.tsx | 4 ++-- client/src/templates/Challenges/odin/show.tsx | 4 ++-- client/src/templates/Challenges/projects/backend/show.tsx | 3 +-- client/src/templates/Challenges/projects/frontend/show.tsx | 3 +-- client/src/templates/Challenges/video/show.tsx | 4 ++-- client/src/templates/Introduction/super-block-intro.tsx | 3 +-- tools/ui-components/src/index.ts | 1 + 28 files changed, 43 insertions(+), 54 deletions(-) diff --git a/client/src/client-only-routes/show-certification.tsx b/client/src/client-only-routes/show-certification.tsx index 318321cb046..a047e6a3f8b 100644 --- a/client/src/client-only-routes/show-certification.tsx +++ b/client/src/client-only-routes/show-certification.tsx @@ -1,4 +1,4 @@ -import { Row, Image, Button } from '@freecodecamp/react-bootstrap'; +import { Image, Button } from '@freecodecamp/react-bootstrap'; import { isEmpty } from 'lodash-es'; import { QRCodeSVG } from 'qrcode.react'; import React, { useEffect, useState } from 'react'; @@ -6,7 +6,7 @@ import { Trans, useTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; import { createSelector } from 'reselect'; -import { Container, Col } from '@freecodecamp/ui'; +import { Container, Col, Row } from '@freecodecamp/ui'; import envData from '../../config/env.json'; import { getLangCode } from '../../../shared/config/i18n'; diff --git a/client/src/client-only-routes/show-user.tsx b/client/src/client-only-routes/show-user.tsx index c7a8b8cfb87..f783731d258 100644 --- a/client/src/client-only-routes/show-user.tsx +++ b/client/src/client-only-routes/show-user.tsx @@ -3,8 +3,7 @@ import { FormControl, FormGroup, ControlLabel, - Button, - Row + Button } from '@freecodecamp/react-bootstrap'; import React, { useState } from 'react'; import Helmet from 'react-helmet'; @@ -12,7 +11,7 @@ import type { TFunction } from 'i18next'; import { Trans, withTranslation } from 'react-i18next'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { Col } from '@freecodecamp/ui'; +import { Col, Row } from '@freecodecamp/ui'; import Login from '../components/Header/components/login'; diff --git a/client/src/components/Donation/donation-modal.tsx b/client/src/components/Donation/donation-modal.tsx index 3dc2e59f0a8..b5d34524647 100644 --- a/client/src/components/Donation/donation-modal.tsx +++ b/client/src/components/Donation/donation-modal.tsx @@ -1,10 +1,11 @@ -import { Modal, Button, Row } from '@freecodecamp/react-bootstrap'; +import { Modal, Button } from '@freecodecamp/react-bootstrap'; import { Tabs, TabsContent, TabsTrigger, TabsList, - Col + Col, + Row } from '@freecodecamp/ui'; import { WindowLocation } from '@reach/router'; import React, { useEffect, useState } from 'react'; diff --git a/client/src/components/SolutionViewer/exam-results-modal.tsx b/client/src/components/SolutionViewer/exam-results-modal.tsx index 72028f65f20..c229b792e41 100644 --- a/client/src/components/SolutionViewer/exam-results-modal.tsx +++ b/client/src/components/SolutionViewer/exam-results-modal.tsx @@ -1,8 +1,10 @@ -import { Button, Modal, Row } from '@freecodecamp/react-bootstrap'; +import { Button, Modal } from '@freecodecamp/react-bootstrap'; import { connect } from 'react-redux'; import React from 'react'; import { useTranslation } from 'react-i18next'; -import { GeneratedExamResults } from '../../redux/prop-types'; +import { Row } from '@freecodecamp/ui'; + +import type { GeneratedExamResults } from '../../redux/prop-types'; import { closeModal } from '../../templates/Challenges/redux/actions'; import { isExamResultsModalOpenSelector } from '../../templates/Challenges/redux/selectors'; import { formatSecondsToTime } from '../../utils/format-seconds'; diff --git a/client/src/components/helpers/full-width-row.tsx b/client/src/components/helpers/full-width-row.tsx index 96db7e9c9b6..e6edd0efcf7 100644 --- a/client/src/components/helpers/full-width-row.tsx +++ b/client/src/components/helpers/full-width-row.tsx @@ -1,5 +1,4 @@ -import { Row } from '@freecodecamp/react-bootstrap'; -import { Col } from '@freecodecamp/ui'; +import { Col, Row } from '@freecodecamp/ui'; import React from 'react'; interface FullWidthRowProps { diff --git a/client/src/components/landing/components/landing-top.tsx b/client/src/components/landing/components/landing-top.tsx index 212850af1d7..336317f749c 100644 --- a/client/src/components/landing/components/landing-top.tsx +++ b/client/src/components/landing/components/landing-top.tsx @@ -1,7 +1,6 @@ -import { Row } from '@freecodecamp/react-bootstrap'; import React from 'react'; import { useTranslation } from 'react-i18next'; -import { Container, Col } from '@freecodecamp/ui'; +import { Container, Col, Row } from '@freecodecamp/ui'; import { clientLocale } from '../../../../config/env.json'; import { diff --git a/client/src/components/layouts/global.css b/client/src/components/layouts/global.css index 4449b9bff46..adfd2e433b6 100644 --- a/client/src/components/layouts/global.css +++ b/client/src/components/layouts/global.css @@ -45,7 +45,7 @@ body { } /* - Row from @freecodecamp/react-bootstrap adds some negative margin which causes + Row from @freecodecamp/ui adds some negative margin which causes a little bit of horizontal overflow on certain pages. This eliminates that for those pages. */ diff --git a/client/src/components/profile/__snapshots__/profile.test.tsx.snap b/client/src/components/profile/__snapshots__/profile.test.tsx.snap index d0b4a4f5310..80fe8f95eb2 100644 --- a/client/src/components/profile/__snapshots__/profile.test.tsx.snap +++ b/client/src/components/profile/__snapshots__/profile.test.tsx.snap @@ -15,7 +15,7 @@ exports[` renders correctly 1`] = ` />
renders correctly 1`] = `