Skip to content

Commit

Permalink
refactor: 검색 바 아이콘 img로 변경 (#546)
Browse files Browse the repository at this point in the history
* refactor: 검색 바 아이콘 img로 변경

* fix: `alt=""` 속성 추가

장식(아이콘)이라는 점을 명시적으로 표시
  • Loading branch information
scarf005 authored Aug 18, 2023
1 parent 4df8e1d commit d520b53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
12 changes: 3 additions & 9 deletions src/asset/css/SearchBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,13 @@
.search-bar__button {
all: unset;
margin-left: auto;
background-image: url("../img/search_icon_black.svg");
background-repeat: no-repeat;
background-size: cover;
width: 2.8rem;
height: 2.8rem;
margin: auto;
color: transparent;
}

.search-bar__button.submit {
background-image: url("../img/search_icon_black.svg");
cursor: pointer;
}

.search-bar__button.barcode {
background-image: url("../img/barcode.svg");
margin-right: 2rem;
}

Expand Down Expand Up @@ -100,9 +92,11 @@
.search-bar__wrapper.center {
padding: 0 2rem 0 2rem;
}

.search-bar__wrapper.long {
padding: 0 2.5rem 0 2.2rem;
}

.search-bar__wrapper.short {
margin-right: 1.8rem;
padding: 0 2.5rem 0 2.2rem;
Expand Down
15 changes: 9 additions & 6 deletions src/component/utils/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import {
useRef,
useState,
useEffect,
ChangeEventHandler,
FormEventHandler,
MouseEventHandler,
useEffect,
useRef,
useState,
} from "react";
import { useNavigate, useSearchParams } from "react-router-dom";
import "../../asset/css/SearchBar.css";
import BarCodeIcon from "../../asset/img/barcode.svg";
import SearchIcon from "../../asset/img/search_icon_black.svg";

type Props = {
setQuery?: (query: string) => void;
Expand Down Expand Up @@ -75,12 +77,13 @@ const SearchBar = ({
type="button"
className="search-bar__button barcode"
onClick={onClickBarcodeButton}
aria-label="바코드"
>
바코드
<img src={BarCodeIcon} alt="" />
</button>
) : null}
<button className="search-bar__button submit" type="submit">
검색
<button className="search-bar__button" type="submit" aria-label="검색">
<img src={SearchIcon} alt="" />
</button>
</form>
);
Expand Down

0 comments on commit d520b53

Please sign in to comment.