diff --git a/jam-ui/src/components/profile/JKProfileInstrumentsList.js b/jam-ui/src/components/profile/JKProfileInstrumentsList.js index cd49a5211..313f2540a 100644 --- a/jam-ui/src/components/profile/JKProfileInstrumentsList.js +++ b/jam-ui/src/components/profile/JKProfileInstrumentsList.js @@ -20,11 +20,22 @@ const JKPersonInstrumentsList = ({ instruments, showAll, toggleMoreDetails }) => showAll || !greaterThan.xs ? setInstrumentsToShow(instruments) : setInstrumentsToShow(instruments.slice(0, LIMIT)); }, [showAll]); + const instrumentIconFile = instrument => { + try { + return require(`../../icons/instruments/icon_instrument_${instrument.instrument_id.replace(/\s+/g,"_")}.svg`); + } catch (error) { + return require(`../../icons/instruments/icon_instrument_unknown.svg`); + } + + } return (
{instrumentsToShow && instrumentsToShow.map(instrument => ( -
+
+ + {instrument.description} + {instrument.description}: {proficiencies[instrument.proficiency_level]}
))} diff --git a/jam-ui/src/components/profile/JKProfileSidePanel.js b/jam-ui/src/components/profile/JKProfileSidePanel.js index 03a682764..9e57ae65c 100644 --- a/jam-ui/src/components/profile/JKProfileSidePanel.js +++ b/jam-ui/src/components/profile/JKProfileSidePanel.js @@ -31,7 +31,12 @@ const JKProfileSidePanel = props => { const {t} = useTranslation(); const joinedDate = () => { - return moment(new Date(user.created_at_timestamp * 1000)).format('MM-DD-YYYY'); + try{ + return moment(new Date(parseInt(user.created_at_timestamp) * 1000)).format('MM-DD-YYYY'); + }catch(e){ + return 'Not specified'; + } + }; const location = () => { diff --git a/jam-ui/src/components/sessions/JKSession.js b/jam-ui/src/components/sessions/JKSession.js index 78c01e976..448ae19be 100644 --- a/jam-ui/src/components/sessions/JKSession.js +++ b/jam-ui/src/components/sessions/JKSession.js @@ -97,6 +97,14 @@ clicks this button, we open an audio stream using Icecast server to let the user overflow: "hidden" } + const instrumentIconFile = track => { + try { + return require(`../../icons/instruments/icon_instrument_${track.instrument_id.replace(/\s+/g,"_")}.svg`) + }catch (error) { + return require(`../../icons/instruments/icon_instrument_unknown.svg`); + } + } + return ( <> {greaterThan.sm ? ( @@ -140,7 +148,7 @@ clicks this button, we open an audio stream using Icecast server to let the user {participant.tracks.map(track => ( - {track.instrment} + {track.instrment} ))} diff --git a/jam-ui/src/components/sessions/JKSessionUser.js b/jam-ui/src/components/sessions/JKSessionUser.js index d213f1690..2325f2db3 100644 --- a/jam-ui/src/components/sessions/JKSessionUser.js +++ b/jam-ui/src/components/sessions/JKSessionUser.js @@ -11,6 +11,7 @@ import PropTypes from 'prop-types'; function JKSessionUser({ user }) { const dispatch = useDispatch(); const latencyData = useSelector(state => state.latency.latencies.find(l => l.user_id === user.id)); + const userData = useSelector(state => state.people.people.find(p => p.id === user.id)); const [showSidePanel, setShowSidePanel] = useState(false); const { greaterThan } = useResponsive(); @@ -61,7 +62,7 @@ function JKSessionUser({ user }) {
)} - + ); } diff --git a/jam-ui/src/icons/instruments/icon_instrument_unknown.svg b/jam-ui/src/icons/instruments/icon_instrument_unknown.svg new file mode 100644 index 000000000..4dc9e5bc1 --- /dev/null +++ b/jam-ui/src/icons/instruments/icon_instrument_unknown.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jam-ui/src/store/features/peopleSlice.js b/jam-ui/src/store/features/peopleSlice.js index 461206119..4d3550f91 100644 --- a/jam-ui/src/store/features/peopleSlice.js +++ b/jam-ui/src/store/features/peopleSlice.js @@ -109,6 +109,7 @@ export const peopleSlice = createSlice({ .addCase(acceptFriendRequest.fulfilled, (state, action) => { }) .addCase(fetchPerson.fulfilled, (state, action) => { + console.log("fetchPerson -> response", action.payload) const person = state.people.find(person => person.id === action.payload.id) if(person){ const updated = {