Skip to content

Commit 9f3e659

Browse files
Merge pull request #4357 from OneCommunityGlobal/development
Frontend Release to Main [4.61]
2 parents ff9bd9e + a02f1f4 commit 9f3e659

25 files changed

Lines changed: 799 additions & 233 deletions

File tree

src/components/Announcements/Announcements.css renamed to src/components/Announcements/Announcements.module.css

Lines changed: 113 additions & 96 deletions
Large diffs are not rendered by default.

src/components/Announcements/index.jsx

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
/* Announcements/Announcements.jsx */
22
import { useState } from 'react';
3-
import './Announcements.css';
3+
import styles from './Announcements.module.css';
44
import { useSelector } from 'react-redux';
55
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
66
import classnames from 'classnames';
77
import SocialMediaComposer from './SocialMediaComposer';
88
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9-
import { faEnvelope } from '@fortawesome/free-solid-svg-icons';
9+
import {
10+
faEnvelope,
11+
faVideo,
12+
faNewspaper,
13+
faImage,
14+
faChartLine,
15+
} from '@fortawesome/free-solid-svg-icons';
1016
import { faFacebook, faLinkedin, faMedium } from '@fortawesome/free-brands-svg-icons';
1117
import ReactTooltip from 'react-tooltip';
12-
import EmailPanel from './platforms/email'; // ← new
18+
import EmailPanel from './platforms/email';
1319

1420
function Announcements({ title, email: initialEmail }) {
1521
const [activeTab, setActiveTab] = useState('email');
@@ -23,13 +29,24 @@ function Announcements({ title, email: initialEmail }) {
2329
return '#0077B5';
2430
case 'medium':
2531
return '#00ab6c';
32+
case 'video':
33+
return '#FF0000';
34+
case 'article':
35+
return '#4285f4';
36+
case 'photo':
37+
return '#E91E63';
38+
case 'weeklyreport':
39+
return '#00C853';
2640
default:
2741
return null;
2842
}
2943
};
3044

