Skip to content

Commit

Permalink
implement changes to move more topics to telegram
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicarrojado committed Jun 5, 2024
1 parent a7bab9e commit 68223d0
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 44 deletions.
14 changes: 9 additions & 5 deletions app/topics/fixed-deposit-rates/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Metadata } from "next";
import Link from "next/link";
import React from "react";
import { Container } from "@/components/ui/container";
import { Button } from "@/components/ui/button";
import { Anchor } from "@/components/ui/anchor";
import Heading from "@/components/ui/heading";
import Subheading from "@/components/ui/subheading";
import Paragraph from "@/components/ui/paragraph";
import { Routes } from "@/lib/enums";
import { Routes, TelegramChannel } from "@/lib/enums";
import { META_OPEN_GRAPH, META_TWITTER } from "@/app/shared-metadata";
import { FixedDepositRatesTable } from "./fixed-deposit-rates-table";
import { TELEGRAM_SHORT_URL } from "@/lib/constants";

const title = "Fixed Deposit Rates";
const description =
Expand Down Expand Up @@ -64,9 +65,12 @@ export default function FixedDepositRates() {
topics you want to subscribe to.
</Paragraph>
<div className="mt-8 text-center">
<Button variant="secondary" asChild>
<Link href={Routes.Home}>Subscribe Now</Link>
</Button>
<Anchor
href={`${TELEGRAM_SHORT_URL}/${TelegramChannel.FixedDepositRates}`}
isExternal
>
<Button variant="secondary">Subscribe Now</Button>
</Anchor>
</div>
</Container>
);
Expand Down
15 changes: 9 additions & 6 deletions app/topics/jetstar-flights/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Metadata } from "next";
import Link from "next/link";
import React from "react";
import { Container } from "@/components/ui/container";
import { Button } from "@/components/ui/button";
import { Anchor } from "@/components/ui/anchor";
import Heading from "@/components/ui/heading";
import Subheading from "@/components/ui/subheading";
import Paragraph from "@/components/ui/paragraph";
import { FlightAirline, Routes } from "@/lib/enums";
import { FlightAirline, Routes, TelegramChannel } from "@/lib/enums";
import { META_OPEN_GRAPH, META_TWITTER } from "@/app/shared-metadata";
import { FlightsTable } from "@/components/flights-table";
import { Anchor } from "@/components/ui/anchor";
import { TELEGRAM_SHORT_URL } from "@/lib/constants";

const title = "Jetstar Flights";
const description =
Expand Down Expand Up @@ -72,9 +72,12 @@ export default function JetstarFlights() {
the topics you want to subscribe to.
</Paragraph>
<div className="mt-8 text-center">
<Button variant="secondary" asChild>
<Link href={Routes.Home}>Subscribe Now</Link>
</Button>
<Anchor
href={`${TELEGRAM_SHORT_URL}/${TelegramChannel.JetstarFlights}`}
isExternal
>
<Button variant="secondary">Subscribe Now</Button>
</Anchor>
</div>
</Container>
);
Expand Down
13 changes: 8 additions & 5 deletions app/topics/singapore-airlines-flights/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Metadata } from "next";
import Link from "next/link";
import React from "react";
import { Anchor } from "@/components/ui/anchor";
import { Container } from "@/components/ui/container";
Expand All @@ -8,8 +7,9 @@ import Heading from "@/components/ui/heading";
import Subheading from "@/components/ui/subheading";
import Paragraph from "@/components/ui/paragraph";
import { FlightsTable } from "@/components/flights-table";
import { FlightAirline, Routes } from "@/lib/enums";
import { FlightAirline, Routes, TelegramChannel } from "@/lib/enums";
import { META_OPEN_GRAPH, META_TWITTER } from "@/app/shared-metadata";
import { TELEGRAM_SHORT_URL } from "@/lib/constants";

