Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/components/common/components/TopFixedBar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { useState } from 'react';
import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import { useState } from 'react';

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons';

import UnLogged from './UnLogged';
import Logged from './Logged';
import Hamburger from './Hamburger';
import SearchInput from '../../main/SearchInput';
import Logo from '../../../assets/logo/ms-icon-70x70.png';

function TopFixedBar() {
Expand All @@ -31,14 +32,7 @@ function TopFixedBar() {
<div className="sticky top-0 bg-[white] z-[999] border-b-[1px] border-lightGray">
<div className="flex w-[80%] h-[75px] m-auto items-center justify-between">
<img src={Logo} onClick={moveToMainPage} className="cursor-pointer text-[36px]" />
{isSearch ? (
<div className="w-[25%] h-[60%] ml-[50%]">
<input
placeholder="작성자, 키워드 등을 입력해주세요."
className="w-[100%] h-[100%] pl-[3%] bg-lightGray/20 focus-none"
/>
</div>
) : null}
{isSearch ? <SearchInput /> : null}
<div className="flex ml-[0.5%] items-center">
<FontAwesomeIcon
icon={faMagnifyingGlass}
Expand Down
14 changes: 14 additions & 0 deletions src/components/main/SearchInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SEARCH_PLACEHOLDER } from '../../static/constants';

function SearchInput() {
return (
<div className="w-[100%] h-[60%] ml-[30%] rounded-sm">
<input
placeholder={SEARCH_PLACEHOLDER}
className="w-[100%] h-[100%] pl-[3%] bg-lightGray/20 focus:outline-none"
/>
</div>
);
}

export default SearchInput;
3 changes: 3 additions & 0 deletions src/static/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const SEARCH_PLACEHOLDER = '작성자, 키워드 등을 입력해주세요.';

export { SEARCH_PLACEHOLDER };