-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add 4k support for screen #52
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { MosqueMetadataType } from "@/types/MosqueDataType" | ||
|
|
||
| export default function MosqueLogo({ | ||
| metadata, | ||
| }: { | ||
| metadata: MosqueMetadataType | ||
| }) { | ||
| return ( | ||
| // eslint-disable-next-line @next/next/no-img-element | ||
| <img | ||
| className="m-2 max-w-full lg:max-w-lg max-h-16 mx-auto" | ||
| src={metadata.logo_url} | ||
| alt="" | ||
| /> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,20 +7,24 @@ export default function MosqueMetadata({ | |||||||||||||||||||||||||||||||||||||||||
| }) { | ||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||
| <div className="md:flex text-mosqueBrand-onPrimary text-center md:text-left"> | ||||||||||||||||||||||||||||||||||||||||||
| <div className="mr-4 flex-shrink-0 self-center"> | ||||||||||||||||||||||||||||||||||||||||||
| <div className="mr-4 2k:mr-[1vw] flex-shrink-0 self-center"> | ||||||||||||||||||||||||||||||||||||||||||
| {/* eslint-disable-next-line @next/next/no-img-element */} | ||||||||||||||||||||||||||||||||||||||||||
| <img | ||||||||||||||||||||||||||||||||||||||||||
| className="m-2 max-w-full lg:max-w-lg max-h-16 mx-auto" | ||||||||||||||||||||||||||||||||||||||||||
| className="m-2 max-w-full lg:max-w-lg max-h-[10vh] mx-auto" | ||||||||||||||||||||||||||||||||||||||||||
| src={metadata.logo_url} | ||||||||||||||||||||||||||||||||||||||||||
| alt="" | ||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| <div> | ||||||||||||||||||||||||||||||||||||||||||
| <h2 className="mt-3 md:mt-5 font-bold text-2xl md:text-3xl"> | ||||||||||||||||||||||||||||||||||||||||||
| <div className={"flex flex-col gap-[0.7vh] "}> | ||||||||||||||||||||||||||||||||||||||||||
| <h2 className="mt-[1.2vh] font-bold text-2xl md:text-3xl 2k:text-4xl 4k:text-6xl"> | ||||||||||||||||||||||||||||||||||||||||||
| {metadata.name} | ||||||||||||||||||||||||||||||||||||||||||
| </h2> | ||||||||||||||||||||||||||||||||||||||||||
| <p className="mt-3 text-xl mx-5 md:mx-0">{metadata.address}</p> | ||||||||||||||||||||||||||||||||||||||||||
| <p className="text-xl">{metadata.website}</p> | ||||||||||||||||||||||||||||||||||||||||||
| <p className="mt-[1.2vh] text-xl leading-[2vh] 2k:text-[1.8rem] 4k:text-[2.8rem] mx-5 md:mx-0"> | ||||||||||||||||||||||||||||||||||||||||||
| {metadata.address} | ||||||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||||||
| <p className="text-xl leading-[2vh] 2k:text-[1.8rem] 4k:text-[2.8rem]"> | ||||||||||||||||||||||||||||||||||||||||||
| {metadata.website} | ||||||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Viewport-relative
Since address/website can wrap to multiple lines, this will produce overlapping/cropped text precisely on the displays this PR targets. Prefer a relative unit-less 🛠 Proposed fix- <p className="mt-[1.2vh] text-xl leading-[2vh] 2k:text-[1.8rem] 4k:text-[2.8rem] mx-5 md:mx-0">
+ <p className="mt-[1.2vh] text-xl leading-snug 2k:text-[1.8rem] 4k:text-[2.8rem] mx-5 md:mx-0">
{metadata.address}
</p>
- <p className="text-xl leading-[2vh] 2k:text-[1.8rem] 4k:text-[2.8rem]">
+ <p className="text-xl leading-snug 2k:text-[1.8rem] 4k:text-[2.8rem]">
{metadata.website}
</p>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import type { | ||
| DailyPrayerTime, | ||
| UpcomingPrayerTimes, | ||
| } from "@/types/DailyPrayerTimeType" | ||
| import { | ||
| getConfiguration, | ||
| getJummahTimes, | ||
| getMetaData, | ||
| getPrayerTimesForToday, | ||
| getPrayerTimesForTomorrow, | ||
| getPrayerTimesForUpcomingDays, | ||
| } from "@/services/MosqueDataService" | ||
| import type { JummahTimes } from "@/types/JummahTimesType" | ||
| import type { MosqueMetadataType } from "@/types/MosqueDataType" | ||
| import { ConfigurationJson } from "@/types/ConfigurationType" | ||
| import SunriseJummahTiles from "@/components/SunriseJummahTiles/SunriseJummahTiles" | ||
| import UpcomingPrayerDayTiles from "@/components/UpcomingPrayerDayTiles/UpcomingPrayerDayTiles" | ||
| import { ConfigurationProvider } from "@/providers/ConfigurationProvider" | ||
| import Clock from "@/components/Clock/Clock" | ||
| import Date from "@/components/Date/Date" | ||
| import MosqueMetadata from "@/components/MosqueMetadata/MosqueMetadata" | ||
| import Notice from "@/components/Notice/Notice" | ||
| import PrayerTimes from "@/components/PrayerTimes/PrayerTimes" | ||
| import SlidingBanner from "@/components/SlidingBanner/SlidingBanner" | ||
| import ServiceWorker from "@/components/ServiceWorker/ServiceWorker" | ||
| import Announcement from "@/components/Announcement/Announcement" | ||
| import Blackout from "@/components/Blackout/Blackout" | ||
|
|
||
|
|
||
| interface DefaultScreenProps { | ||
| config: ConfigurationJson | ||
| } | ||
|
|
||
| export default async function DefaultScreen({ config }: DefaultScreenProps) { | ||
| const today: DailyPrayerTime = await getPrayerTimesForToday() | ||
| const tomorrow: DailyPrayerTime = await getPrayerTimesForTomorrow() | ||
| const jummahTimes: JummahTimes = await getJummahTimes() | ||
| const mosqueMetadata: MosqueMetadataType = await getMetaData() | ||
| const upcomingPrayerDays: UpcomingPrayerTimes[] = | ||
| await getPrayerTimesForUpcomingDays() | ||
|
|
||
| let slides = [ | ||
| <SunriseJummahTiles | ||
| sunrise={today.sunrise_start} | ||
| jummahTimes={jummahTimes} | ||
| key={"sunrise_jummah_times"} | ||
| />, | ||
| ] | ||
|
|
||
| upcomingPrayerDays.forEach((times) => { | ||
| slides.push( | ||
| <UpcomingPrayerDayTiles times={times} key={times.display_date} />, | ||
| ) | ||
| }) | ||
|
|
||
| return ( | ||
| <div className="bg-mosqueBrand h-full w-full"> | ||
| <main className="flex h-full w-full flex-col p-4 md:p-5 2k:p-[1.5vw]"> | ||
| <div className="min-h-0 flex-1 md:grid md:grid-cols-8"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added to ensure the full screen was used, otherwise prayer table wasn't utilising the space |
||
| <div className="md:col-span-3 flex flex-col gap-4 2k:gap-[2vh]"> | ||
| <div className="p-4 md:p-6 2k:p-[1.5vh]"> | ||
| <Clock /> | ||
| </div> | ||
| <div className="p-4 md:p-6 2k:p-[1.5vh]"> | ||
| <Date /> | ||
| </div> | ||
| <div className="p-4 md:p-6 2k:p-[1.5vh]"> | ||
| <MosqueMetadata metadata={mosqueMetadata} /> | ||
| </div> | ||
| <div className="hidden md:p-6 md:block 2k:p-[1.5vh]"> | ||
| <Notice /> | ||
| </div> | ||
| </div> | ||
| <div className="p-4 md:p-6 md:col-span-5"> | ||
| <PrayerTimes today={today} tomorrow={tomorrow} /> | ||
| </div> | ||
| </div> | ||
| <div className="shrink-0 p-4 md:p-6"> | ||
| <SlidingBanner slides={slides} /> | ||
| </div> | ||
| <ServiceWorker /> | ||
| </main> | ||
| {config.feature.announcement.enabled && <Announcement />} | ||
| <Blackout prayerTimeToday={today} /> | ||
| </div> | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added to ensure the full screen was used, otherwise prayer table wasn't utilising the space