Adapt VweKouteAchte to new api
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import {useState} from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import {
|
import {
|
||||||
Youtube,
|
Youtube,
|
||||||
@@ -40,29 +40,29 @@ const vweyIcons = {
|
|||||||
Soundcloud: <Soundcloud />
|
Soundcloud: <Soundcloud />
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function VweKouteAchte({teks, isVideo, isAudio}) {
|
export default function VweKouteAchte({anTeks, niVideyo, niOdyo}) {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
const [open, setOpen] = React.useState(false)
|
const [ouve, meteOuve] = useState(false)
|
||||||
const {kouteyAchtey, liens} = teks
|
const {kouteyAchtey, lyen} = anTeks
|
||||||
|
|
||||||
const kouteyAchteyActions = kouteyAchtey.map(({store, lien}) => {
|
const kouteyAchteyActions = kouteyAchtey.map(({boutik, url}) => {
|
||||||
return {
|
return {
|
||||||
icon: kouteyAchteyIcons[store],
|
icon: kouteyAchteyIcons[boutik],
|
||||||
name: store,
|
name: boutik,
|
||||||
link: lien
|
link: url
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const vweyActions = liens.map(({lien, hebergeur}) => {
|
const vweyActions = lyen.map(({url, sit}) => {
|
||||||
return {
|
return {
|
||||||
icon: vweyIcons[hebergeur],
|
icon: vweyIcons[sit],
|
||||||
name: hebergeur,
|
name: sit,
|
||||||
link: lien
|
link: url
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleOpen = () => {
|
const handleOpen = () => {
|
||||||
setOpen(true)
|
meteOuve(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = link => {
|
const handleClick = link => {
|
||||||
@@ -70,7 +70,7 @@ export default function VweKouteAchte({teks, isVideo, isAudio}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setOpen(false)
|
meteOuve(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -81,12 +81,12 @@ export default function VweKouteAchte({teks, isVideo, isAudio}) {
|
|||||||
ariaLabel='SpeedDial openIcon example'
|
ariaLabel='SpeedDial openIcon example'
|
||||||
className={classes.speedDial}
|
className={classes.speedDial}
|
||||||
direction='down'
|
direction='down'
|
||||||
icon={<SpeedDialIcon icon={isAudio ? <MusicNoteIcon /> : <PlayArrowIcon />} />}
|
icon={<SpeedDialIcon icon={niOdyo ? <MusicNoteIcon /> : <PlayArrowIcon />} />}
|
||||||
open={open}
|
open={ouve}
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
onOpen={handleOpen}
|
onOpen={handleOpen}
|
||||||
>
|
>
|
||||||
{isAudio && kouteyAchteyActions.map(action => (
|
{niOdyo && kouteyAchteyActions.map(action => (
|
||||||
<SpeedDialAction
|
<SpeedDialAction
|
||||||
key={action.name}
|
key={action.name}
|
||||||
icon={action.icon}
|
icon={action.icon}
|
||||||
@@ -94,7 +94,7 @@ export default function VweKouteAchte({teks, isVideo, isAudio}) {
|
|||||||
onClick={() => handleClick(action.link)}
|
onClick={() => handleClick(action.link)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{isVideo && vweyActions.map(action => (
|
{niVideyo && vweyActions.map(action => (
|
||||||
<SpeedDialAction
|
<SpeedDialAction
|
||||||
key={action.name}
|
key={action.name}
|
||||||
icon={action.icon}
|
icon={action.icon}
|
||||||
@@ -108,12 +108,12 @@ export default function VweKouteAchte({teks, isVideo, isAudio}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VweKouteAchte.propTypes = {
|
VweKouteAchte.propTypes = {
|
||||||
teks: PropTypes.object.isRequired,
|
anTeks: PropTypes.object.isRequired,
|
||||||
isVideo: PropTypes.bool,
|
niVideyo: PropTypes.bool,
|
||||||
isAudio: PropTypes.bool
|
niOdyo: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
VweKouteAchte.defaultProps = {
|
VweKouteAchte.defaultProps = {
|
||||||
isVideo: false,
|
niVideyo: false,
|
||||||
isAudio: false
|
niOdyo: false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user