Skip to content

Commit 3611e79

Browse files
Merge pull request #32 from cherryontech/feat/communityforum
feat/communityforum
2 parents 5d6fae1 + 6fc5fc8 commit 3611e79

7 files changed

Lines changed: 537 additions & 78 deletions

File tree

src/components/DailySummary.jsx

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//react
22
import { useState, useEffect } from 'react';
3-
import { Link } from 'react-router-dom';
43

54
// component
65
import Button from './Button';
@@ -14,20 +13,31 @@ const DailySummary = ({
1413
onSave,
1514
}) => {
1615
const max_chars = 500;
17-
const [comment, setComment] = useState(initialComment || '');
16+
17+
const initialCommentObject = initialComment || {};
18+
const [comment, setComment] = useState(initialCommentObject.comment || '');
19+
20+
const [isOptedOut, setIsOptedOut] = useState(
21+
initialCommentObject.optOut || false
22+
);
23+
1824
const remainingChars = max_chars - comment.length;
1925

2026
useEffect(() => {
21-
setComment(initialComment || '');
27+
const updatedCommentObject = initialComment || {};
28+
setComment(updatedCommentObject.comment || '');
29+
setIsOptedOut(updatedCommentObject.optOut || false);
2230
}, [initialComment, day]);
2331

2432
const handleSave = () => {
25-
onSave(day, comment);
33+
onSave(day, comment, isOptedOut);
2634
onClose();
2735
};
2836

2937
const handleCancel = () => {
30-
setComment(initialComment || '');
38+
const updatedCommentObject = initialComment || {};
39+
setComment(updatedCommentObject.comment || '');
40+
setIsOptedOut(updatedCommentObject.optOut || false);
3141
onClose();
3242
};
3343

@@ -46,8 +56,9 @@ const DailySummary = ({
4656
Day {day} Summary
4757
</h2>
4858

49-
<p className="text-sm mb-4 text-eerie">{question}</p>
50-
59+
60+
<p className="text-sm mb-4 text-eerie text-justify">{question}</p>
61+
5162
<textarea
5263
className="w-full p-4 border border-eerie bg-white rounded-sm resize-none focus:ring-3 focus:ring-persianblue text-eerie"
5364
rows="6"
@@ -79,17 +90,25 @@ const DailySummary = ({
7990
</div>
8091
</div>
8192

82-
<div className="text-center mt-4">
83-
<Link
84-
to="/community"
85-
className="text-blue-700 text-sm font-semibold focus:outline-none focus-visible:ring-2 focus:p-2 focus-visible:ring-persianblue rounded-[5px]"
93+
{/*Checkbox for Opt-out */}
94+
<div className="flex items-center mt-5 mb-3 ml-6">
95+
<input
96+
id={`opt-out-${day}`}
97+
type="checkbox"
98+
checked={isOptedOut}
99+
onChange={(e) => setIsOptedOut(e.target.checked)}
100+
className="h-4 w-4 text-green border-eerie rounded focus:ring-persianblue"
101+
/>
102+
<label
103+
htmlFor={`opt-out-${day}`}
104+
className="ml-2 text-sm text-eerie font-poppins"
86105
>
87-
Visit Community Forum
88-
</Link>
106+
Opt out of sharing in the Community Forum
107+
</label>
89108
</div>
90109
</div>
91110
</div>
92111
);
93112
};
94113

95-
export default DailySummary;
114+
export default DailySummary;

src/components/ProgressBar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ProgressBar = ({ effectiveDays, onArrowClick }) => {
1212
<div className="flex justify-between items-center mb-2">
1313
<h4
1414
id="progress-label"
15-
className="text-sm font-medium text-eerie font-poppins"
15+
className="text-eerie font-medium text-base"
1616
>
1717
30 Day Progress
1818
</h4>

src/data/questions.js

Lines changed: 181 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,185 @@
1-
// src/data/questions.js
2-
31
export const questions = [
4-
"Write down three realistic, small acts of self-care I can commit to this week.",
5-
"What feelings or thoughts am I having about my professional identity right now?",
6-
"How can I ask my partner or support system for help with a specific task today or tomorrow?",
7-
// ... (27 more questions)
8-
"How has my definition of success changed since becoming a mother?",
9-
"Describe one or two small, loving moments you shared with your child(ren) today.",
2+
{
3+
day: 1,
4+
theme: 'Setting Boundaries',
5+
question:
6+
'Define what a truly successful, balanced week looks like for me, including personal time.',
7+
},
8+
9+
{
10+
day: 2,
11+
theme: 'Self-Introspection',
12+
question:
13+
'What feelings or thoughts am I having about my professional identity right now?',
14+
},
15+
{
16+
day: 3,
17+
theme: 'Celebrating Wins',
18+
question:
19+
'Name one or two things I am proud of myself for accomplishing today, no matter how small.',
20+
},
21+
{
22+
day: 4,
23+
theme: 'Self-Introspection',
24+
question:
25+
'Describe how my energy level feels right now, without judgment. What would I tell a friend who was feeling exactly the way I feel today?',
26+
},
27+
{
28+
day: 5,
29+
theme: 'Self-Advocacy',
30+
question:
31+
'How can I ask my partner or support system for help with a specific task today or tomorrow?',
32+
},
33+
{
34+
day: 6,
35+
theme: 'Self-Introspection',
36+
question:
37+
"Write a 'thank you' note to your body for everything it has done.",
38+
},
39+
{
40+
day: 7,
41+
theme: 'Celebrating Wins',
42+
question:
43+
'What is a small way I can reconnect with my partner or a loved one this weekend?',
44+
},
45+
{
46+
day: 8,
47+
theme: 'Self-Introspection',
48+
question:
49+
'What is one thing I deeply miss from my life before the baby, and how can I integrate a tiny piece of it now?',
50+
},
51+
{
52+
day: 9,
53+
theme: 'Self-Introspection',
54+
question:
55+
'List all my current work-related tasks and mark which ones bring me energy versus draining it. If I could delegate one task right now, which one would it be and why?',
56+
},
57+
{
58+
day: 10,
59+
theme: 'Setting Boundaries',
60+
question:
61+
'Write a script for a conversation where I clearly and respectfully decline a new commitment.',
62+
},
63+
{
64+
day: 11,
65+
theme: 'Setting Boundaries',
66+
question:
67+
'Write down three realistic, small acts of self-care I can commit to this week.',
68+
},
69+
{
70+
day: 12,
71+
theme: 'Self-Introspection',
72+
question:
73+
'How am I currently using my lunch breaks and how could I use them to truly disconnect?',
74+
},
75+
{
76+
day: 13,
77+
theme: 'Setting Boundaries',
78+
question:
79+
'What boundary do I need to establish with my work device (e.g., no email after 7 PM)?',
80+
},
81+
{
82+
day: 14,
83+
theme: 'Setting Boundaries',
84+
question:
85+
"What is the 'good enough' standard for my current projects, and where am I over-delivering unnecessarily?",
86+
},
87+
{
88+
day: 15,
89+
theme: 'Self-Advocacy',
90+
question:
91+
'Name one specific way my company or manager could better support my well-being.',
92+
},
93+
{
94+
day: 16,
95+
theme: 'Self-Introspection',
96+
question:
97+
'How does my body feel right now? Am I holding tension anywhere (shoulders, jaw, etc.)?',
98+
},
99+
{
100+
day: 17,
101+
theme: 'Self-Introspection',
102+
question:
103+
'Write a letter to my future self outlining the signs of burnout to watch for.',
104+
},
105+
{
106+
day: 18,
107+
theme: 'Setting Boundaries',
108+
question:
109+
'What are two things I could let go of or automate that would save me an hour of time weekly?',
110+
},
111+
{
112+
day: 19,
113+
theme: 'Self-Introspection',
114+
question:
115+
'If I took a mental health day tomorrow, what three activities would I do?',
116+
},
117+
{
118+
day: 20,
119+
theme: 'Self-Introspection',
120+
question:
121+
'What is my current definition of leadership, and how am I embodying it daily?',
122+
},
123+
{
124+
day: 21,
125+
theme: 'Self-Introspection',
126+
question:
127+
'Describe a recent situation where I had to make a difficult decision; what was the guiding principle?',
128+
},
129+
{
130+
day: 22,
131+
theme: 'Self-Advocacy',
132+
question:
133+
'What is one skill I need to delegate or train my team on so I can focus on strategy?',
134+
},
135+
{
136+
day: 23,
137+
theme: 'Self-Introspection',
138+
question:
139+
'Who in my network or industry do I admire as a leader, and what specific traits do they possess?',
140+
},
141+
{
142+
day: 24,
143+
theme: 'Self-Introspection',
144+
question:
145+
'What is the most significant legacy I want to build in my current role?',
146+
},
147+
{
148+
day: 25,
149+
theme: 'Gender Bias',
150+
question:
151+
'How am I actively creating a more inclusive and equitable environment for my junior colleagues?',
152+
},
153+
{
154+
day: 26,
155+
theme: 'Self-Advocacy',
156+
question:
157+
'What is one area of my company or industry where I feel my expertise is untapped?',
158+
},
159+
{
160+
day: 27,
161+
theme: 'Self-Introspection',
162+
question:
163+
'How am I actively seeking and implementing critical feedback on my leadership style?',
164+
},
165+
{
166+
day: 28,
167+
theme: 'Self-Advocacy',
168+
question:
169+
'How does my current compensation reflect my value and impact? What are three ways I can advocate for myself and my team more effectively in the next quarter?',
170+
},
171+
{
172+
day: 29,
173+
theme: 'Self-Advocacy',
174+
question:
175+
'What is the single most important lesson I want to teach my mentees this year? Why?',
176+
},
177+
{
178+
day: 30,
179+
theme: 'Celebrating Wins',
180+
question:
181+
"If I was starting a new company today, what is the first cultural value I would establish? How am I intentionally celebrating successes—both mine and my team's—this week?",
182+
},
10183
];
11184

12185
export const total_days = 30;

src/main.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Journal from './pages/journal';
1414
import Logout from './pages/Logout';
1515
import Challenges from './pages/Challenges';
1616
import Profile from './pages/Profile';
17+
import ForumResponses from './pages/ForumResponses';
1718
import App from './App';
1819

1920
const router = createBrowserRouter([
@@ -32,13 +33,11 @@ const router = createBrowserRouter([
3233
{ path: 'logout', element: <Logout /> },
3334
{ path: 'profile', element: <Profile /> },
3435
{ path: 'error', element: <Error /> },
36+
{ path: '*', element: <Error /> },
3537
{ path: 'challenges', element: <Challenges /> },
38+
{ path: '/community/responses/:day', element: <ForumResponses /> },
3639
],
3740
},
38-
{
39-
path: '*',
40-
element: <Error />,
41-
},
4241
]);
4342
createRoot(document.getElementById('root')).render(
4443
<StrictMode>

src/pages/Community.jsx

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,52 @@
1-
function Community() {
1+
// react
2+
import { Link } from 'react-router-dom';
3+
4+
// data
5+
import { questions } from '../data/questions';
6+
7+
//icon
8+
import { FaArrowRight } from 'react-icons/fa6';
9+
10+
const Community = () => {
211
return (
3-
<div className="min-h-screen bg-emerald-100 flex items-center justify-center">
4-
<h1 className="text-4xl font-bold text-lime-500">Community Page! 🎉</h1>
5-
</div>
12+
<main className="min-h-screen p-6 font-poppins">
13+
<div className="max-w-[1000px] mx-auto">
14+
<h1 className="text-3xl font-bold mb-2 font-playfair">
15+
Community Forum
16+
</h1>
17+
<p className="text-eerie mb-8">
18+
View how other women in tech responded to journal prompts.
19+
</p>
20+
21+
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
22+
{questions.map((q) => (
23+
<div
24+
key={q.day}
25+
className="bg-white p-6 rounded-lg border border-eerie flex flex-col justify-between"
26+
>
27+
<div>
28+
<h2 className="text-m font-semibold text-eerie font-playfair mb-2">
29+
Theme: {q.theme}
30+
</h2>
31+
<p className="text-m text-eerie font-poppins mb-4">
32+
{q.question}
33+
</p>
34+
</div>
35+
<div className="text-right">
36+
<Link
37+
to={`/community/responses/${q.day}`}
38+
className="bg-eerie text-white p-2 inline-flex items-center justify-center rounded-full cursor-pointer transition hover:bg-zinc active:bg-persianblue active:text-white active:p-2 flex-shrink-0 focus:outline-none focus-visible:ring-3 focus-visible:ring-persianblue focus-visible:ring-offset-2"
39+
aria-label={`View responses for day ${q.day}`}
40+
>
41+
<FaArrowRight className="w-5 h-5" aria-hidden="true" />
42+
</Link>
43+
</div>
44+
</div>
45+
))}
46+
</div>
47+
</div>
48+
</main>
649
);
7-
}
50+
};
851

9-
export default Community;
52+
export default Community;

0 commit comments

Comments
 (0)