-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from boostcampwm-2024/front/main
[FE] 브랜치 병합
- Loading branch information
Showing
52 changed files
with
2,115 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
margin: 0 auto; | ||
padding: 2rem; | ||
text-align: center; | ||
display: flex; | ||
flex-direction: column; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom'; | ||
import { | ||
Outlet, | ||
Route, | ||
BrowserRouter as Router, | ||
Routes, | ||
} from 'react-router-dom'; | ||
import './App.css'; | ||
import Home from 'page/Home'; | ||
import StocksDetail from 'page/StocksDetail'; | ||
import Header from 'components/Header'; | ||
import Login from 'components/Login'; | ||
import SearchModal from './components/Search'; | ||
|
||
function App() { | ||
return ( | ||
<Router> | ||
<Routes> | ||
<Route path='/' element={<Home />} /> | ||
<Route path='/' element={<Layout />}> | ||
<Route index element={<Home />} /> | ||
<Route path='stocks/:id' element={<StocksDetail />} /> | ||
</Route> | ||
</Routes> | ||
</Router> | ||
); | ||
} | ||
|
||
export default App; | ||
|
||
function Layout() { | ||
return ( | ||
<> | ||
<Header /> | ||
<main className='mt-[60px] flex flex-col gap-4'> | ||
<Outlet /> | ||
</main> | ||
<Login /> | ||
<SearchModal /> | ||
</> | ||
); | ||
} |
File renamed without changes
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function Overay({ onClick }: { onClick: () => void }) { | ||
return ( | ||
<div className='fixed inset-0 bg-black opacity-30' onClick={onClick}></div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { SearchDataType } from './searchDataType.ts'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import useSearchModalStore from '../../store/useSearchModalStore.ts'; | ||
import useSearchInputStore from '../../store/useSearchInputStore.ts'; | ||
import { SearchCardHighLight } from './SearchCardHighlight.tsx'; | ||
|
||
type SearchCardProps = { | ||
data: SearchDataType; | ||
}; | ||
|
||
export default function SearchCard({ data }: SearchCardProps) { | ||
const { code, name, market } = data; | ||
const { isOpen, toggleSearchModal } = useSearchModalStore(); | ||
const { searchInput } = useSearchInputStore(); | ||
|
||
const navigation = useNavigate(); | ||
|
||
const handleClick = () => { | ||
navigation(`/stocks/${code}`); | ||
if (isOpen) toggleSearchModal(); | ||
}; | ||
|
||
return ( | ||
<li | ||
className={ | ||
'h-[52px] w-full rounded-xl hover:cursor-pointer hover:bg-gray-100' | ||
} | ||
onClick={handleClick} | ||
> | ||
<div className={'my-2 flex w-full items-center justify-between px-4'}> | ||
<div className={'flex-1 flex-col'}> | ||
<div className='text-left font-medium text-gray-900'> | ||
<SearchCardHighLight text={name} highlight={searchInput} /> | ||
</div> | ||
<div className={'text-left text-xs font-normal text-gray-500'}> | ||
{code} | ||
</div> | ||
</div> | ||
|
||
<div className={'flex flex-col items-end justify-center gap-0.5'}> | ||
<p className={'text-right text-xs font-medium text-gray-600'}> | ||
{market} | ||
</p> | ||
</div> | ||
</div> | ||
</li> | ||
); | ||
} |
Oops, something went wrong.