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

Rounded corner in the PDF template and adding margin for titles #3201

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/assets/img/illustration_no_assigments.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const Drawer: FC<DrawerProps & CustomDrawerProps> = ({
justifyContent={'space-between'}
alignItems={'center'}
mb={'24px'}
ml={'12px'}
>
<Typography className="h1">{title}</Typography>
<Stack direction={'row'} spacing={0.5}>
Expand Down
3 changes: 2 additions & 1 deletion src/features/app_notification/container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ const NotificationContainer = ({
{notifications.length === 0 && (
<Box
sx={{
height: '318px',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '24px',
}}
>
Expand Down
28 changes: 28 additions & 0 deletions src/features/meetings/my_assignments/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import MenuItem from '@components/menuitem';
import MonthContainer from './month_container';
import Select from '@components/select';
import Typography from '@components/typography';
import NoAssigmentsImg from '@assets/img/illustration_no_assigments.svg?component';

const MyAssignments = () => {
const { t } = useAppTranslation();
Expand Down Expand Up @@ -70,6 +71,33 @@ const MyAssignments = () => {
},
}}
>
{personAssignments.length === 0 && (
<Box
sx={{
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '24px',
}}
>
<NoAssigmentsImg viewBox="0 0 128 128" />
<Stack spacing="8px">
<Typography className="h2">
{t('tr_noAssignmentsYet')}
</Typography>
<Typography
color="var(--grey-400)"
sx={{
maxWidth: '350px',
}}
>
{t('tr_noAssignmentsYetDesc')}
</Typography>
</Stack>
</Box>
)}

<Stack spacing={2.3}>
{personAssignments.map((month) => (
<MonthContainer key={month.month} monthData={month} />
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/congregation.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"tr_ministerialServants": "Ministerial servants",
"tr_studentAssignments": "Student assignments",
"tr_noAssignmentsYet": "No assignments yet",
"tr_noAssignmentsYetDesc": "You don’t have any upcoming assignments, or none that match your current display filter.",
"tr_withTerritory": "With territory",
"tr_withoutTerritory": "Without territory",
"tr_overdue": "Overdue",
Expand Down
13 changes: 11 additions & 2 deletions src/views/meetings/midweek/S140/app_normal/S140PartTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ import { Text, View } from '@react-pdf/renderer';
import { S140PartTimeType } from './index.types';
import styles from './index.styles';

const S140PartTime = ({ time, color, backgroundColor }: S140PartTimeType) => {
const S140PartTime = ({
time,
color,
backgroundColor,
isClosingSong,
}: S140PartTimeType) => {
const conditionalStyle = isClosingSong ? { borderBottomLeftRadius: 6 } : {};

return (
<View style={{ ...styles.timeContainer, backgroundColor }}>
<View
style={{ ...styles.timeContainer, backgroundColor, ...conditionalStyle }}
>
<Text style={{ ...styles.timeText, color }}>{time}</Text>
</View>
);
Expand Down
10 changes: 7 additions & 3 deletions src/views/meetings/midweek/S140/app_normal/S140Source.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ const S140Source = ({
return (
<View style={styles.sourceContainer}>
{source && (
<View style={styles.sourceTextContainer}>
<Text style={{ ...styles.sourceText, color }}>{source}</Text>
{duration && <Text style={styles.sourceDuration}>({duration})</Text>}
<View style={(styles.sourceTextContainer, { maxWidth: 350 })}>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix style composition syntax error

The current style composition using comma operator (styles.sourceTextContainer, { maxWidth: 350 }) will ignore styles.sourceTextContainer. The first expression is evaluated and discarded, only returning the second object.

Use object spread instead:

-<View style={(styles.sourceTextContainer, { maxWidth: 350 })}>
+<View style={{ ...styles.sourceTextContainer, maxWidth: 350 }}>
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<View style={(styles.sourceTextContainer, { maxWidth: 350 })}>
<View style={{ ...styles.sourceTextContainer, maxWidth: 350 }}>

<Text style={{ ...styles.sourceText, color }}>
{source}{' '}
{duration && (
<Text style={styles.sourceDuration}>({duration})</Text>
)}
</Text>
</View>
)}

Expand Down
1 change: 1 addition & 0 deletions src/views/meetings/midweek/S140/app_normal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ const TemplateS140AppNormal = ({
time={meetingData.timing.pgm_end}
color="#942926"
backgroundColor="rgba(184, 43, 16, 0.08)"
isClosingSong={true}
/>

<S140Source
Expand Down
1 change: 1 addition & 0 deletions src/views/meetings/midweek/S140/app_normal/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type S140PartTimeType = {
time: string;
color: string;
backgroundColor: string;
isClosingSong?: boolean;
};

export type S140SourceType = {
Expand Down
Loading