Skip to content

Commit 05561d4

Browse files
brrkrmnNdibe Raymond Olisaemeka
authored and
Ndibe Raymond Olisaemeka
committed
redesigned activity card
refactor add multiple creators section create categories component refactor the use of category colors, translation file, and rendering of the tags separate creators section into its own component add unpublished icon to card update imports Author: Berra Karaman <[email protected]> Date: Wed Jan 24 22:58:02 2024 +0300
1 parent e1c4774 commit 05561d4

File tree

9 files changed

+381
-190
lines changed

9 files changed

+381
-190
lines changed

Diff for: zubhub_frontend/zubhub/public/locales/en/translation.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,9 @@
10841084
"mediaServerError": "Sorry media server is down we couldn't upload your files! try again later",
10851085
"uploadError": "error occurred while downloading file : "
10861086
}
1087-
}
1087+
},
1088+
"tooltipMore": " more",
1089+
"tooltipUnpublished": "Unpublished"
10881090
},
10891091

10901092
"activityDetails": {

Diff for: zubhub_frontend/zubhub/src/assets/js/colors.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const colors = {
1212
red: '#f44336',
1313
'blue-light': '#00B8C433',
1414
'blue-dark': '#7BA8AB',
15-
'blue-pale': '#DBECFF'
15+
'blue-pale': '#DBECFF',
16+
border: '#7E5B4B',
1617
}
1718

1819
export const borders = {

Diff for: zubhub_frontend/zubhub/src/assets/js/muiTheme.js

+13
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,17 @@ export const theme = createTheme({
3232
},
3333
},
3434
},
35+
categoryColors: {
36+
Animations: '#FCB07F',
37+
Art: '#F8D991',
38+
Science: '#FBC9B3',
39+
Coding: '#65B4BD',
40+
Electronics: '#F1D27C',
41+
Toys: '#FAC5C2',
42+
Games: '#6065A4',
43+
Mechanical: '#F571AE',
44+
Music: '#F1FC73',
45+
Robotics: '#A66CA9',
46+
Structures: '#FAE393',
47+
}
3548
});
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
import { colors } from "../../../colors";
2+
13
export const style = theme => ({
24
activityCardContainer: {
35
position: 'relative',
4-
// maxWidth: '350px',
5-
// minWidth: '300px',
6-
height: '95%',
6+
width: '100%',
7+
textAlign: 'left',
78
},
89
activityCard: {
910
maxWidth: '100%',
10-
borderRadius: '15px',
11+
height: '33em',
12+
borderRadius: '20px',
1113
position: 'relative!important',
12-
height: '100%',
1314
},
1415
opacity: {
1516
backgroundColor: 'black',
@@ -27,58 +28,42 @@ export const style = theme => ({
2728
objectFit: 'cover',
2829
height: '100%',
2930
},
31+
unpublishedCardImage: {
32+
filter: 'brightness(60%)'
33+
},
34+
publishStyle: {
35+
position: 'absolute',
36+
display: 'flex',
37+
alignItems: 'center',
38+
justifyContent: 'center',
39+
color: 'white',
40+
top: '1em',
41+
right: '1em',
42+
zIndex: 1,
43+
backgroundColor: colors.gray,
44+
padding: '0.2em 1em',
45+
borderRadius: '50px',
46+
fontWeight: 700,
47+
fontSize: '1.05rem',
48+
},
3049
mediaBoxStyle: {
3150
width: '100%',
32-
height: '17em',
51+
height: '13em',
3352
position: 'relative',
3453
padding: '2%',
3554
display: 'flex',
3655
justifyContent: 'center',
3756
alignItems: 'center',
3857
},
39-
activityTagsBox: {
40-
position: 'absolute',
41-
top: '10px',
42-
right: '10%',
43-
display: 'flex',
44-
},
45-
activityTagPill: {
46-
backgroundColor: 'white',
47-
color: 'var(--text-color2)',
48-
border: '1px solid var(--text-color2)',
49-
'&:hover': {
50-
backgroundColor: 'var(--text-color2)',
51-
color: 'white',
52-
border: '1px solid white',
53-
},
54-
},
55-
activityTagsShowMore: {
56-
'&:hover': {
57-
backgroundColor: 'white',
58-
color: 'var(--text-color2)',
59-
border: '1px solid white',
60-
},
61-
},
62-
tagsShowMoreIconContainer: {
63-
//position: 'absolute',
64-
},
65-
tagsShowMoreList: {
66-
position: 'absolute',
67-
right: '0%',
68-
backgroundColor: 'white',
69-
maxHeight: '12em',
70-
overflow: 'auto',
71-
borderRadius: '10px',
72-
},
73-
7458
activityCardContent: {
7559
width: '100%',
76-
position: 'relative',
77-
},
78-
activityCardInfoBox: {
79-
height: '100%',
60+
padding: '16px',
61+
"&:last-child": {
62+
paddingBottom: '12px'
63+
},
8064
display: 'flex',
81-
justifyContent: 'space-between',
65+
flexDirection: 'column',
66+
justifyContent: 'space-between'
8267
},
8368
projectsCount: {
8469
color: 'white',
@@ -92,10 +77,70 @@ export const style = theme => ({
9277
marginLeft: '5px',
9378
},
9479
activityTitle: {
95-
fontSize: '1.1rem',
96-
fontWeight: '900',
80+
fontSize: '1.3rem',
81+
fontWeight: 700,
9782
color: 'var(--text-color1)',
98-
// width: '80%',
99-
textAlign: '-webkit-auto',
83+
overflow: 'hidden',
84+
textOverflow: 'ellipsis',
85+
whiteSpace: 'nowrap'
86+
},
87+
activityDescription: {
88+
height: '48px',
89+
margin: '8px 0',
90+
textOverflow: 'ellipsis',
91+
overflow: 'hidden',
92+
display: '-webkit-box',
93+
'-webkit-line-clamp': 2,
94+
'-webkit-box-orient': 'vertical',
95+
},
96+
activityCategoryContainer: {
97+
margin: '12px 0',
98+
display: 'flex',
99+
flexWrap: 'nowrap',
100+
gap: '8px',
101+
},
102+
activityCategory: {
103+
overflow: 'hidden',
104+
textOverflow: 'ellipsis',
105+
fontSize: '0.9em',
106+
padding: '2px 10px',
107+
border: '1px solid #7E5B4B',
108+
borderRadius: '10em',
109+
background: '#F1D27C'
110+
},
111+
footer: {
112+
marginTop: 10,
113+
display: 'flex',
114+
flexDirection: 'row',
115+
flexWrap: 'nowrap',
116+
overflow: 'hidden',
117+
},
118+
captionStyle: {
119+
display: 'flex',
120+
justifyContent: 'space-between',
121+
alignItems: 'center',
122+
},
123+
captionIconStyle: {
124+
backgroundColor: '#eee',
125+
padding: '2px 7px',
126+
borderRadius: 25,
127+
justifyContent: 'space-between',
128+
fontWeight: '600',
129+
display: 'flex',
130+
alignItems: 'center',
131+
marginRight: '1em',
132+
'& svg': {
133+
fill: 'rgba(0,0,0,0.54)',
134+
marginRight: '0.5em',
135+
fontSize:'1.1rem',
136+
},
100137
},
138+
date: {
139+
fontSize: '0.9rem',
140+
fontWeight: '600',
141+
marginLeft: 'auto',
142+
whiteSpace: 'nowrap',
143+
overflow: 'hidden',
144+
textOverflow: 'ellipsis',
145+
}
101146
});

0 commit comments

Comments
 (0)