Ott 697 popup imprv (#268)
* Ott 697 part 1 (#266) * fix(591): request lexics * fix(591): style and bug fixes * fix(591): match page style and bug fixes (#267)keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
parent
d2a2727b42
commit
bc277fa65d
@ -0,0 +1,21 @@ |
||||
import { useCallback } from 'react' |
||||
|
||||
import isEmpty from 'lodash/isEmpty' |
||||
import values from 'lodash/values' |
||||
|
||||
import type { MatchPlaylists } from 'requests' |
||||
|
||||
import { useLexicsStore } from 'features/LexicsStore' |
||||
|
||||
export const usePlaylistLexics = () => { |
||||
const { addLexicsConfig } = useLexicsStore() |
||||
const fetchLexics = useCallback((playlist: MatchPlaylists | null) => { |
||||
const lexics = values(playlist?.lexics) |
||||
if (!isEmpty(lexics)) { |
||||
addLexicsConfig(lexics) |
||||
} |
||||
return playlist |
||||
}, [addLexicsConfig]) |
||||
|
||||
return { fetchLexics } |
||||
} |
||||
@ -0,0 +1,12 @@ |
||||
import React from 'react' |
||||
|
||||
import styled from 'styled-components/macro' |
||||
|
||||
const Wrapper = styled.div` |
||||
width: 288px; |
||||
height: 100px; |
||||
margin-top: 42px; |
||||
margin-left: 14px; |
||||
` |
||||
|
||||
export const MatchSidePlaylists = () => <Wrapper /> |
||||
Loading…
Reference in new issue