Skip to content

Commit 5dab8f4

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
1 parent c3f4f34 commit 5dab8f4

File tree

9 files changed

+362
-179
lines changed

9 files changed

+362
-179
lines changed

zubhub_frontend/zubhub/public/locales/en/translation.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,9 @@
10981098
"mediaServerError": "Sorry media server is down we couldn't upload your files! try again later",
10991099
"uploadError": "error occurred while downloading file : "
11001100
}
1101-
}
1101+
},
1102+
"tooltipMore": " more",
1103+
"tooltipUnpublished": "Unpublished"
11021104
},
11031105

11041106
"activityDetails": {
+20-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
export const colors = {
2-
primary: '#02B7C4',
3-
"primary-01": "#E5F8F9",
4-
secondary: '#DC3545',
5-
tertiary: '#FECB00',
6-
'tertiary-dark': '#C18D30',
7-
black: '#292535',
8-
gray: '#7E7E7E',
9-
light: '#C4C4C4',
10-
white: '#fff',
11-
green: '#22C55E',
12-
red: '#f44336',
13-
'blue-light': '#00B8C433',
14-
'blue-dark': '#7BA8AB',
15-
'blue-pale': '#DBECFF'
16-
}
2+
primary: '#02B7C4',
3+
'primary-01': '#E5F8F9',
4+
secondary: '#DC3545',
5+
tertiary: '#FECB00',
6+
'tertiary-dark': '#C18D30',
7+
black: '#292535',
8+
gray: '#7E7E7E',
9+
light: '#C4C4C4',
10+
white: '#fff',
11+
green: '#22C55E',
12+
red: '#f44336',
13+
'blue-light': '#00B8C433',
14+
'blue-dark': '#7BA8AB',
15+
'blue-pale': '#DBECFF',
16+
border: '#7E5B4B',
17+
};
1718

1819
export const borders = {
19-
borderRadius: 20,
20-
borderRadiusMd: 8,
21-
borderRadiusSm: 4,
22-
}
20+
borderRadius: 20,
21+
borderRadiusMd: 8,
22+
borderRadiusSm: 4,
23+
};

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,17 @@
1+
import { colors } from '../../../colors';
2+
3+
// eslint-disable-next-line no-unused-vars
14
export const style = theme => ({
25
activityCardContainer: {
36
position: 'relative',
4-
// maxWidth: '350px',
5-
// minWidth: '300px',
6-
height: '95%',
7+
width: '100%',
8+
textAlign: 'left',
79
},
810
activityCard: {
911
maxWidth: '100%',
10-
borderRadius: '15px',
12+
height: '33em',
13+
borderRadius: '20px',
1114
position: 'relative!important',
12-
height: '100%',
1315
},
1416
opacity: {
1517
backgroundColor: 'black',
@@ -27,57 +29,41 @@ export const style = theme => ({
2729
objectFit: 'cover',
2830
height: '100%',
2931
},
32+
unpublishedCardImage: {
33+
filter: 'brightness(60%)',
34+
},
35+
publishStyle: {
36+
position: 'absolute',
37+
display: 'flex',
38+
alignItems: 'center',
39+
justifyContent: 'center',
40+
color: 'white',
41+
top: '1em',
42+
right: '1em',
43+
zIndex: 1,
44+
backgroundColor: colors.gray,
45+
padding: '0.2em 1em',
46+
borderRadius: '50px',
47+
fontWeight: 700,
48+
fontSize: '1.05rem',
49+
},
3050
mediaBoxStyle: {
3151
width: '100%',
32-
height: '17em',
52+
height: '13em',
3353
position: 'relative',
3454
padding: '2%',
3555
display: 'flex',
3656
justifyContent: 'center',
3757
alignItems: 'center',
3858
},
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-
7459
activityCardContent: {
7560
width: '100%',
76-
position: 'relative',
77-
},
78-
activityCardInfoBox: {
79-
height: '100%',
61+
padding: '16px',
62+
'&:last-child': {
63+
paddingBottom: '12px',
64+
},
8065
display: 'flex',
66+
flexDirection: 'column',
8167
justifyContent: 'space-between',
8268
},
8369
projectsCount: {
@@ -92,10 +78,70 @@ export const style = theme => ({
9278
marginLeft: '5px',
9379
},
9480
activityTitle: {
95-
fontSize: '1.1rem',
96-
fontWeight: '900',
81+
fontSize: '1.3rem',
82+
fontWeight: 700,
9783
color: 'var(--text-color1)',
98-
// width: '80%',
99-
textAlign: '-webkit-auto',
84+
overflow: 'hidden',
85+
textOverflow: 'ellipsis',
86+
whiteSpace: 'nowrap',
87+
},
88+
activityDescription: {
89+
height: '48px',
90+
margin: '8px 0',
91+
textOverflow: 'ellipsis',
92+
overflow: 'hidden',
93+
display: '-webkit-box',
94+
'-webkit-line-clamp': 2,
95+
'-webkit-box-orient': 'vertical',
96+
},
97+
activityCategoryContainer: {
98+
margin: '12px 0',
99+
display: 'flex',
100+
flexWrap: 'nowrap',
101+
gap: '8px',
102+
},
103+
activityCategory: {
104+
overflow: 'hidden',
105+
textOverflow: 'ellipsis',
106+
fontSize: '0.9em',
107+
padding: '2px 10px',
108+
border: '1px solid #7E5B4B',
109+
borderRadius: '10em',
110+
background: '#F1D27C',
111+
},
112+
footer: {
113+
marginTop: 10,
114+
display: 'flex',
115+
flexDirection: 'row',
116+
flexWrap: 'nowrap',
117+
overflow: 'hidden',
118+
},
119+
captionStyle: {
120+
display: 'flex',
121+
justifyContent: 'space-between',
122+
alignItems: 'center',
123+
},
124+
captionIconStyle: {
125+
backgroundColor: '#eee',
126+
padding: '2px 7px',
127+
borderRadius: 25,
128+
justifyContent: 'space-between',
129+
fontWeight: '600',
130+
display: 'flex',
131+
alignItems: 'center',
132+
marginRight: '1em',
133+
'& svg': {
134+
fill: 'rgba(0,0,0,0.54)',
135+
marginRight: '0.5em',
136+
fontSize: '1.1rem',
137+
},
138+
},
139+
date: {
140+
fontSize: '0.9rem',
141+
fontWeight: '600',
142+
marginLeft: 'auto',
143+
whiteSpace: 'nowrap',
144+
overflow: 'hidden',
145+
textOverflow: 'ellipsis',
100146
},
101147
});

0 commit comments

Comments
 (0)