Skip to content

Commit

Permalink
Merge pull request #119 from TEAM-SYLUV/develop
Browse files Browse the repository at this point in the history
현장 QA 반영
  • Loading branch information
seokkkkkk authored Aug 6, 2024
2 parents f871223 + 444524d commit 4d31ba3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
17 changes: 5 additions & 12 deletions src/components/Common/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ const Search = ({ marketList }) => {
const [searchInput, setSearchInput] = useState("");

const getHighlightedText = (text, highlight) => {
const highlightIndex = Hangul.search(text, highlight);
if (highlightIndex === -1) return text;

const startIndex = highlightIndex;
const endIndex = highlightIndex + highlight.length;

return (
<>
{text.substring(0, startIndex)}
<Highlight>{text.substring(startIndex, endIndex)}</Highlight>
{text.substring(endIndex)}
</>
const regex = new RegExp(`(${highlight})`, "gi");
const parts = text.split(regex);

return parts.map((part, index) =>
regex.test(part) ? <Highlight key={index}>{part}</Highlight> : part
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/owner/components/OwnerHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const OwnerHeader = ({ name, stores }) => {
{isClicked && (
<ButtonModal
title="계정 유형 전환"
subText="일반 사용자 계정으로 전환하시겠습니까?"
subText="방문객 계정으로 전환하시겠습니까?"
left="이동"
right="취소"
onLeftClick={() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const MyPage = () => {
navigate("/owner");
}}
>
상인 계정 전환
사장님 계정 전환
</span>
<Line />
<span
Expand Down

0 comments on commit 4d31ba3

Please sign in to comment.