Skip to content

Commit

Permalink
Add post-Ramadan learning plan button (#2144)
Browse files Browse the repository at this point in the history
* Add post-Ramadan learning plans

* Sync locales

* Sync locales
  • Loading branch information
osamasayed authored Apr 21, 2024
1 parent ce56ccb commit d9d77d3
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 21 deletions.
2 changes: 1 addition & 1 deletion locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "مشغل بواسطة",
"prepare-hearts": {
"cta": "اعرف أكثر",
"title": "جاهزون لرمضان؟"
"title": "استمر بعد رمضان!"
},
"prev": "السابق",
"previous-ayah": "الآية السابقة",
Expand Down
2 changes: 1 addition & 1 deletion locales/bn/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "দ্বারা চালিত",
"prepare-hearts": {
"cta": "আরও জানুন",
"title": "রমজানের জন্য প্রস্তুত?"
"title": "রমজানের পর চালিয়ে যান!"
},
"prev": "আগে",
"previous-ayah": "আগের আয়াত",
Expand Down
2 changes: 1 addition & 1 deletion locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Powered by",
"prepare-hearts": {
"cta": "Learn more",
"title": "Ready for Ramadan?"
"title": "Keep going after Ramadan!"
},
"prev": "Previous",
"previous-ayah": "Previous Ayah",
Expand Down
2 changes: 1 addition & 1 deletion locales/fa/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "پشتیبانی شده توسط",
"prepare-hearts": {
"cta": "بیشتر بدانید",
"title": "برای ماه رمضان آماده اید؟"
"title": "پس از ماه رمضان ادامه دهید!"
},
"prev": "قبلی",
"previous-ayah": "آیه قبلی",
Expand Down
2 changes: 1 addition & 1 deletion locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Alimenté par",
"prepare-hearts": {
"cta": "Apprendre encore plus",
"title": "Prêt pour le Ramadan ?"
"title": "Continuez après le Ramadan !"
},
"prev": "Précédent",
"previous-ayah": "Ayah précédent",
Expand Down
2 changes: 1 addition & 1 deletion locales/id/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Dipersembahkan oleh",
"prepare-hearts": {
"cta": "Belajarlah lagi",
"title": "Siap menyambut Ramadhan?"
"title": "Lanjutkan setelah Ramadhan!"
},
"prev": "Sebelumnya",
"previous-ayah": "Ayat sebelumnya",
Expand Down
2 changes: 1 addition & 1 deletion locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Offerto da",
"prepare-hearts": {
"cta": "Saperne di più",
"title": "Pronti per il Ramadan?"
"title": "Continuate così dopo il Ramadan!"
},
"prev": "Precedente",
"previous-ayah": "Precedente Sì",
Expand Down
2 changes: 1 addition & 1 deletion locales/ms/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Dikuasai oleh",
"prepare-hearts": {
"cta": "Ketahui lebih lanjut",
"title": "Bersedia untuk Ramadan?"
"title": "Teruskan selepas Ramadhan!"
},
"prev": "Sebelumnya",
"previous-ayah": "Ayah sebelumnya",
Expand Down
2 changes: 1 addition & 1 deletion locales/nl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Aangedreven door",
"prepare-hearts": {
"cta": "Kom meer te weten",
"title": "Klaar voor de Ramadan?"
"title": "Ga door na de Ramadan!"
},
"prev": "Vorig",
"previous-ayah": "Vorige Aya",
Expand Down
2 changes: 1 addition & 1 deletion locales/pt/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Distribuído por",
"prepare-hearts": {
"cta": "Saber mais",
"title": "Pronto para o Ramadã?"
"title": "Continue depois do Ramadã!"
},
"prev": "Anterior",
"previous-ayah": "Anterior Ayah",
Expand Down
2 changes: 1 addition & 1 deletion locales/ru/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Питаться от",
"prepare-hearts": {
"cta": "Узнать больше",
"title": "Готовы к Рамадану?"
"title": "Продолжайте идти после Рамадана!"
},
"prev": "Предыдущий",
"previous-ayah": "Предыдущий аят",
Expand Down
2 changes: 1 addition & 1 deletion locales/sq/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Mundësuar nga",
"prepare-hearts": {
"cta": "Mëso më shumë",
"title": "Gati për Ramazan?"
"title": "Vazhdoni pas Ramazanit!"
},
"prev": "E mëparshme",
"previous-ayah": "Ajeti i mëparshëm",
Expand Down
2 changes: 1 addition & 1 deletion locales/th/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "ขับเคลื่อนโดย",
"prepare-hearts": {
"cta": "เรียนรู้เพิ่มเติม",
"title": "พร้อมสำหรับเดือนรอมฎอนหรือยัง?"
"title": "ลุยต่อหลังรอมฎอน!"
},
"prev": "ก่อนหน้า",
"previous-ayah": "อายะห์ก่อนหน้า",
Expand Down
2 changes: 1 addition & 1 deletion locales/tr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Tarafından desteklenmektedir",
"prepare-hearts": {
"cta": "Daha fazla bilgi edin",
"title": "Ramazan'a hazır mıyız?"
"title": "Ramazandan sonra devam!"
},
"prev": "Önceki",
"previous-ayah": "Önceki Ayet",
Expand Down
2 changes: 1 addition & 1 deletion locales/ur/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "کی طرف سے طاقت",
"prepare-hearts": {
"cta": "اورجانیے",
"title": "رمضان کے لیے تیار ہیں؟"
"title": "رمضان کے بعد چلتے رہو!"
},
"prev": "پچھلا",
"previous-ayah": "پچھلی آیت",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"powered-by": "Powered by",
"prepare-hearts": {
"cta": "了解更多",
"title": "准备好迎接斋月了吗?"
"title": "斋月之后继续努力!"
},
"prev": "以前的",
"previous-ayah": "上一节文",
Expand Down
5 changes: 1 addition & 4 deletions src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux';

import styles from './Banner.module.scss';

import MoonIllustrationSVG from '@/public/images/moon-illustration.svg';
// import MoonIllustrationSVG from '@/public/images/moon-illustration.svg';
import { selectIsBannerVisible } from '@/redux/slices/banner';

type BannerProps = {
Expand All @@ -21,9 +21,6 @@ const Banner = ({ text, ctaButton }: BannerProps) => {
})}
>
<div className={styles.description}>
<div className={styles.illustrationContainer}>
<MoonIllustrationSVG />
</div>
<div className={styles.text}>{text}</div>
</div>
{ctaButton && <div className={styles.ctaContainer}>{ctaButton}</div>}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Course/Buttons/NavbarButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Button, { ButtonSize, ButtonType } from '@/dls/Button/Button';
import { logButtonClick } from '@/utils/eventLogger';
import { getCourseNavigationUrl } from '@/utils/navigation';

