diff --git a/packages/app/src/pages/music/components/feed/index.jsx b/packages/app/src/pages/music/components/feed/index.jsx
index 59538c0e..59b018b0 100755
--- a/packages/app/src/pages/music/components/feed/index.jsx
+++ b/packages/app/src/pages/music/components/feed/index.jsx
@@ -191,22 +191,113 @@ const MayLike = (props) => {
}
-export default () => {
- return
-
+const SearchResultItem = (props) => {
+ return
+
SearchResultItem
+
+}
-
}
- fetchMethod={FeedModel.getPlaylistsFeed}
- />
+export default (props) => {
+ const [searchLoading, setSearchLoading] = React.useState(false)
+ const [searchFocused, setSearchFocused] = React.useState(false)
+ const [searchValue, setSearchValue] = React.useState("")
+ const [searchResult, setSearchResult] = React.useState([])
-
}
- fetchMethod={FeedModel.getGlobalMusicFeed}
- />
+ const handleSearchValueChange = (e) => {
+ // not allow to input space as first character
+ if (e.target.value[0] === " ") {
+ return
+ }
-
+ setSearchValue(e.target.value)
+ }
+
+ const makeSearch = async (value) => {
+ setSearchResult([])
+
+ await new Promise((resolve) => setTimeout(resolve, 1000))
+
+ setSearchResult([
+ {
+ title: "test",
+ thumbnail: "/assets/no_song.png",
+ },
+ {
+ title: "test2",
+ thumbnail: "/assets/no_song.png",
+ }
+ ])
+ }
+
+ React.useEffect(() => {
+ const timer = setTimeout(async () => {
+ setSearchLoading(true)
+
+ await makeSearch(searchValue)
+
+ setSearchLoading(false)
+ }, 400)
+
+ if (searchValue === "") {
+ if (typeof props.onEmpty === "function") {
+ //props.onEmpty()
+ }
+ } else {
+ if (typeof props.onFilled === "function") {
+ //props.onFilled()
+ }
+ }
+
+ return () => clearTimeout(timer)
+ }, [searchValue])
+
+ return
+
+
}
+ onFocus={() => setSearchFocused(true)}
+ onBlur={() => setSearchFocused(false)}
+ onChange={handleSearchValueChange}
+ value={searchValue}
+ />
+
+
+ {
+ searchLoading &&
+ }
+ {
+ searchFocused && searchValue !== "" && searchResult.length > 0 && searchResult.map((result, index) => {
+ return
+ })
+ }
+
+
+
+
+
+
+
}
+ fetchMethod={FeedModel.getPlaylistsFeed}
+ />
+
+
}
+ fetchMethod={FeedModel.getGlobalMusicFeed}
+ />
+
}
\ No newline at end of file
diff --git a/packages/app/src/pages/music/components/feed/index.less b/packages/app/src/pages/music/components/feed/index.less
index 42cad629..5d35a08c 100755
--- a/packages/app/src/pages/music/components/feed/index.less
+++ b/packages/app/src/pages/music/components/feed/index.less
@@ -1,10 +1,30 @@
-.playlistExplorer {
+.musicExplorer {
display: flex;
flex-direction: column;
width: 100%;
+ height: 100%;
- gap: 50px;
+ gap: 20px;
+
+ &.search-focused {
+ .feed_main {
+ height: 0px;
+ opacity: 0;
+ }
+ }
+
+ .feed_main {
+ display: flex;
+ flex-direction: column;
+
+ width: 100%;
+ height: 100%;
+
+ gap: 50px;
+
+ transition: all 0.2s ease-in-out;
+ }
.playlistExplorer_section {
display: flex;