1- import { Button , Checkbox , MenuItem , Select , Tooltip } from "@mui/material" ;
1+ import { Button , Checkbox , MenuItem , Select } from "@mui/material" ;
22import { useState } from "react" ;
33import { useSelector } from "react-redux" ;
4- import { HelpOutline } from "@mui/icons-material" ;
54import { AdminAccount } from "../../../services/redux/modules/admin/reducer" ;
65import { selectAccounts } from "../../../services/redux/modules/admin/selector" ;
76import { CollaborativeMode } from "../../../services/types" ;
@@ -17,6 +16,7 @@ import { useNavigateAndSearch } from "../../../services/hooks/hooks";
1716import Header from "../../../components/Header" ;
1817import { AFFINITY_PREFIX } from "./types" ;
1918import s from "./index.module.css" ;
19+ import { ITooltip } from "../../../components/iTooltip/iTooltip" ;
2020
2121export default function Affinity ( ) {
2222 const navigate = useNavigateAndSearch ( ) ;
@@ -30,14 +30,14 @@ export default function Affinity() {
3030 const accounts = useSelector ( selectAccounts ) ;
3131
3232 const add = ( account : AdminAccount ) => {
33- const newSet = new Set ( ids ) ;
34- if ( newSet . has ( account . id ) ) {
35- newSet . delete ( account . id ) ;
36- } else {
37- newSet . add ( account . id ) ;
38- }
39- setIds ( newSet ) ;
40- } ;
33+ const newSet = new Set ( ids ) ;
34+ if ( newSet . has ( account . id ) ) {
35+ newSet . delete ( account . id ) ;
36+ } else {
37+ newSet . add ( account . id ) ;
38+ }
39+ setIds ( newSet ) ;
40+ } ;
4141
4242 const compute = ( ) => {
4343 navigate ( `/collaborative/top/${ statType } /${ mode } ` , {
@@ -46,44 +46,39 @@ export default function Affinity() {
4646 } ) ;
4747 } ;
4848
49- const tooltip = (
50- < Tooltip
51- title = {
52- < div >
53- < p >
54- The affinity represents the probability the user like the same
55- songs. The affinity feature comes with two < strong > modes</ strong > :
56- </ p >
57- < ul >
58- < li >
59- < strong > Average</ strong > : bases the ranking on the average of the
60- proportion each people listening to a specific element. If A
61- listens to a song 50% of his time, B 25% and C 0%, the average
62- will be 25%, thus ranking higher than A 12%, B 12% and C 12%.
63- </ li >
64- < li >
65- < strong > Minima</ strong > : bases the ranking on the minimal
66- proportion of each people listening to a specific element. If A
67- listens to a song 50% of his time, B 25% and C 0%, the minima will
68- be 0%, thus ranking lower than A 100% B 5% and C 1%.
69- </ li >
70- </ ul >
71- < p >
72- Average can mean that the top songs will satisfy a lot some people
73- while minima means that the top songs will be known by everyone but
74- not enjoyed as much for everyone.
75- </ p >
76- </ div >
77- } >
78- < HelpOutline className = { s . question } />
79- </ Tooltip >
49+ const content = (
50+ < div >
51+ < p >
52+ The affinity represents the probability the user like the same
53+ songs. The affinity feature comes with two < strong > modes</ strong > :
54+ </ p >
55+ < ul >
56+ < li >
57+ < strong > Average</ strong > : bases the ranking on the average of the
58+ proportion each people listening to a specific element. If A
59+ listens to a song 50% of his time, B 25% and C 0%, the average
60+ will be 25%, thus ranking higher than A 12%, B 12% and C 12%.
61+ </ li >
62+ < li >
63+ < strong > Minima</ strong > : bases the ranking on the minimal
64+ proportion of each people listening to a specific element. If A
65+ listens to a song 50% of his time, B 25% and C 0%, the minima will
66+ be 0%, thus ranking lower than A 100% B 5% and C 1%.
67+ </ li >
68+ </ ul >
69+ < p >
70+ Average can mean that the top songs will satisfy a lot some people
71+ while minima means that the top songs will be known by everyone but
72+ not enjoyed as much for everyone.
73+ </ p >
74+ </ div >
8075 ) ;
8176
8277 return (
8378 < div className = { s . root } >
8479 < Header
8580 hideInterval
86- title = { < div className = { s . title } > Affinity { tooltip } </ div > }
81+ title = { < div className = { s . title } > Affinity < ITooltip content = { content } /> </ div > }
8782 subtitle = "Compute the affinity you have with somebody using YourSpotify"
8883 />
8984 < div className = { s . content } >
0 commit comments