diff --git a/front/public/dummy/Exercise.json b/front/public/dummy/Exercise.json index 9c682ec8b29cd097d377a0ca52e1662ddabaf957..f845732a877f43c4f9b43bb99f73d84fdb75448d 100644 --- a/front/public/dummy/Exercise.json +++ b/front/public/dummy/Exercise.json @@ -3,14 +3,26 @@ "date": "2024-11-01", "exercises": [ { - "video_title": "workout1", - "video_tag": "head", - "video_time": "10:49" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 }, { - "video_title": "workout6", - "video_tag": "neck", - "video_time": "22:49" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -18,9 +30,15 @@ "date": "2024-11-08", "exercises": [ { - "video_title": "workout2", - "video_tag": "neck", - "video_time": "7:55" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -28,9 +46,15 @@ "date": "2024-11-11", "exercises": [ { - "video_title": "workout1", - "video_tag": "head", - "video_time": "10:49" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -38,9 +62,15 @@ "date": "2024-11-27", "exercises": [ { - "video_title": "workout3", - "video_tag": "foot", - "video_time": "20:04" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -48,9 +78,15 @@ "date": "2024-12-02", "exercises": [ { - "video_title": "workout3", - "video_tag": "foot", - "video_time": "20:04" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -58,9 +94,15 @@ "date": "2024-12-07", "exercises": [ { - "video_title": "workout3", - "video_tag": "foot", - "video_time": "20:04" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -68,9 +110,15 @@ "date": "2024-12-27", "exercises": [ { - "video_title": "workout3", - "video_tag": "foot", - "video_time": "20:04" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] }, @@ -78,9 +126,15 @@ "date": "2024-12-31", "exercises": [ { - "video_title": "workout3", - "video_tag": "foot", - "video_time": "20:04" + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 } ] } diff --git a/front/public/dummy/User.json b/front/public/dummy/User.json index 25214ebb2699553fefb7708df84f4561f1a82a93..a2e3ace3886940786e49895371ec403ef050439f 100644 --- a/front/public/dummy/User.json +++ b/front/public/dummy/User.json @@ -1,7 +1,7 @@ { - "user_id": "asdf", - "user_name": "김ㅇㅇ", + "user_id": "ajou1973", + "user_name": "김아주", "user_gender": 0, - "user_age": 10, - "user_email": "asdf@adf.com" + "user_age": 25, + "user_email": "ajou1973f@ajou.ac.kr" } \ No newline at end of file diff --git a/front/src/api/HabitTrackerAPI.js b/front/src/api/HabitTrackerAPI.js index 115058ea723b5b16eb27479c62b7a4c138546bb3..0ab94f51a73b16f0801515e72c2e6f26a4c0576f 100644 --- a/front/src/api/HabitTrackerAPI.js +++ b/front/src/api/HabitTrackerAPI.js @@ -1,4 +1,11 @@ async function getGoal(){ + const data = { + "goal_weekly": 3, + "goal_daily": [1, 1, 0, 0, 1, 0, 0], + "goal_daily_time": "30:00", + "goal_weight": 42 + } + return data; try{ const uri = `/api/habitTracker/goal` const response = await fetch(uri, { @@ -15,9 +22,6 @@ async function getGoal(){ } catch(err){ console.log(err.message); } - // const uri = '/dummy/Goal.json' - // const response = await fetch(uri); - }; async function addGoal(goalData){ @@ -47,31 +51,16 @@ async function addGoal(goalData){ } }; -// async function getUserData(){ -// try{ -// //const uri = `/api/user` -// //const response = await fetch(uri, { -// // method: "GET", -// // headers: { -// // //JWT -// // "Content-Type": "application/json", -// // }, -// // }); -// const uri = '/dummy/User.json' -// const response = await fetch(uri); - -// if (!response.ok){ -// throw new Error('Network error', response.status); -// } -// const data = await response.json(); -// return data; -// } catch(err) { -// console.log(err.message); -// } -// }; - async function getUserData(){ + const data = { + "user_id": "ajou1973", + "user_name": "김아주", + "user_gender": 0, + "user_age": 25, + "user_email": "ajou1973f@ajou.ac.kr" + } + return data; try{ const uri = `/api/user/profile` const response = await fetch(uri, { @@ -91,6 +80,149 @@ async function getUserData(){ async function getMonthlyRecord(year, month) { + const data = [ + { + "date": "2024-11-01", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + }, + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-11-08", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-11-11", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-11-27", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-12-02", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-12-07", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-12-27", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + }, + { + "date": "2024-12-31", + "exercises": [ + { + "_id": "6747313adeab7ea33db954d3", + "video_id": "v1xrOAONfAw", + "video_title": "홈트 - 가슴운동 '단! 17분! 보고 따라만 하세요!' [ Home training - Chest ]", + "video_description": "안녕하세요~! 배관장입니다! 홈트레이닝 가슴편! 단! 17분! 보고 따라만 하세요! 품태권도 김해진영점 경남 김해시 진영읍 본산 ...", + "video_tag": "가슴 홈트레이닝 | Chest Home Training", + "video_length": 1071, + "video_likes": 14, + "channel_title": "Men's Health UK", + "__v": 0 + } + ] + } + ] + + return data; try{ const uri = `/api/habitTracker/records?period=${year}-${month}`; const response = await fetch(uri, { diff --git a/front/src/api/routineAPI.js b/front/src/api/routineAPI.js index fe433cc9d0455416d174e9fd185da4a7bb30ce2a..438113a13c09b8ec90e889b6a1b942d6e857b9cb 100644 --- a/front/src/api/routineAPI.js +++ b/front/src/api/routineAPI.js @@ -54,12 +54,10 @@ async function deleteRoutine(routineName) { } async function addRoutineVideo(data){ - //추후에 RoutineAPI로 옮기기 - try{ const uri = `/api/routine/add` const response = await fetch(uri, { - method: "PUT", //POST가 아니고?? + method: "PUT", headers: { "Authorization": `Bearer ${localStorage.getItem('accessToken')}`, "Content-Type": "application/json", diff --git a/front/src/components/Footer.jsx b/front/src/components/Footer.jsx deleted file mode 100644 index 2bcb9c7006da894541f426151cd1bbf0e3641ba3..0000000000000000000000000000000000000000 --- a/front/src/components/Footer.jsx +++ /dev/null @@ -1,31 +0,0 @@ -import react from 'react'; -import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; - -import './index.css'; - -function Footer() { - return ( - <div id="footer"> - <ul> - <li> 웹시스템설계 </li> - <li> 9조 </li> - </ul> - <ul> - <li> 백엔드 </li> - <li> 문경호 </li> - <li> 김다인 </li> - </ul> - <ul> - <li> 프론트엔드 </li> - <li> 박태현 </li> - <li> 장지윤 </li> - </ul> - <ul> - <li>DOCUMENT</li> - <li><a href='https://git.ajou.ac.kr/wss9/fiturring' className="link" >GitLab</a></li> - <li><a href='https://www.notion.so/2024-2-130669572a77805db7e8e4f991ad455e?pvs=4' className="link">Notion</a></li> - </ul> - </div> - ) -} -export default Footer; \ No newline at end of file diff --git a/front/src/components/HabitTracker/Day.jsx b/front/src/components/HabitTracker/Day.jsx index 8bf41418f1a5f0b551edb91e4c7a98cf012672a7..c899aee2cede51ec8758b65fa4e125221dc51bde 100644 --- a/front/src/components/HabitTracker/Day.jsx +++ b/front/src/components/HabitTracker/Day.jsx @@ -2,7 +2,7 @@ import react, { useState, useEffect } from 'react'; import '../index.css'; import Ring from './Ring'; -import ExerciseBlock from './ExerciseBlock'; +import ExerciseBlock from '../common/ExerciseBlock'; import { getGoal } from '../../api/HabitTrackerAPI'; function displayWhat(item, mode, goal, doit){ diff --git a/front/src/components/HabitTracker/ExerciseBlock.jsx b/front/src/components/HabitTracker/ExerciseBlock.jsx deleted file mode 100644 index 35b7481a521a140f2d650bac5b38213a1cdd039c..0000000000000000000000000000000000000000 --- a/front/src/components/HabitTracker/ExerciseBlock.jsx +++ /dev/null @@ -1,59 +0,0 @@ -import react from 'react'; - -import '../index.css'; - -function Clickable({data}){ - const videoData = data.exercises || data; - - return ( - <> - {videoData.map((item) => ( - <div id="clickBlock" className="block"> - {/* <Thumbnails video_id={item.video_id} /> */} - <div className="space-between"> - <h3 className="simplified">{item.video_title}</h3> - <span> - {item.video_tag} - <br /> - </span> - {/* <span>{secToTime(item.video_length)}</span> */} - {/* <span className="right-text"> - <FontAwesomeIcon icon={faHeart} /> - {item.video_likes} - <br /> - </span> */} - </div> - </div> - ))} - </> - ); -} - -function NonClickable({data}){ - return ( - <> - {data.exercises.map((item) => ( - <div> - <div id={item.date} className="nonclickable"> - {item.video_title} - </div> - </div> - ))} - </> - ); -} - - -function ExerciseBlock({data, mode}){ - return ( - (mode === 'clickable')?( - <Clickable - data={data} /> - ):( - <NonClickable - data={data} /> - ) - ); -} - -export default ExerciseBlock; \ No newline at end of file diff --git a/front/src/components/HabitTracker/Ring.jsx b/front/src/components/HabitTracker/Ring.jsx index 727d1c37c9913fcbaf4efa3b71ab930a203e8144..126df1ee6f15d2b61858d464c07a010e8caae3b3 100644 --- a/front/src/components/HabitTracker/Ring.jsx +++ b/front/src/components/HabitTracker/Ring.jsx @@ -5,11 +5,15 @@ import '../index.css'; function calculPercent(data, goal){ let total = 0; for (let i=0; i<data.exercises.length; i++){ - let time = data.exercises[i].video_time; - let min = parseInt(time.slice(0,time.indexOf(':'))); - let sec = parseInt(time.slice(time.indexOf(':')+1)); - total += (min*60+sec); - } + let time = data.exercises[i].video_length; + total += parseInt(time); + } + // for (let i=0; i<data.exercises.length; i++){ + // let time = data.exercises[i].video_time; + // let min = parseInt(time.slice(0,time.indexOf(':'))); + // let sec = parseInt(time.slice(time.indexOf(':')+1)); + // total += (min*60+sec); + // } const percent = (total/goal >= 1)? 1 : (total/goal).toFixed(2); return percent; } diff --git a/front/src/components/HabitTracker/SideBar.jsx b/front/src/components/HabitTracker/SideBar.jsx index 143d20a8464848f208be5ca5f27304c6d31edf98..9f9a76e5e0938cf715964698474ab0486d42c6e8 100644 --- a/front/src/components/HabitTracker/SideBar.jsx +++ b/front/src/components/HabitTracker/SideBar.jsx @@ -2,28 +2,9 @@ import react, {useEffect, useState} from 'react'; import {Link} from 'react-router-dom'; import '../index.css'; -import ExerciseBlock from './ExerciseBlock'; +import ExerciseBlock from '../common/ExerciseBlock'; import { getGoal, getUserData } from '../../api/HabitTrackerAPI'; - - -const exerciseData = - { - date:'2024-11-01', - exercises: [{ - video_title: 'workout1', - video_tag: 'head', - video_time: '10:49' - }, - { - video_title: 'workout6', - video_tag: 'neck', - video_time: '22:49' - },], - }; - - - function refineGoals(data){ let result = ''; for (let i=0; i<7; i++){ @@ -63,7 +44,7 @@ function UserStatus({userData, data}){ <div> <div id="userInfo" className="infoList"> <div>{userData.user_name}</div> - <div>성별: {userData.user_gender}</div> + <div>성별: {userData.user_gender === 0?'남':'여'}</div> <div>나이: {userData.user_age}</div> </div> <div className="infoList"> diff --git a/front/src/components/Header.jsx b/front/src/components/Header.jsx deleted file mode 100644 index eba0d34cb78de350b472eba54b614997e5b15a98..0000000000000000000000000000000000000000 --- a/front/src/components/Header.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import react from 'react'; -import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; - -import './index.css'; -import {ReactComponent as Logo} from '../assets/logo.svg'; - -function MyPage(props){ - if (props.userId){ - return ( - <span> - <Link className="link large" to='/mypage'>My Page</Link> - <Link className="link large" to='/sign'>Sign Out</Link> - </span> - ); - } - else{ - return ( - <Link className="link large" to='/sign'>Sign in</Link> - ); - } -} - -function Header(){ - - return ( - <div id="header"> - <Link className="logo link large" to='/'> - <Logo width='25pt' height='30pt' fill='#0072CE'/> - <span>Fiturring</span> - </Link> - <Link className="link large" to='/workout'>Workout</Link> - <Link className="link large" to='/habitTracker'>Habit Tracker</Link> - <Link className="link large" to='/routine'>Routine</Link> - <Link className="link large" to='diet'>Diet</Link> - <MyPage /> - </div> - ); -} - -export default Header; \ No newline at end of file diff --git a/front/src/components/common/ExerciseBlock.jsx b/front/src/components/common/ExerciseBlock.jsx index e4d699507c945ef6d1f4359328d8d285d904293c..f9b7d62e802ed171ee56261b6c85cb072fc32743 100644 --- a/front/src/components/common/ExerciseBlock.jsx +++ b/front/src/components/common/ExerciseBlock.jsx @@ -15,10 +15,13 @@ function handleClick(e, item, onClick) { } function Clickable({data, onClick}){ - console.log(data); + let videos + if (data.exercises) videos = data.exercises; + else videos = data; + console.log(videos); return ( <> - {data.map((item) => ( + {videos.map((item) => ( <div> <div id="clickBlock" className="block" onClick={(e) => onClick(item)}> <Thumbnails video_id={item.video_id} video_title={item.video_title} mode="mqdefault"/> @@ -39,11 +42,16 @@ function Clickable({data, onClick}){ } function NonClickable({data}){ + let videos + if (data.exercises) videos = data.exercises; + else videos = data; + console.log(videos); + return ( <> - {data.map((item) => ( + {videos.map((item) => ( <div> - <div className="block"> + <div className="block nonclickable"> {item.video_title} </div> </div> diff --git a/front/src/components/index.css b/front/src/components/index.css index 1f07ab214dfd91d6a5766fa7dbc0746e52830305..bbe4c62bbcac86be46efee171b1daf013f9c94c9 100644 --- a/front/src/components/index.css +++ b/front/src/components/index.css @@ -314,3 +314,13 @@ input[type='date']{ height: 1em; margin: 10px; } + +.nonclickable{ + max-width: 10em; + height: 1.5em; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + background-color: #f1efbd; + align-self: center; +} \ No newline at end of file diff --git a/front/src/components/workout/VideoDetails.jsx b/front/src/components/workout/VideoDetails.jsx index 9c0d752f3eef15a90dc9e81398823e505d50d2a2..367789d7e4071a13417342cecfd6dfbe36d1244b 100644 --- a/front/src/components/workout/VideoDetails.jsx +++ b/front/src/components/workout/VideoDetails.jsx @@ -34,14 +34,6 @@ function VideoDetails({video, routines}) { {routines.map((item) => ( <> <option value={item}>{item}</option> - <option value="javascript">JavaScript</option> - <option value="php">PHP</option> - <option value="java">Java</option> - <option value="golang">Golang</option> - <option value="python">Python</option> - <option value="c#">C#</option> - <option value="C++">C++</option> - <option value="erlang">Erlang</option> </> ))} </select>