Skip to content
Snippets Groups Projects
Select Git revision
  • 5a39b2215cd85899175fb9af6eefe8a1f1fc6f07
  • master default protected
  • JH0026
  • KJ04
  • JH0025
  • haram0003
  • haram0002
  • KJ03
  • JH0024
  • KJ01
  • JH0023
  • style
  • attractionlist
  • makeplan
  • JH0020
  • modal_style
  • mypage_style
  • mainpage_style
  • attractionlist_style
  • attractionlist04
  • JH0016
21 results

MakePlan.vue

Blame
  • MusicList.js 1.33 KiB
    import React from 'react';
    import {Card, CardContent, CardActions, Typography, IconButton} from '@mui/material';
    import {Favorite, FavoriteBorder} from '@mui/icons-material';
    
    const styles = {
        content: {},
        layout: {
            display: 'flex',
            justifyContent: 'center'
        }, 
        card: {
            minWidth: 275, 
            maxWidth: 600, 
            marginBottom: '20pt', 
            marginLeft: 'auto', 
            marginRight: 'auto',
        },
    };
    
    export default function MusicList ({list, likes, toggleFavorite}) {
        return (
            <div>
                {list.map(item => {
                    return (
                        <Card sx={styles.card} key={item.collectionId}>
                            <CardContent>
                                <Typography varient = "subtitle1"> {item.artistName} </Typography>
                                <Typography variant = "subtitle2"> {item.collectionName} </Typography>
                            </CardContent>
                            <CardActions>
                                <IconButton onClick = {() => toggleFavorite(item.collectionId, item.collectionName)}>
                                    {(likes[item.collectionId] === true) ? <Favorite/> : <FavoriteBorder/>}
                                </IconButton>
                            </CardActions>
                        </Card>
                    )
                })}
            </div>
        );
    }