Skip to content

Commit

Permalink
fix: Clarified component names and i18n description
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnuon committed Oct 24, 2023
1 parent 7a2bf8c commit 54610da
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions src/course-home/courseware-search/CoursewareSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setShowSearch } from '../data/slice';
import { useElementBoundingBox, useLockScroll } from './hooks';
import messages from './messages';

import CoursewareSearchBar from './CoursewareSearchBar';
import CoursewareSearchForm from './CoursewareSearchForm';

const CoursewareSearch = ({ intl, ...sectionProps }) => {
const dispatch = useDispatch();
Expand All @@ -33,11 +33,12 @@ const CoursewareSearch = ({ intl, ...sectionProps }) => {
</div>
<div className="courseware-search__outer-content">
<div className="courseware-search__content" style={{ height: '999px' }}>
<h2>{intl.formatMessage(messages.searchModuleTitle)}</h2>
<CoursewareSearchBar
onChange={() => {}}
onSubmit={() => {}}
<CoursewareSearchForm
placeholder={intl.formatMessage(messages.searchBarPlaceholderText)}
onSubmit={() => {
}}
onChange={() => {
}}
/>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis semper rutrum odio quis congue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { SearchField } from '@edx/paragon';
import PropTypes from 'prop-types';

const CoursewareSearchBar = ({
const CoursewareSearchForm = ({
onSubmit,
onChange,
placeholder,
Expand All @@ -23,10 +23,10 @@ const CoursewareSearchBar = ({
</SearchField.Advanced>
);

CoursewareSearchBar.propTypes = {
CoursewareSearchForm.propTypes = {
onSubmit: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
placeholder: PropTypes.string.isRequired,
};

export default CoursewareSearchBar;
export default CoursewareSearchForm;
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
screen,
waitFor,
} from '../../setupTest';
import CoursewareSearchBar from './CoursewareSearchBar';
import CoursewareSearchForm from './CoursewareSearchForm';

function renderComponent() {
const { container } = render(<CoursewareSearchBar />);
const { container } = render(<CoursewareSearchForm />);
return container;
}

Expand Down
2 changes: 1 addition & 1 deletion src/course-home/courseware-search/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const messages = defineMessages({
searchBarPlaceholderText: {
id: 'learn.coursewareSerch.searchBarPlaceholderText',
defaultMessage: 'Search',
description: 'Placeholder text courseware for the search bar.',
description: 'Placeholder text for the Courseware Search input control',
},
});

Expand Down

0 comments on commit 54610da

Please sign in to comment.