Skip to content
Open
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: 9 additions & 1 deletion src/components/HomePage/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface CardProps {
className?: string;
linkClassName?: string;
onClick?: () => void;
shouldPrefetch?: boolean;
}

const Card: React.FC<CardProps> = ({
Expand All @@ -22,10 +23,17 @@ const Card: React.FC<CardProps> = ({
className,
linkClassName,
onClick,
shouldPrefetch = false,
}) => {
if (link) {
return (
<Link href={link} isNewTab={isNewTab} className={linkClassName} onClick={onClick}>
<Link
href={link}
isNewTab={isNewTab}
className={linkClassName}
onClick={onClick}
shouldPrefetch={shouldPrefetch}
>
<div className={classNames(className, styles.card, styles.cardWithLink)}>{children}</div>
</Link>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/HomePage/ExploreTopicsSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const ExploreTopicsSection = () => {
className={classNames(styles.topic, {
[styles.highlighted]: topic.isHighlighted,
})}
shouldPrefetch={false}
>
<div>
{t(topic.key)} <ArrowIcon />
Expand Down
1 change: 1 addition & 0 deletions src/components/HomePage/QuickLinks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const QuickLinks: React.FC = () => {
logButtonClick(`quick_link_${quickLink.slug}`);
}}
className={styles.quickLink}
shouldPrefetch={false}
>
<div className={styles.quickLinkText}>
{text} <ArrowIcon />
Expand Down
8 changes: 7 additions & 1 deletion src/components/HomePage/QuranInYearSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ const QuranInYearSection = () => {
<div className={styles.calendarContainer}>
<CalendarIcon />
</div>
<Link variant={LinkVariant.Blend} href="/calendar" onClick={onCalendarClicked}>
<Link
variant={LinkVariant.Blend}
href="/calendar"
onClick={onCalendarClicked}
shouldPrefetch={false}
>
<p className={styles.calendarText}>{t('calendar-cta')}</p>
</Link>
</div>
Expand All @@ -66,6 +71,7 @@ const QuranInYearSection = () => {
onClick={() => {
logButtonClick('quran_in_year_calendar');
}}
shouldPrefetch={false}
>
{t('quran-in-year-cta')}
<IconContainer
Expand Down
10 changes: 8 additions & 2 deletions src/components/HomePage/ReadingSection/ChapterCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const ChapterCard: React.FC<Props> = ({
const link = getChapterWithStartingVerseUrl(`${surahNumber}:${verseNumber}`);

return (
<Card className={styles.chapterCard} link={link}>
<Card className={styles.chapterCard} link={link} shouldPrefetch={false}>
<div className={styles.surahContainer}>
<div className={styles.surahName} translate="no">
{surahNumberString.padStart(3, '0')}
Expand All @@ -59,7 +59,12 @@ const ChapterCard: React.FC<Props> = ({
</span>
</div>
{isContinueReading ? (
<Link href={link} variant={LinkVariant.Primary} onClick={onContinueReadingClicked}>
<Link
href={link}
variant={LinkVariant.Primary}
onClick={onContinueReadingClicked}
shouldPrefetch={false}
>
<div className={styles.continueReading}>
<span>{t('common:verse')}</span>
<span>{toLocalizedNumber(verseNumber, lang)}</span>
Expand All @@ -77,6 +82,7 @@ const ChapterCard: React.FC<Props> = ({
href={link}
onClick={onBeginClicked}
className={styles.beginButton}
shouldPrefetch={false}
>
{t('begin')}
</Button>
Expand Down
1 change: 1 addition & 0 deletions src/components/HomePage/ReadingSection/NewCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const NewCard: React.FC = () => {
className={styles.linkHref}
onClick={onTakeNotesClicked}
isNewTab
shouldPrefetch={false}
/>
),
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const NoGoalOrStreakCard = () => {
? getReadingGoalNavigationUrl()
: getLoginNavigationUrl(getReadingGoalNavigationUrl())
}
shouldPrefetch={false}
>
<div className={styles.cardOuterContainer}>
<div className={styles.cardWithIcon}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const StreakOrGoalCard: React.FC<Props> = ({ goal, streak, currentActivityDay })
className={cardStyles.streakCard}
link={goal ? getReadingGoalProgressNavigationUrl() : getReadingGoalNavigationUrl()}
onClick={goal ? onGoalArrowClicked : onStreakCardClicked}
shouldPrefetch={false}
>
<div className={cardStyles.cardOuterContainer}>
<div className={classNames(cardStyles.streakCardLeft, cardStyles.cardWithIcon)}>
Expand Down
1 change: 1 addition & 0 deletions src/components/HomePage/ReadingSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const ReadingSection: React.FC<Props> = () => {
variant={LinkVariant.Blend}
href={getProfileNavigationUrl()}
onClick={onMyQuranClicked}
shouldPrefetch={false}
>
<p className={styles.myQuranText}>{t('my-quran')}</p>
</Link>
Expand Down