3145
const tabs = [
32-
{ id: 'email', icon: faEnvelope, label: 'Email' },
46+
{ id: 'weeklyreport', icon: faChartLine, label: 'Weekly Report' },
47+
{ id: 'photo', icon: faImage, label: 'Photo' },
48+
{ id: 'video', icon: faVideo, label: 'Video' },
49+
{ id: 'article', icon: faNewspaper, label: 'Article' },
3350
{ id: 'x', label: 'X', customIconSrc: 'social-media-logos/x_icon.png' },
3451
{ id: 'facebook', icon: faFacebook, label: 'Facebook' },
3552
{ id: 'linkedin', icon: faLinkedin, label: 'LinkedIn' },
@@ -42,11 +59,9 @@ function Announcements({ title, email: initialEmail }) {
4259
{ id: 'reddit', label: 'Reddit', customIconSrc: 'social-media-logos/reddit_icon.png' },
4360
{ id: 'tumblr', label: 'Tumblr', customIconSrc: 'social-media-logos/tumblr_icon.png' },
4461
{ id: 'imgur', label: 'Imgur', customIconSrc: 'social-media-logos/imgur_icon.png' },
45-
{ id: 'diigo', label: 'Diigo', customIconSrc: 'social-media-logos/diigo_icon.png' },
4662
{ id: 'myspace', label: 'Myspace', customIconSrc: 'social-media-logos/myspace_icon.png' },
4763
{ id: 'medium', icon: faMedium, label: 'Medium' },
4864
{ id: 'plurk', label: 'Plurk', customIconSrc: 'social-media-logos/plurk_icon.png' },
49-
{ id: 'bitily', label: 'Bitily', customIconSrc: 'social-media-logos/bitily_icon.png' },
5065
{
5166
id: 'livejournal',
5267
label: 'LiveJournal',
@@ -59,6 +74,7 @@ function Announcements({ title, email: initialEmail }) {
5974
label: 'Truth Social',
6075
customIconSrc: 'social-media-logos/truthsocial_icon.png',
6176
},
77+
{ id: 'email', icon: faEnvelope, label: 'Email' },
6278
];
6379

6480
const columns = Math.ceil(tabs.length / 2);
@@ -71,28 +87,34 @@ function Announcements({ title, email: initialEmail }) {
7187
return (
7288
<div className={darkMode ? 'bg-oxford-blue text-light' : ''} style={{ minHeight: '100%' }}>
7389
<Nav
74-
className={classnames('tab-grid', { 'two-rows': columns === 2, dark: darkMode })}
90+
className={classnames(styles.tabGrid, {
91+
[styles.twoRows]: columns === 2,
92+
[styles.dark]: darkMode,
93+
})}
7594
style={gridStyle}
7695
>
7796
{tabs.map(({ id, icon, label, customIconSrc }) => (
78-
<NavItem key={id}>
97+
<NavItem key={id} className={styles.navItem}>
7998
<NavLink
8099
data-tip={label}
81-
className={classnames('tab-nav-item', { active: activeTab === id, dark: darkMode })}
100+
className={classnames(styles.navLink, styles.tabNavItem, {
101+
[styles.active]: activeTab === id,
102+
[styles.dark]: darkMode,
103+
})}
82104
onClick={() => setActiveTab(id)}
83105
aria-selected={activeTab === id}
84106
>
85-
<div className="tab-icon">
107+
<div className={styles.tabIcon}>
86108
{customIconSrc ? (
87-
<img src={customIconSrc} alt={`${label} icon`} className="tab-icon" />
109+
<img src={customIconSrc} alt={`${label} icon`} className={styles.tabIcon} />
88110
) : (
89111
<FontAwesomeIcon
90112
icon={icon}
91113
style={{ width: '100%', height: '100%', color: getIconColor(id) }}
92114
/>
93115
)}
94116
</div>
95-
<div className="tab-label">{label}</div>
117+
<div className={styles.tabLabel}>{label}</div>
96118
</NavLink>
97119
</NavItem>
98120
))}
@@ -101,12 +123,26 @@ function Announcements({ title, email: initialEmail }) {
101123

102124
<div style={{ backgroundColor: darkMode ? '#14233a' : '#fff', padding: '1rem' }}>
103125
<TabContent activeTab={activeTab}>
104-
{/* Email tab now uses the extracted component */}
105126
<TabPane tabId="email">
106127
<EmailPanel title={title} initialEmail={initialEmail} />
107128
</TabPane>
108129

109-
{/* Platforms stay the same */}
130+
<TabPane tabId="video">
131+
<SocialMediaComposer platform="video" />
132+
</TabPane>
133+
134+
<TabPane tabId="article">
135+
<SocialMediaComposer platform="article" />
136+
</TabPane>
137+
138+
<TabPane tabId="photo">
139+
<SocialMediaComposer platform="photo" />
140+
</TabPane>
141+
142+
<TabPane tabId="weeklyreport">
143+
<SocialMediaComposer platform="weeklyreport" />
144+
</TabPane>
145+
110146
{[
111147
'x',
112148
'facebook',

src/components/Announcements/platforms/email/index.jsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Editor } from '@tinymce/tinymce-react';
44
import { toast } from 'react-toastify';
55
import { boxStyle, boxStyleDark } from '~/styles';
66
import { sendEmail, broadcastEmailsToAll } from '../../../../actions/sendEmails.jsx';
7+
import styles from '../../Announcements.module.css';
78

89
export default function EmailPanel({ title, initialEmail }) {
910
const dispatch = useDispatch();
@@ -142,8 +143,8 @@ export default function EmailPanel({ title, initialEmail }) {
142143
};
143144

144145
return (
145-
<div className="email-update-container">
146-
<div className="editor">
146+
<div className={styles.emailUpdateContainer}>
147+
<div className={styles.editor}>
147148
{title ? <h3>{title}</h3> : <h3>Weekly Progress Editor</h3>}
148149
<br />
149150
{showEditor && (
@@ -159,15 +160,15 @@ export default function EmailPanel({ title, initialEmail }) {
159160
/>
160161
)}
161162
<div className="send-buttons" style={{ marginTop: '1rem' }}>
162-
<button type="button" onClick={handleBroadcastEmails} className="send-button">
163+
<button type="button" onClick={handleBroadcastEmails} className={styles.sendButton}>
163164
Broadcast Weekly Update
164165
</button>
165166
</div>
166167
</div>
167168

168169
{title ? null : (
169170
<div
170-
className={`emails${darkMode ? ' bg-yinmn-blue text-light' : ''}`}
171+
className={`${styles.emails}${darkMode ? ' bg-yinmn-blue text-light' : ''}`}
171172
style={darkMode ? boxStyleDark : boxStyle}
172173
>
173174
<label htmlFor="email-list-input" className={darkMode ? 'text-light' : 'text-dark'}>
@@ -179,13 +180,13 @@ export default function EmailPanel({ title, initialEmail }) {
179180
value={emailTo}
180181
onChange={handleEmailListChange}
181182
placeholder="Enter email addresses (comma-separated)"
182-
className={`input-text-for-announcement ${
183+
className={`${styles.inputTextForAnnouncement} ${
183184
darkMode ? 'bg-darkmode-liblack text-light border-0' : ''
184185
}`}
185186
/>
186187
<button
187188
type="button"
188-
className="send-button"
189+
className={styles.sendButton}
189190
onClick={handleSendEmails}
190191
style={darkMode ? boxStyleDark : boxStyle}
191192
>
@@ -202,13 +203,13 @@ export default function EmailPanel({ title, initialEmail }) {
202203
value={headerContent}
203204
onChange={handleHeaderContentChange}
204205
placeholder="Enter header image URL"
205-
className={`input-text-for-announcement ${
206+
className={`${styles.inputTextForAnnouncement} ${
206207
darkMode ? 'bg-darkmode-liblack text-light border-0' : ''
207208
}`}
208209
/>
209210
<button
210211
type="button"
211-
className="send-button"
212+
className={styles.sendButton}
212213
onClick={addHeaderToEmailContent}
213214
style={darkMode ? boxStyleDark : boxStyle}
214215
>
@@ -223,7 +224,7 @@ export default function EmailPanel({ title, initialEmail }) {
223224
type="file"
224225
id="upload-header-input"
225226
onChange={addImageToEmailContent}
226-
className="input-file-upload"
227+
className={styles.inputFileUpload}
227228
/>
228229
</div>
229230
)}

src/components/Auth/PermissionWatcher.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function PermissionWatcher() {
3131

3232
if (!userProfile || !userProfile._id) {
3333
// eslint-disable-next-line no-console
34-
console.error('User profile not available');
34+
//console.error('User profile not available');
3535
setIsAckLoading(false);
3636
return;
3737
}
@@ -53,12 +53,12 @@ function PermissionWatcher() {
5353
})
5454
.catch(error => {
5555
// eslint-disable-next-line no-console
56-
console.error('Error updating user profile:', error);
56+
// console.error('Error updating user profile:', error);
5757
setIsAckLoading(false);
5858
});
5959
} catch (error) {
6060
// eslint-disable-next-line no-console
61-
console.error('Error acknowledging permission changes:', error);
61+
// console.error('Error acknowledging permission changes:', error);
6262
setIsAckLoading(false);
6363
}
6464
};

0 commit comments

Comments
 (0)