feat(Home): Add reset search button in search results
This commit is contained in:
@@ -963,6 +963,26 @@ body {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.back-to-home-btn {
|
||||
background-color: var(--secondary-color);
|
||||
color: var(--text-color);
|
||||
border: none;
|
||||
border-radius: var(--border-radius);
|
||||
padding: 8px 15px;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.back-to-home-btn:hover {
|
||||
background-color: var(--primary-color);
|
||||
transform: translateX(-3px);
|
||||
}
|
||||
|
||||
.search-results-section {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
@@ -623,6 +623,7 @@ function App() {
|
||||
youtubeLoading={youtubeLoading}
|
||||
searchResults={searchResults}
|
||||
onDownload={handleDownloadFromSearch}
|
||||
onResetSearch={resetSearch}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -14,7 +14,8 @@ const Home = ({
|
||||
localSearchResults = [],
|
||||
youtubeLoading = false,
|
||||
searchResults = [],
|
||||
onDownload
|
||||
onDownload,
|
||||
onResetSearch
|
||||
}) => {
|
||||
// Add default empty array to ensure videos is always an array
|
||||
const videoArray = Array.isArray(videos) ? videos : [];
|
||||
@@ -56,6 +57,11 @@ const Home = ({
|
||||
<div className="search-results">
|
||||
<div className="search-header">
|
||||
<h2>Search Results for "{searchTerm}"</h2>
|
||||
{onResetSearch && (
|
||||
<button className="back-to-home-btn" onClick={onResetSearch}>
|
||||
← Back to Home
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Local Video Results */}
|
||||
|
||||
Reference in New Issue
Block a user