1- import React from 'react' ;
2- import { Link } from 'react-router-dom' ;
3- import PropTypes from 'prop-types' ;
4- import { connect } from 'react-redux' ;
5- import clsx from 'clsx' ;
6- import { makeStyles } from '@mui/styles' ;
7- import { style } from '../../assets/js/styles/components/activity/activityStyle' ;
8- import BookmarkIcon from '@mui/icons-material/Bookmark' ;
9- import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder' ;
1+ import EmojiObjectsIcon from '@mui/icons-material/EmojiObjects' ;
102import VisibilityIcon from '@mui/icons-material/Visibility' ;
113import {
12- getActivities ,
13- activityToggleSave ,
14- setActivity ,
15- } from '../../store/actions/activityActions' ;
16- import {
4+ Box ,
175 Card ,
186 CardActions ,
197 CardContent ,
208 CardMedia ,
21- Typography ,
22- Box ,
23- Grid ,
24- Avatar ,
259 Tooltip ,
10+ Typography
2611} from '@mui/material' ;
27- import VisibilityIcon from '@mui/icons-material/Visibility' ;
12+ import { makeStyles } from '@mui/styles' ;
13+ import clsx from 'clsx' ;
14+ import PropTypes from 'prop-types' ;
15+ import { default as React , default as React } from 'react' ;
2816import { MdPublicOff } from 'react-icons/md' ;
17+ import { connect } from 'react-redux' ;
18+ import { Link } from 'react-router-dom' ;
2919import commonStyles from '../../assets/js/styles' ;
20+ import { style } from '../../assets/js/styles/components/activity/activityStyle' ;
3021import { dFormatter } from '../../assets/js/utils/scripts' ;
31- import EmojiObjectsIcon from '@mui/icons-material/EmojiObjects' ;
22+ import {
23+ activityToggleSave ,
24+ getActivities ,
25+ setActivity ,
26+ } from '../../store/actions/activityActions' ;
3227import Categories from '../categories/Categories' ;
3328import Creators from '../creators/Creators' ;
3429
@@ -46,6 +41,13 @@ function Activity(props) {
4641 onClick = { e => props . setActivity ( activity ) }
4742 >
4843 < Card className = { clsx ( classes . activityCard ) } >
44+ { ! activity . publish && (
45+ < Tooltip title = { t ( 'activities.tooltipUnpublished' ) } placement = "right-start" arrow >
46+ < Box className = { classes . publishStyle } >
47+ < MdPublicOff />
48+ </ Box >
49+ </ Tooltip >
50+ ) }
4951 { ! activity . publish && (
5052 < Tooltip title = { t ( 'activities.tooltipUnpublished' ) } placement = "right-start" arrow >
5153 < Box className = { classes . publishStyle } >
@@ -59,6 +61,8 @@ function Activity(props) {
5961 alt = { activity . title }
6062 className = { clsx ( classes . activityCardImage , ! activity . publish && classes . unpublishedCardImage ) }
6163 />
64+ className={ clsx ( classes . activityCardImage , ! activity . publish && classes . unpublishedCardImage ) }
65+ />
6266 </ CardMedia >
6367 < CardActions >
6468 < CardContent className = { classes . activityCardContent } >
@@ -69,6 +73,18 @@ function Activity(props) {
6973 >
7074 { activity . title }
7175 </ Typography >
76+ < Typography
77+ variant = "subtitle2"
78+ color = "textSecondary"
79+ component = "p"
80+ className = { classes . activityDescription }
81+ < Typography
82+ variant = "h5"
83+ component = "h2"
84+ className = { classes . activityTitle }
85+ >
86+ { activity . title }
87+ </ Typography >
7288 < Typography
7389 variant = "subtitle2"
7490 color = "textSecondary"
@@ -81,13 +97,27 @@ function Activity(props) {
8197 < Categories categories = { activity . category } />
8298 ) }
8399 < Creators creators = { activity ?. creators } />
100+ < Box className = { classes . footer } >
101+ < Box className = { classes . captionStyle } >
102+ { activity . introduction . replace ( / ( < ( [ ^ > ] + ) > ) / gi, "" ) }
103+ </ Typography >
104+ { activity . category . length > 0 && (
105+ < Categories categories = { activity . category } />
106+ ) }
107+ < Creators creators = { activity ?. creators } />
84108 < Box className = { classes . footer } >
85109 < Box className = { classes . captionStyle } >
86110 < Typography
87111 className = { classes . captionIconStyle }
88112 color = "textSecondary"
89113 variant = "caption"
90114 component = "span"
115+ >
116+ < VisibilityIcon /> { activity . views_count }
117+ className={ classes . captionIconStyle }
118+ color="textSecondary"
119+ variant="caption"
120+ component="span"
91121 >
92122 < VisibilityIcon /> { activity . views_count }
93123 </ Typography >
@@ -102,8 +132,25 @@ function Activity(props) {
102132 </ Box >
103133 < Typography color = "textSecondary" variant = "caption" component = "span" className = { classes . date } >
104134 { `
105- ${ dFormatter ( activity . created_on ) . value }
106- ${ t ( `date.${ dFormatter ( activity . created_on ) . key } ` ) }
135+ ${ dFormatter ( activity . created_on ) . value }
136+ ${ t ( `date.${ dFormatter ( activity . created_on ) . key } ` ) }
137+ ${ t ( 'date.ago' , ) }
138+ ` }
139+ </ Typography >
140+ </ Box >
141+ < Typography
142+ className = { classes . captionIconStyle }
143+ color = "textSecondary"
144+ variant = "caption"
145+ component = "span"
146+ >
147+ < EmojiObjectsIcon /> { activity . inspired_projects . length }
148+ </ Typography >
149+ </ Box >
150+ < Typography color = "textSecondary" variant = "caption" component = "span" className = { classes . date } >
151+ { `
152+ ${ dFormatter ( activity . created_on ) . value }
153+ ${ t ( `date.${ dFormatter ( activity . created_on ) . key } ` ) }
107154 ${ t ( 'date.ago' , ) }
108155 ` }
109156 </ Typography >
0 commit comments