const title = "Singapore Airlines Flights";
const description =
Expand Down Expand Up @@ -76,9 +76,12 @@ export default function SingaporeAirlinesFlights() {
as one of the topics you want to subscribe to.
</Paragraph>
<div className="mt-8 text-center">
<Button variant="secondary" asChild>
<Link href={Routes.Home}>Subscribe Now</Link>
</Button>
<Anchor
href={`${TELEGRAM_SHORT_URL}/${TelegramChannel.SingaporeAirlinesFlights}`}
isExternal
>
<Button variant="secondary">Subscribe Now</Button>
</Anchor>
</div>
</Container>
);
Expand Down
18 changes: 15 additions & 3 deletions app/topics/ssdc-appointment-slots/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ export default function SsdcAppointmentSlots() {
</Paragraph>
<Paragraph>
To get started, simply click either of the buttons below to subscribe to
the Telegram channel (for practical lesson booking) or to head over to
the email notifications subscription page (for other appointments).
the Telegram channel (for practical lesson booking or private learners)
or to head over to the email notifications subscription page (for other
appointments).
</Paragraph>
<div className="mt-8 text-center flex flex-col justify-center gap-4 sm:flex-row">
<div>
Expand All @@ -107,10 +108,21 @@ export default function SsdcAppointmentSlots() {
</div>
<div>
<Button variant="secondary" asChild>
<Link href={Routes.Home}>For Other Appointment Slots</Link>
<Anchor
href={`${TELEGRAM_SHORT_URL}/${TelegramChannel.SsdcPrivateLearners}`}
className="no-underline"
isExternal
>
For Private Learners
</Anchor>
</Button>
</div>
</div>
<div className="mt-4 text-center">
<Button variant="secondary" asChild>
<Link href={Routes.Home}>For Other Appointment Slots</Link>
</Button>
</div>
</Container>
);
}
120 changes: 95 additions & 25 deletions lib/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,19 @@ export const TELEGRAM_PUBLIC_CHANNELS: TelegramPublicChannels = [
</>
),
},
{
id: TelegramChannel.SsdcPrivateLearners,
title: "🚘 SSDC Appointment Slots (Private Learners)",
description: (
<>
Receive notifications when there are new appointment date(s) for the{" "}
<Link href={Routes.SsdcAppointmentSlots} passHref legacyBehavior>
<Anchor>Private Learners</Anchor>
</Link>{" "}
at Singapore Safety Driving Centre.
</>
),
},
{
id: TelegramChannel.JapanVisaTourism,
title: "🇯🇵 Japan Visa Appointment Slots (Tourism)",
Expand Down Expand Up @@ -274,6 +287,82 @@ export const TELEGRAM_PUBLIC_CHANNELS: TelegramPublicChannels = [
</>
),
},
{
id: TelegramChannel.SingaporeAirlinesFlights,
title: "✈️ Flight Prices (Singapore Airlines)",
description: (
<>
Receive notifications when the flight prices goes down for{" "}
<Link href={Routes.SingaporeAirlinesFlights} passHref legacyBehavior>
<Anchor>Singapore Airlines flights</Anchor>
</Link>{" "}
departing from Singapore.
</>
),
},
{
id: TelegramChannel.JetstarFlights,
title: "✈️ Flight Prices (Jetstar)",
description: (
<>
Receive notifications when the flight prices goes down for{" "}
<Link href={Routes.JetstarFlights} passHref legacyBehavior>
<Anchor>Jetstar flights</Anchor>
</Link>{" "}
departing from Singapore.
</>
),
},
{
id: TelegramChannel.FixedDepositRates,
title: "💰 Fixed Deposit Rates",
description: (
<>
Receive notifications when the{" "}
<Link href={Routes.FixedDepositRates} passHref legacyBehavior>
<Anchor>fixed deposit rates</Anchor>
</Link>{" "}
goes up across major banks in Singapore. <br />
<small>
(
{FIXED_DEPOSIT_BANKS.map(({ title, shortName, url }, index) => (
<Fragment key={title}>
{index !== 0 &&
(index === FIXED_DEPOSIT_BANKS.length - 1 ? " and " : ", ")}
{shortName || title}
</Fragment>
))}
)
</small>
</>
),
},
{
id: TelegramChannel.TripComTravelDeals,
title: "🌏 Travel Deals (Trip.com)",
description: (
<>
Receive notifications when there are new travel deals from{" "}
<Anchor href="https://sg.trip.com/sale/deals" isExternal>
Trip.com
</Anchor>
.
</>
),
},
{
id: TelegramChannel.TravelokaTravelDeals,
title: "🌏 Travel Deals (Traveloka)",
description: (
<>
Receive notifications when there are new travel deals from{" "}
<Anchor href="https://www.traveloka.com/en-sg/promotion" isExternal>
Traveloka
</Anchor>
.
</>
),
},
];

export const NOTIFICATION_SETTINGS: NotificationSettings = [
Expand Down Expand Up @@ -304,6 +393,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
at Singapore Safety Driving Centre.
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.SsdcOtherCoursesEnrolment,
Expand Down Expand Up @@ -346,31 +436,6 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
</>
),
},
{
id: SubscriptionTopic.TrainTicketsKtm,
title: "🚆 KTM Train Tickets",
description: (
<>
Receive email notifications when there are{" "}
<Link href={Routes.KtmTrainTickets} passHref legacyBehavior>
<Anchor>
<abbr title="Keretapi Tanah Melayu" className="no-underline">
KTM
</abbr>{" "}
train ticket(s)
</Anchor>
</Link>{" "}
available from Singapore (SG) to Johor Bahru (JB) and vice versa. <br />
<small>
(for SG -&gt; JB: Fridays 6:45 PM - 10:30 PM, Saturdays before 3:00 PM
only)
</small>{" "}
<br />
<small>(for JB -&gt; SG: Sundays 12:45 PM onwards only)</small>
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.JapanVisaBusiness,
title: "🇯🇵 Japan Visa Appointment Slots (Business/COE/Spouse)",
Expand Down Expand Up @@ -415,6 +480,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
</small>
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.FlightsSingaporeAirlines,
Expand All @@ -428,6 +494,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
departing from Singapore.
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.FlightsJetstar,
Expand All @@ -441,6 +508,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
departing from Singapore.
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.TravelDealsTripCom,
Expand All @@ -454,6 +522,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
.
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.TravelDealsTraveloka,
Expand All @@ -467,6 +536,7 @@ export const NOTIFICATION_SETTINGS: NotificationSettings = [
.
</>
),
hasTelegramChannel: true,
},
{
id: SubscriptionTopic.CoeBiddings,
Expand Down
6 changes: 6 additions & 0 deletions lib/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,14 @@ export enum TelegramChannel {
CdcEyesightTest = "SGAlertsCDCEyesightTest",
CdcCounterServices = "SGAlertsCDCCounterServices",
SsdcPracticalLessonBooking = "SGAlertsSSDCPracticalLessons",
SsdcPrivateLearners = "SGAlertsSSDCPrivateLearners",
JapanVisaTourism = "SGAlertsJapanVisaTourism",
KtmTrainTickets = "SGAlertsKTMTrainTickets",
SingaporeAirlinesFlights = "SGAlertsSingaporeAirlinesFlights",
JetstarFlights = "SGAlertsJetstarFlights",
FixedDepositRates = "SGAlertsFixedDepositRates",
TripComTravelDeals = "SGAlertsTripComTravelDeals",
TravelokaTravelDeals = "SGAlertsTravelokaTravelDeals",
}

export enum TelegramChannelLink {
Expand Down

0 comments on commit 68223d0

Please sign in to comment.