Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MidweekMeeting pdf file #1598

Open
wants to merge 16 commits into
base: main-next
Choose a base branch
from

Conversation

IlkaA1
Copy link

@IlkaA1 IlkaA1 commented Apr 22, 2024

add MidweekMeeting pdf file

Copy link

vercel bot commented Apr 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
organized-app ✅ Ready (Inspect) Visit Preview Jun 3, 2024 5:36pm

@rhahao
Copy link
Member

rhahao commented Apr 22, 2024

Task linked: CU-86bx53yjk Midweek meeting – Normal

Copy link
Contributor

coderabbitai bot commented Apr 22, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (30)
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • src/shared/locales/ceb-PH/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ch-CHS/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/de-DE/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/en/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/es-ES/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/es-SSP/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/fr-FR/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/hu-HU/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/hy-AM/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/it-IT/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ja-JP/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-MG/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-TND/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-TNK/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-TTM/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-VZ/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mn-MN/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ne-NP/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/pl-PL/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/pt-BR/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/pt-PT/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ro-RO/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ru-RU/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/sv-SE/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/tl-PH/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/tr-TR/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/tw-TW/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/uk-UA/songs.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/vi-VN/songs.json is excluded by !**/*.json, !src/shared/locales/**

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes introduce a new React component, MidweekMeeting, and its associated subcomponents, designed to generate a PDF document for a midweek meeting agenda. This includes components for rendering meeting parts, songs, tasks, and times with specific styling. Additionally, the package.json file was updated to adjust the firebase package version, and the GitHub dependency review action was updated to a new version.

Changes

File Path Change Summary
src/v3/views/MidweekMeeting.tsx Added MidweekMeeting component for generating midweek meeting agenda PDF.
src/v3/views/MidweekMeeting_PDF/... Added subcomponents (MidweekMeetingPartsTitle, MidweekMeetingSong, MidweekMeetingTask, MidweekMeetingTime) for rendering parts of the midweek meeting PDF.
package.json Updated firebase package version from ^10.11.0 to ^10.6.0.
.github/workflows/dependency-review.yml Updated dependency-review-action version in GitHub Action workflow.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant MidweekMeeting
    participant MidweekMeetingPartsTitle
    participant MidweekMeetingSong
    participant MidweekMeetingTask
    participant MidweekMeetingTime

    User->>MidweekMeeting: Render PDF
    MidweekMeeting->>MidweekMeetingPartsTitle: Render Part Titles
    MidweekMeeting->>MidweekMeetingSong: Render Songs
    MidweekMeeting->>MidweekMeetingTask: Render Tasks
    MidweekMeeting->>MidweekMeetingTime: Render Times
    MidweekMeeting-->>User: Display PDF

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

@@ -28,7 +28,7 @@ import {
} from '@components/index';
import { useEffect, useState } from 'react';
import { IconAdd, IconAssign, IconClose, IconReturn, IconUndo, IconUpdate, IconInfo, IconVisitors } from '@icons/index';

import PdfPreview from './PDF_Peview';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical error in import statement for PdfPreview.

- import PdfPreview from './PDF_Peview';
+ import PdfPreview from './PDF_Preview';

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
import PdfPreview from './PDF_Peview';
import PdfPreview from './PDF_Preview';

Comment on lines 27 to 116
const styles = StyleSheet.create({
container: {
paddingTop: 2,
paddingBottom: 2,
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
gap: 4,
},
});

const func = (part, obj) => {
if (part === 'Apply yourself to the field ministry' && typeof obj === 'object') {
const mappedArray = Object.entries(obj).map(([_, value]) => {
return { value };
});
return mappedArray;
}
return [];
};

const participants = func(part, taskConductor);

return (
<View style={styles.container}>
<View
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
gap: 4,
}}
>
<View
style={{
display: 'flex',
flexDirection: 'row',
width: participants.length > 1 ? 188 : 304,
gap: 2,
flexWrap: 'wrap',
}}
>
<Text
style={{
fontFamily: 'Inter',
fontWeight: 'normal',
fontSize: 9,
color: textColor === '#3B4CA3' ? '#222222' : textColor,
}}
>
{taskNumber} {taskTitle}
</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: 'normal', fontSize: 9, color: '#AAAAAA' }}>{taskTime}</Text>
</View>
{participants.length > 0 ? null : (
<Text style={{ fontFamily: 'Inter', fontWeight: 'light', fontSize: 9, color: '#757575' }}>Conductor:</Text>
)}
</View>

{participants.length > 0 ? (
<View
style={
participants.length > 1
? { display: 'flex', flexDirection: 'row', width: 326, gap: 2, paddingRight: 2 }
: {}
}
>
{participants.map((participant: any, index: number) => (
<View
key={index}
style={{ display: 'flex', flexDirection: 'row', width: 106, gap: 4, paddingBottom: 4, paddingTop: 4 }}
>
<Text style={{ fontFamily: 'Inter', fontWeight: 'medium', fontSize: 9, color: '#222222' }}>
{participant.value.first}
</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: 'normal', fontSize: 9, color: '#222222' }}>
{participant.value.second}
</Text>
</View>
))}
</View>
) : (
<Text style={{ fontFamily: 'Inter', fontWeight: 'medium', fontSize: 9, color: '#222222' }}>
{typeof taskConductor === 'string' ? taskConductor : null}
</Text>
)}
</View>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize dynamic style creation and improve function naming.

- const styles = StyleSheet.create({
+ const staticStyles = StyleSheet.create({
- const func = (part, obj) => {
+ const mapTaskConductorToParticipants = (part, obj) => {

Move the styles object outside of the component to prevent it from being recreated on each render. Also, rename the func function to mapTaskConductorToParticipants for better clarity.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
const styles = StyleSheet.create({
container: {
paddingTop: 2,
paddingBottom: 2,
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
gap: 4,
},
});
const func = (part, obj) => {
if (part === 'Apply yourself to the field ministry' && typeof obj === 'object') {
const mappedArray = Object.entries(obj).map(([_, value]) => {
return { value };
});
return mappedArray;
}
return [];
};
const participants = func(part, taskConductor);
return (
<View style={styles.container}>
<View
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
gap: 4,
}}
>
<View
style={{
display: 'flex',
flexDirection: 'row',
width: participants.length > 1 ? 188 : 304,
gap: 2,
flexWrap: 'wrap',
}}
>
<Text
style={{
fontFamily: 'Inter',
fontWeight: 'normal',
fontSize: 9,
color: textColor === '#3B4CA3' ? '#222222' : textColor,
}}
>
{taskNumber} {taskTitle}
</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: 'normal', fontSize: 9, color: '#AAAAAA' }}>{taskTime}</Text>
</View>
{participants.length > 0 ? null : (
<Text style={{ fontFamily: 'Inter', fontWeight: 'light', fontSize: 9, color: '#757575' }}>Conductor:</Text>
)}
</View>
{participants.length > 0 ? (
<View
style={
participants.length > 1
? { display: 'flex', flexDirection: 'row', width: 326, gap: 2, paddingRight: 2 }
: {}
}
>
{participants.map((participant: any, index: number) => (
<View
key={index}
style={{ display: 'flex', flexDirection: 'row', width: 106, gap: 4, paddingBottom: 4, paddingTop: 4 }}
>
<Text style={{ fontFamily: 'Inter', fontWeight: 'medium', fontSize: 9, color: '#222222' }}>
{participant.value.first}
</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: 'normal', fontSize: 9, color: '#222222' }}>
{participant.value.second}
</Text>
</View>
))}
</View>
) : (
<Text style={{ fontFamily: 'Inter', fontWeight: 'medium', fontSize: 9, color: '#222222' }}>
{typeof taskConductor === 'string' ? taskConductor : null}
</Text>
)}
</View>
);
};
const staticStyles = StyleSheet.create({
container: {
paddingTop: 2,
paddingBottom: 2,
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
gap: 4,
},
});
const mapTaskConductorToParticipants = (part, obj) => {
if (part === 'Apply yourself to the field ministry' && typeof obj === 'object') {
const mappedArray = Object.entries(obj).map(([_, value]) => {
return { value };
});
return mappedArray;
}
return [];
};
const participants = mapTaskConductorToParticipants(part, taskConductor);
return (
<View style={staticStyles.container}>
<View
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
gap: 4,
}}
>
<View
style={{
display: 'flex',
flexDirection: 'row',
width: participants.length > 1 ? 188 : 304,
gap: 2,
flexWrap: 'wrap',
}}
>
<Text
style={{
fontFamily: 'Inter',
fontWeight: 'normal',
fontSize: 9,
color: textColor === '#3B4CA3' ? '#222222' : textColor,
}}
>
{taskNumber} {taskTitle}
</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: 'normal', fontSize: 9, color: '#AAAAAA' }}>{taskTime}</Text>
</View>
{participants.length > 0 ? null : (
<Text style={{ fontFamily: 'Inter', fontWeight: 'light', fontSize: 9, color: '#757575' }}>Conductor:</Text>
)}
</View>
{participants.length > 0 ? (
<View
style={
participants.length > 1
? { display: 'flex', flexDirection: 'row', width: 326, gap: 2, paddingRight: 2 }
: {}
}
>
{participants.map((participant: any, index: number) => (
<View
key={index}
style={{ display: 'flex', flexDirection: 'row', width: 106, gap: 4, paddingBottom: 4, paddingTop: 4 }}
>
<Text style={{ fontFamily: 'Inter', fontWeight: 'medium', fontSize: 9, color: '#222222' }}>
{participant.value.first}
</Text>
<Text style={{ fontFamily: 'Inter', fontWeight: 'normal', fontSize: 9, color: '#222222' }}>
{participant.value.second}
</Text>
</View>
))}
</View>
) : (
<Text style={{ fontFamily: 'Inter', fontWeight: 'medium', fontSize: 9, color: '#222222' }}>
{typeof taskConductor === 'string' ? taskConductor : null}
</Text>
)}
</View>
);
};

Copy link

socket-security bot commented Apr 23, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

View full report↗︎

package.json Outdated Show resolved Hide resolved
@rhahao
Copy link
Member

rhahao commented Apr 24, 2024

@IlkaA1: there was requested changes to the layout of the midweek meeting template lately. Please work with @ux-git to know the latest update. Other than that, great job! 🫡

sws2apps-admin and others added 8 commits April 27, 2024 08:55
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.2.5 to 4.3.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@5bbc3ba...0659a74)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@mui/x-date-pickers](https://github.com/mui/mui-x/tree/HEAD/packages/x-date-pickers) from 7.2.0 to 7.3.1.
- [Release notes](https://github.com/mui/mui-x/releases)
- [Changelog](https://github.com/mui/mui-x/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/mui-x/commits/v7.3.1/packages/x-date-pickers)

---
updated-dependencies:
- dependency-name: "@mui/x-date-pickers"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 18.3.0 to 18.3.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react-dom)

---
updated-dependencies:
- dependency-name: react-dom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [serve](https://github.com/vercel/serve) from 14.2.2 to 14.2.3.
- [Release notes](https://github.com/vercel/serve/releases)
- [Commits](vercel/serve@14.2.2...14.2.3)

---
updated-dependencies:
- dependency-name: serve
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/cypress-io/eslint-plugin-cypress/releases)
- [Commits](cypress-io/eslint-plugin-cypress@v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-cypress
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@mui/x-tree-view](https://github.com/mui/mui-x/tree/HEAD/packages/x-tree-view) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/mui/mui-x/releases)
- [Changelog](https://github.com/mui/mui-x/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/mui-x/commits/v7.3.1/packages/x-tree-view)

---
updated-dependencies:
- dependency-name: "@mui/x-tree-view"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ff0292d and 8fcdc64.
Files selected for processing (5)
  • src/v3/views/MidweekMeeting.tsx (1 hunks)
  • src/v3/views/MidweekMeeting_PDF/MidweekMeetingPartsTitle.tsx (1 hunks)
  • src/v3/views/MidweekMeeting_PDF/MidweekMeetingSong.tsx (1 hunks)
  • src/v3/views/MidweekMeeting_PDF/MidweekMeetingTask.tsx (1 hunks)
  • src/v3/views/MidweekMeeting_PDF/MidweekMeetingTime.tsx (1 hunks)
Additional Context Used
Biome (8)
src/v3/views/MidweekMeeting_PDF/MidweekMeetingPartsTitle.tsx (2)

4-5: All these imports are only used as types.


58-58: Avoid using the index of an array as key property in an element.

src/v3/views/MidweekMeeting_PDF/MidweekMeetingSong.tsx (1)

7-8: All these imports are only used as types.

src/v3/views/MidweekMeeting_PDF/MidweekMeetingTask.tsx (4)

41-45: This else clause can be omitted because previous branches break early.


43-45: This else clause can be omitted because previous branches break early.


6-7: All these imports are only used as types.


125-125: Avoid using the index of an array as key property in an element.

src/v3/views/MidweekMeeting_PDF/MidweekMeetingTime.tsx (1)

3-4: All these imports are only used as types.

Additional comments not posted (10)
src/v3/views/MidweekMeeting_PDF/MidweekMeetingTime.tsx (1)

52-52: Export statement is correctly implemented.

src/v3/views/MidweekMeeting_PDF/MidweekMeetingSong.tsx (1)

70-70: Export statement is correctly implemented.

src/v3/views/MidweekMeeting_PDF/MidweekMeetingPartsTitle.tsx (2)

34-73: Skip generating a comment about defining styles outside the component as it has been previously addressed.


76-76: Export statement is correctly implemented.

src/v3/views/MidweekMeeting.tsx (4)

1-3: Import statements are correctly implemented.


13-129: Data structures for meeting details and tasks are well-defined and appropriate for the PDF generation.


131-140: Component definition for generating the PDF document is correctly implemented.


142-142: Export statement is correctly implemented.

src/v3/views/MidweekMeeting_PDF/MidweekMeetingTask.tsx (2)

19-153: Skip generating a comment about optimizing dynamic style creation and improving function naming as it has been previously addressed.


156-156: Export statement is correctly implemented.

Comment on lines +3 to +4
import InterRegular from '@assets/fonts/Inter-Regular.ttf';
import { MidweekMeetingTimeProps } from './midweekMeeting.types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize imports used only as types.

- import InterRegular from '@assets/fonts/Inter-Regular.ttf';
- import { MidweekMeetingTimeProps } from './midweekMeeting.types';
+ import type { MidweekMeetingTimeProps } from './midweekMeeting.types';

Committable suggestion was skipped due low confidence.

Comment on lines +11 to +50
const MidweekMeetingTime = ({ time, textColor }: MidweekMeetingTimeProps) => {
const getBGColor = (color) => {
switch (color) {
case '#3B4CA3':
return '#F2F5FF';
case '#2A6B77':
return '#3C7F8B14';
case '#956711':
return '#C2820014';
case '#942926':
return '#B82B1014';
default:
return null;
}
};

const style = StyleSheet.create({
container: {
width: 32,
paddingTop: 4,
paddingBottom: 4,
backgroundColor: getBGColor(textColor),
alignItems: 'center',
justifyContent: 'center',
},
time: {
fontFamily: 'Inter',
fontSize: 8,
fontWeight: 'normal',
color: textColor,
textAlign: 'center',
},
});

return (
<View style={style.container}>
<Text style={style.time}>{time}</Text>
</View>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider defining static styles outside the component to improve performance.

+ const staticStyles = StyleSheet.create({
+   container: {
+     width: 32,
+     paddingTop: 4,
+     paddingBottom: 4,
+     alignItems: 'center',
+     justifyContent: 'center',
+   },
+   time: {
+     fontFamily: 'Inter',
+     fontSize: 8,
+     fontWeight: 'normal',
+     textAlign: 'center',
+   },
+ });

  const MidweekMeetingTime = ({ time, textColor }: MidweekMeetingTimeProps) => {
-   const style = StyleSheet.create({
-     container: {
-       width: 32,
-       paddingTop: 4,
-       paddingBottom: 4,
-       backgroundColor: getBGColor(textColor),
-       alignItems: 'center',
-       justifyContent: 'center',
-     },
-     time: {
-       fontFamily: 'Inter',
-       fontSize: 8,
-       fontWeight: 'normal',
-       color: textColor,
-       textAlign: 'center',
-     },
-   });
+   const dynamicStyles = {
+     container: {
+       ...staticStyles.container,
+       backgroundColor: getBGColor(textColor),
+     },
+     time: {
+       ...staticStyles.time,
+       color: textColor,
+     },
+   };

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
const MidweekMeetingTime = ({ time, textColor }: MidweekMeetingTimeProps) => {
const getBGColor = (color) => {
switch (color) {
case '#3B4CA3':
return '#F2F5FF';
case '#2A6B77':
return '#3C7F8B14';
case '#956711':
return '#C2820014';
case '#942926':
return '#B82B1014';
default:
return null;
}
};
const style = StyleSheet.create({
container: {
width: 32,
paddingTop: 4,
paddingBottom: 4,
backgroundColor: getBGColor(textColor),
alignItems: 'center',
justifyContent: 'center',
},
time: {
fontFamily: 'Inter',
fontSize: 8,
fontWeight: 'normal',
color: textColor,
textAlign: 'center',
},
});
return (
<View style={style.container}>
<Text style={style.time}>{time}</Text>
</View>
);
};
const staticStyles = StyleSheet.create({
container: {
width: 32,
paddingTop: 4,
paddingBottom: 4,
alignItems: 'center',
justifyContent: 'center',
},
time: {
fontFamily: 'Inter',
fontSize: 8,
fontWeight: 'normal',
textAlign: 'center',
},
});
const MidweekMeetingTime = ({ time, textColor }: MidweekMeetingTimeProps) => {
const getBGColor = (color) => {
switch (color) {
case '#3B4CA3':
return '#F2F5FF';
case '#2A6B77':
return '#3C7F8B14';
case '#956711':
return '#C2820014';
case '#942926':
return '#B82B1014';
default:
return null;
}
};
const dynamicStyles = {
container: {
...staticStyles.container,
backgroundColor: getBGColor(textColor),
},
time: {
...staticStyles.time,
color: textColor,
},
};
return (
<View style={dynamicStyles.container}>
<Text style={dynamicStyles.time}>{time}</Text>
</View>
);
};

fontWeight: 'light',
},
name: {
color: '##222222',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the typo in the color code.

- color: '##222222',
+ color: '#222222',

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
color: '##222222',
color: '#222222',

Comment on lines +7 to +8
import SongSvg from './Svg/SongSvg';
import { MidweekMeetingSongProps } from './midweekMeeting.types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize imports used only as types.

- import SongSvg from './Svg/SongSvg';
- import { MidweekMeetingSongProps } from './midweekMeeting.types';
+ import type { MidweekMeetingSongProps } from './midweekMeeting.types';

Committable suggestion was skipped due low confidence.

Comment on lines +4 to +5
import InterMedium from '@assets/fonts/Inter-Medium.ttf';
import { MeetingPartsTitleProps } from './midweekMeeting.types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize imports used only as types.

- import InterSemiBold from '@assets/fonts/Inter-SemiBold.ttf';
- import InterMedium from '@assets/fonts/Inter-Medium.ttf';
- import { MeetingPartsTitleProps } from './midweekMeeting.types';
+ import type { MeetingPartsTitleProps } from './midweekMeeting.types';

Committable suggestion was skipped due low confidence.

>
{keys.map((key, index) => (
<Text
key={index}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using array indexes as keys in React elements.

- key={index}
+ key={key}

Committable suggestion was skipped due low confidence.

>
{participants.map((participant: Participant, index) => (
<View
key={index}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using array indexes as keys in React elements.

- key={index}
+ key={participant.first}

Committable suggestion was skipped due low confidence.

Comment on lines +6 to +7
import InterLight from '@assets/fonts/Inter-Light.ttf';
import { MidweekMeetingTaskProps } from './midweekMeeting.types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize imports used only as types.

- import InterRegular from '@assets/fonts/Inter-Regular.ttf';
- import InterSemiBold from '@assets/fonts/Inter-SemiBold.ttf';
- import InterMedium from '@assets/fonts/Inter-Medium.ttf';
- import InterLight from '@assets/fonts/Inter-Light.ttf';
- import { MidweekMeetingTaskProps } from './midweekMeeting.types';
+ import type { MidweekMeetingTaskProps } from './midweekMeeting.types';

Committable suggestion was skipped due low confidence.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8fcdc64 and cc93961.

Files ignored due to path filters (27)
  • src/shared/locales/ceb-PH/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ch-CHS/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/de-DE/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/en/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/es-ES/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/es-SSP/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/fr-FR/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/hu-HU/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/hy-AM/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/it-IT/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ja-JP/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-MG/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-TND/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-TNK/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-TTM/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mg-VZ/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/mn-MN/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ne-NP/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/pl-PL/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/pt-BR/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ro-RO/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/ru-RU/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/sv-SE/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/tl-PH/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/tr-TR/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/tw-TW/meetings.json is excluded by !**/*.json, !src/shared/locales/**
  • src/shared/locales/uk-UA/meetings.json is excluded by !**/*.json, !src/shared/locales/**
Files selected for processing (1)
  • .github/workflows/dependency-review.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/dependency-review.yml

Copy link

sonarcloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants