Skip to content

Commit

Permalink
Merge pull request #789 from haqq-network/dev
Browse files Browse the repository at this point in the history
release
  • Loading branch information
olegshilov authored Apr 25, 2024
2 parents bad0369 + a52f2f4 commit 5d77b2a
Show file tree
Hide file tree
Showing 62 changed files with 676 additions and 182 deletions.
22 changes: 22 additions & 0 deletions apps/haqq-website/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@ export default function RootLayout({ children }: PropsWithChildren) {
`,
}}
/>
<Script
async={true}
defer={true}
id="gtm"
data-cookiecategory="analytics"
dangerouslySetInnerHTML={{
__html: `
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KKHPL8SG');
`,
}}
/>
<Script
async={true}
src="https://www.googletagmanager.com/ns.html?id=GTM-KKHPL8SG"
id="gtm-haqq"
data-cookiecategory="analytics"
/>

<SpeedInsights />
</>
)}
Expand Down
21 changes: 21 additions & 0 deletions apps/islamic-website/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,21 @@ export default async function LocaleLayout({
`,
}}
/>
<Script
async={true}
defer={true}
id="gtm-2"
data-cookiecategory="analytics"
dangerouslySetInnerHTML={{
__html: `
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WMP75MQS');
`,
}}
/>
<Script
async={true}
src="https://www.googletagmanager.com/gtag/js?id=G-5FLBNV5M30"
Expand All @@ -195,6 +210,12 @@ export default async function LocaleLayout({
`,
}}
/>
<Script
async={true}
src="https://www.googletagmanager.com/ns.html?id=GTM-WMP75MQS"
id="gtm-haqq-3"
data-cookiecategory="analytics"
/>

<CookieConsentModal />
<SpeedInsights />
Expand Down
3 changes: 3 additions & 0 deletions apps/islamic-website/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IndexPage } from '@haqq/islamic-website/index-page';
import { DEPLOY_URL } from '../../constants';
import { getChainStatsFromFalconer } from '../../utils/get-chain-stats-data';
import { getHomePageDataFromFalconer } from '../../utils/get-home-page-data';
import { getWalletRatings } from '../../utils/get-wallet-ratings';
import { islamicOpenGraphImages } from '../shared-metadata';

const title = 'IslamicCoin';
Expand Down Expand Up @@ -30,6 +31,7 @@ export default async function Page({
const stats = await getChainStatsFromFalconer();
const { news, advisoryMembers, executiveMembers, shariahMembers } =
await getHomePageDataFromFalconer(locale);
const storeRatings = await getWalletRatings();

return (
<IndexPage
Expand All @@ -38,6 +40,7 @@ export default async function Page({
advisoryMembers={advisoryMembers}
executiveMembers={executiveMembers}
shariahMembers={shariahMembers}
storeRatings={storeRatings}
/>
);
}
8 changes: 7 additions & 1 deletion apps/islamic-website/app/[locale]/wallet/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Metadata } from 'next';
import { WalletPage as WalletPageComponent } from '@haqq/islamic-website/wallet-page';
import { DEPLOY_URL } from '../../../constants';
import { getWalletRatings } from '../../../utils/get-wallet-ratings';
import { islamicOpenGraphImages } from '../../shared-metadata';

const title = 'Wallet';
Expand All @@ -17,4 +19,8 @@ export const metadata: Metadata = {
},
};

export { WalletPage as default } from '@haqq/islamic-website/wallet-page';
export default async function WalletPage() {
const storeRatings = await getWalletRatings();

return <WalletPageComponent storeRatings={storeRatings} />;
}
23 changes: 23 additions & 0 deletions apps/islamic-website/app/api/wallet-store-rates/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import store from 'app-store-scraper';
import gplay from 'google-play-scraper';
import { NextRequest, NextResponse } from 'next/server';

export async function GET(request: NextRequest) {
const [appStoreResponse, googlePlayResponse] = await Promise.all([
store.app({ id: 6443843352 }),
gplay.app({ appId: 'com.haqq.wallet' }),
]);

return NextResponse.json<{
appStore: number;
googlePlay: number;
}>(
{
appStore: appStoreResponse.score,
googlePlay: googlePlayResponse.score,
},
{
status: 200,
},
);
}
15 changes: 9 additions & 6 deletions apps/islamic-website/constants.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
export const DEPLOY_URL = process.env['VERCEL_URL']
? `https://${process.env['VERCEL_URL']}`
: process.env['NEXT_PUBLIC_VERCEL_URL']
? `https://${process.env['NEXT_PUBLIC_VERCEL_URL']}`
: 'http://localhost:4200';
export const VERCEL_ENV = process.env['VERCEL_ENV'];
export const SITE_URL = 'https://islamiccoin.net';
export const DEPLOY_URL =
VERCEL_ENV === 'production'
? SITE_URL
: process.env['VERCEL_URL']
? `https://${process.env['VERCEL_URL']}`
: process.env['NEXT_PUBLIC_VERCEL_URL']
? `https://${process.env['NEXT_PUBLIC_VERCEL_URL']}`
: 'http://localhost:4200';
export const REVALIDATE_TIME = 300;
export const FALCONER_ENDPOINT = process.env['FALCONER_ENDPOINT'];
export const TURNSTILE_SITEKEY = process.env['TURNSTILE_SITEKEY'];
export const SUPPORTED_LOCALES: Readonly<string[]> = [
'en',
// , 'ar', 'id'
];
export const SITE_URL = 'https://islamiccoin.net';
export const BLOCKED_COUNTRY = 'AE';
1 change: 1 addition & 0 deletions apps/islamic-website/libs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'app-store-scraper';
8 changes: 6 additions & 2 deletions apps/islamic-website/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,12 @@
},
"subtitle": "محفظة غير احتجازية أساسها القيم الأخلاقية",
"text": "استكشف عالم الويب 3 من خلال محفظة حق، الشريك الأمثل لسبر آفاق التمويل اللامركزي. تقدم لك محفظة حق بمستوى أمانها العالي واستخدامها السلس والسهل تجربة استثنائية تتميز بالسهولة والأمان في إدارة الأصول الرقمية المتوافقة مع الشريعة",
"download-button": {
"title": "متوفر في"
"stores": {
"app-store": "تقييم آب ستور",
"google-play": "تقييم غوغل بلاي",
"download-button": {
"title": "متوفر في"
}
}
},
"scam-alert-page": {
Expand Down
8 changes: 6 additions & 2 deletions apps/islamic-website/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,12 @@
},
"subtitle": "Ethics-First, Non-Custodial Wallet",
"text": "Seamlessly navigate Web3 with HAQQ Wallet, your trusted partner for a principled DeFi journey. With mnemonicless security and a user-friendly interface, managing your digital Shariah-compliant assets has never been easier or more secure",
"download-button": {
"title": "Available in"
"stores": {
"app-store": "App store rating",
"google-play": "Google play rating",
"download-button": {
"title": "Available in"
}
}
},
"scam-alert-page": {
Expand Down
8 changes: 6 additions & 2 deletions apps/islamic-website/messages/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,12 @@
},
"subtitle": "Etika-Pertama, Dompet Non-Custodial",
"text": "Navigasi Web3 dengan lancar menggunakan HAQQ Wallet, mitra tepercaya kamu untuk perjalanan DeFi yang berprinsip. Dengan keamanan tanpa mnemonik dan antarmuka yang mudah digunakan, mengelola aset digital kamu yang sesuai dengan syariah tidak pernah semudah atau seaman ini",
"download-button": {
"title": "Tersedia di"
"stores": {
"app-store": "Peringkat App store",
"google-play": "Peringkat Google play",
"download-button": {
"title": "Tersedia di"
}
}
},
"scam-alert-page": {
Expand Down
22 changes: 22 additions & 0 deletions apps/islamic-website/utils/get-wallet-ratings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { cache } from 'react';
import { DEPLOY_URL, REVALIDATE_TIME } from '../constants';

export const revalidate = REVALIDATE_TIME;

export interface WalletStoreRatings {
appStore: number;
googlePlay: number;
}

export const getWalletRatings = cache(async () => {
const ratesEndpoint = new URL('/api/wallet-store-rates', DEPLOY_URL);
const response = await fetch(ratesEndpoint, {
next: {
revalidate,
},
});

const data: WalletStoreRatings = await response.json();

return data;
});
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function AcademyPage() {
<div className="md:max-w-[880px]">
<div className="text-[46px] font-[600] leading-[52px] md:text-[60px] md:leading-none lg:text-[80px]">
Embark on a journey of learning through our&nbsp;
<span className="text-shadow-outline rtl:font-handjet ltr:font-vcr align-[-2px] uppercase md:align-[-4px]">
<span className="text-shadow-outline rtl:font-handjet font-vcr align-[-2px] uppercase md:align-[-4px]">
Academy
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function AvailableSoonPage() {
<section className="relative">
<Container>
<div className="flex flex-col items-center justify-center pb-[293px] pt-[273px] md:py-[305px] lg:py-[356px]">
<div className="rtl:font-handjet ltr:font-vcr text-[17px] uppercase leading-[26px] md:text-[18px] lg:text-[20px] lg:leading-[28px]">
<div className="rtl:font-handjet font-vcr text-[17px] uppercase leading-[26px] md:text-[18px] lg:text-[20px] lg:leading-[28px]">
{t('title')}
</div>
<Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function FraudAlertPage() {
</div>
<div className="mt-[32px] flex flex-col items-center md:mt-[44px] md:flex-row md:items-start lg:mt-[60px]">
<div className="flex flex-col gap-y-[16px] md:max-w-[60%] md:gap-y-[20px] lg:gap-y-[24px]">
<h2 className="rtl:font-handjet ltr:font-vcr text-[18px] uppercase leading-[26px] md:text-[22px] md:leading-[32px] lg:text-[24px] lg:leading-[34px]">
<h2 className="rtl:font-handjet font-vcr text-[18px] uppercase leading-[26px] md:text-[22px] md:leading-[32px] lg:text-[24px] lg:leading-[34px]">
{t('how-to-block.title')}
</h2>

Expand Down Expand Up @@ -93,7 +93,7 @@ export function FraudAlertPage() {
alt=""
className={clsx(
'pointer-events-none z-[-1] select-none md:absolute md:top-[435px] md:translate-y-[-50%]',
'ltr:md:right-[-385px] ltr:md:translate-x-[-50%] ltr:lg:right-[-295px] ltr:xl:right-[-265px]',
'md:right-[-385px] md:translate-x-[-50%] lg:right-[-295px] xl:right-[-265px]',
'rtl:md:left-[-385px] rtl:md:translate-x-[50%] rtl:lg:left-[-295px] rtl:xl:left-[-265px]',
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function ScamAlertPage() {
height={764}
alt=""
className={clsx(
'pointer-events-none select-none md:absolute md:top-[350px] md:translate-x-[-50%] md:translate-y-[-50%] ltr:md:right-[-385px] ltr:lg:right-[-295px] ltr:xl:right-[-265px]',
'pointer-events-none select-none md:absolute md:right-[-385px] md:top-[350px] md:translate-x-[-50%] md:translate-y-[-50%] lg:right-[-295px] xl:right-[-265px]',
'rtl:md:left-[-385px] rtl:md:translate-x-[50%] rtl:lg:left-[-295px] rtl:xl:left-[-265px]',
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function RecentPostsBlock({ recentPosts }: { recentPosts: Post[] }) {
<div className="w-full overflow-clip px-[16px] md:px-[48px] xl:px-[80px]">
<div className="mx-auto max-w-4xl xl:max-w-5xl">
<div className="mb-[28px] lg:mb-[32px]">
<h2 className="ltr:font-vcr rtl:font-handjet text-[17px] uppercase leading-[26px] md:text-[18px] lg:text-[20px] lg:leading-[28px]">
<h2 className="font-vcr rtl:font-handjet text-[17px] uppercase leading-[26px] md:text-[18px] lg:text-[20px] lg:leading-[28px]">
Related articles
</h2>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function BuildPage() {
{t('title')}
</h1>
<div className="mt-[32px] flex flex-col gap-y-[16px] md:mt-[60px] md:max-w-[480px] md:gap-y-[24px] lg:max-w-[600px]">
<h3 className="rtl:font-handjet ltr:font-vcr text-[18px] uppercase leading-[26px] md:text-[24px] md:leading-[34px]">
<h3 className="rtl:font-handjet font-vcr text-[18px] uppercase leading-[26px] md:text-[24px] md:leading-[34px]">
{t('subtitle')}
</h3>
<div className="flex flex-col gap-y-[12px] md:gap-y-[16px]">
Expand Down Expand Up @@ -56,7 +56,7 @@ export function BuildPage() {

function BuildPageBg() {
return (
<div className="absolute top-[-150px] z-[-1] h-[550px] w-[655px] md:top-[100px] xl:top-[100px] min-[1440px]:top-[110px] ltr:left-[40px] ltr:md:left-auto ltr:md:right-[-180px] ltr:xl:right-[-90px] ltr:min-[1440px]:right-[30px] rtl:right-[40px] rtl:scale-x-[-1] rtl:transform rtl:md:left-[-180px] rtl:md:right-auto rtl:xl:left-[-90px] rtl:min-[1440px]:left-[30px]">
<div className="absolute left-[40px] top-[-150px] z-[-1] h-[550px] w-[655px] md:left-auto md:right-[-180px] md:top-[100px] xl:right-[-90px] xl:top-[100px] min-[1440px]:right-[30px] min-[1440px]:top-[110px] rtl:right-[40px] rtl:scale-x-[-1] rtl:transform rtl:md:left-[-180px] rtl:md:right-auto rtl:xl:left-[-90px] rtl:min-[1440px]:left-[30px]">
<Image src={buildBgImgData} alt="" fill />
</div>
);
Expand Down Expand Up @@ -120,7 +120,7 @@ function DocsTab({ type }: { type: 'manual' | 'archive' }) {
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="mb-[-1px] transform-gpu transition-transform duration-300 ltr:group-hover:translate-x-[4px] rtl:rotate-180 rtl:group-hover:translate-x-[-4px]"
className="mb-[-1px] transform-gpu transition-transform duration-300 group-hover:translate-x-[4px] rtl:rotate-180 rtl:group-hover:translate-x-[-4px]"
>
<path
fillRule="evenodd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export function CareerPage() {
<div
className={clsx(
'absolute z-[-1]',
'top-[-50px] h-[447px] w-[444px] ltr:right-[-222px] rtl:left-[-222px] rtl:rotate-180 rtl:transform',
'md:top-[-80px] md:h-[720px] md:w-[724px] ltr:md:right-[-200px] rtl:md:left-[-200px]',
'lg:top-[-220px] lg:h-[1000px] lg:w-[1000px] ltr:lg:right-[-340px] rtl:lg:left-[-340px] rtl:lg:rotate-90',
'right-[-222px] top-[-50px] h-[447px] w-[444px] rtl:left-[-222px] rtl:rotate-180 rtl:transform',
'md:right-[-200px] md:top-[-80px] md:h-[720px] md:w-[724px] rtl:md:left-[-200px]',
'lg:right-[-340px] lg:top-[-220px] lg:h-[1000px] lg:w-[1000px] rtl:lg:left-[-340px] rtl:lg:rotate-90',
'opacity-70 md:opacity-100',
)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ export function CommunityHubPage({
</div>
<div
className={clsx(
'absolute z-[-1] translate-y-1/2 ltr:translate-x-1/2 rtl:-translate-x-1/2',
'top-[-435px] ltr:right-[-75px] rtl:left-[-75px]',
'md:top-[-535px] ltr:md:right-[110px] rtl:md:left-[110px]',
'lg:top-[-580px] ltr:lg:right-[175px] rtl:lg:left-[175px]',
'rtl:lx:left-[145px] ltr:xl:right-[145px]',
'min-[1440px]:top-[-585px] ltr:min-[1440px]:right-[275px] rtl:min-[1440px]:left-[275px]',
'absolute z-[-1] translate-x-1/2 translate-y-1/2 rtl:-translate-x-1/2',
'right-[-75px] top-[-435px] rtl:left-[-75px]',
'md:right-[110px] md:top-[-535px] rtl:md:left-[110px]',
'lg:right-[175px] lg:top-[-580px] rtl:lg:left-[175px]',
'rtl:lx:left-[145px] xl:right-[145px]',
'min-[1440px]:right-[275px] min-[1440px]:top-[-585px] rtl:min-[1440px]:left-[275px]',
)}
>
<div className="h-[741px] w-[1044px]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export function SubscribeForm({
/>

<div className="flex flex-col items-center gap-[16px] px-[40px] py-[32px] lg:gap-[32px] lg:px-[80px] lg:py-[60px]">
<h3 className="rtl:font-handjet ltr:font-vcr text-[18px] uppercase leading-[26px] md:text-[22px] md:leading-[32px] lg:text-[24px] lg:leading-[34px]">
<h3 className="rtl:font-handjet font-vcr text-[18px] uppercase leading-[26px] md:text-[22px] md:leading-[32px] lg:text-[24px] lg:leading-[34px]">
Congratulations!
</h3>

Expand All @@ -235,7 +235,7 @@ export function SubscribeForm({
/>

<div className="flex flex-col items-center gap-[16px] px-[40px] py-[32px] lg:gap-[32px] lg:px-[80px] lg:py-[60px]">
<h3 className="rtl:font-handjet ltr:font-vcr text-[18px] uppercase leading-[26px] md:text-[22px] md:leading-[32px] lg:text-[24px] lg:leading-[34px]">
<h3 className="rtl:font-handjet font-vcr text-[18px] uppercase leading-[26px] md:text-[22px] md:leading-[32px] lg:text-[24px] lg:leading-[34px]">
Something went wrong!
</h3>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export function HeroBlock() {
</Text>
</div>

<div className="ltr:font-vcr rtl:font-handjet mt-[18px] w-fit rounded-lg border border-[#2f2f2f] px-[18px] py-[8px] text-center text-[15px] uppercase leading-[22px] md:text-base lg:text-[18px] lg:leading-[26px]">
<div className="font-vcr rtl:font-handjet mt-[18px] w-fit rounded-lg border border-[#2f2f2f] px-[18px] py-[8px] text-center text-[15px] uppercase leading-[22px] md:text-base lg:text-[18px] lg:leading-[26px]">
<span>{t('hero-block.disclaimer.before-flag')}</span>{' '}
<span role="img" aria-label="UAE">
🇦🇪
</span>{' '}
<span>{t('hero-block.disclaimer.after-flag')}</span>
<Link
href="/dubai-residents-disclaimer"
className="text-islamic-primary-green hover:text-islamic-primary-green-hover w-fit transition-colors duration-300 ltr:ml-[18px] rtl:mr-[18px]"
className="text-islamic-primary-green hover:text-islamic-primary-green-hover ml-[18px] w-fit transition-colors duration-300 rtl:mr-[18px]"
>
{t('hero-block.disclaimer.read-more')}
</Link>
Expand Down
Loading

0 comments on commit 5d77b2a

Please sign in to comment.