const LEARNING_PLAN_SLUG = 'preparing-our-hearts-for-ramadan';
const LEARNING_PLAN_SLUG = 'avoiding-the-post-ramadan-slump';

const NavbarButton = () => {
const { t } = useTranslation('common');
Expand Down
5 changes: 5 additions & 0 deletions src/components/Navbar/Navbar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
.hiddenNav {
// https://ptgamr.github.io/2014-09-13-translate3d-vs-translate-performance/
transform: translate3d(0, calc(-1 * var(--navbar-container-height)), 0);

// TODO: remove this when banner is removed
@include breakpoints.smallerThanTablet {
transform: translate3d(0, calc(-1 * (var(--navbar-container-height) + var(--banner-height))), 0);
}
}
5 changes: 5 additions & 0 deletions src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import React from 'react';

import classNames from 'classnames';
import useTranslation from 'next-translate/useTranslation';
import { useSelector, shallowEqual } from 'react-redux';

import styles from './Navbar.module.scss';
import NavbarBody from './NavbarBody';

import Banner from '@/components/Banner/Banner';
import LearningPlanButton from '@/components/Course/Buttons/NavbarButton';
import { useOnboarding } from '@/components/Onboarding/OnboardingProvider';
import { selectNavbar } from '@/redux/slices/navbar';

const Navbar = () => {
const { t } = useTranslation('common');
const { isActive } = useOnboarding();
const { isVisible: isNavbarVisible } = useSelector(selectNavbar, shallowEqual);
const showNavbar = isNavbarVisible || isActive;
Expand All @@ -18,6 +22,7 @@ const Navbar = () => {
<>
<div className={styles.emptySpacePlaceholder} />
<nav className={classNames(styles.container, { [styles.hiddenNav]: !showNavbar })}>
<Banner text={t('prepare-hearts.title')} ctaButton={<LearningPlanButton />} />
<NavbarBody />
</nav>
</>
Expand Down
4 changes: 4 additions & 0 deletions src/components/PageContainer/PageContainer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
margin-inline-start: auto;
margin-inline-end: auto;

@include breakpoints.smallerThanTablet {
margin-block-start: var(--spacing-mega);
}

--flow-side-spacing: var(--spacing-small);
padding-inline-start: var(--flow-side-spacing);
padding-inline-end: var(--flow-side-spacing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@

.spaceOnTop {
padding-block-start: calc(3.5 * var(--spacing-mega));
@include breakpoints.smallerThanTablet {
padding-block-start: calc(4.5 * var(--spacing-mega));
}
@include breakpoints.tablet {
padding-block-start: calc(3.5 * var(--spacing-mega));
}
}

.chapterNumber {
Expand Down
6 changes: 6 additions & 0 deletions src/pages/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
$list-max-width: 80rem;

.pageContainer {
@include breakpoints.smallerThanTablet {
padding-block-start: var(--banner-height);
}
@include breakpoints.tablet {
padding-block-start: var(--spacing-small);
}
padding-block-end: var(--spacing-small);
padding-inline-start: 0;
padding-inline-end: 0;
Expand Down

0 comments on commit d9d77d3

Please sign in to comment.