From 67049cd37faf0f7ff39b3f28bc061fcb5f0510c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Berente?= <30603208+berenteb@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:55:26 +0100 Subject: [PATCH 1/4] feat: map content and improvements --- app/(tabs)/map.tsx | 14 +- components/map/map.tsx | 248 +++++++++++++-------------- components/map/resource-sheet.tsx | 4 +- content/map-resources-en.content.ts | 174 ------------------- content/map-resources-hu.content.ts | 174 ------------------- content/map-resources.content.ts | 252 ++++++++++++++++++++++++++++ types/map.type.ts | 5 +- 7 files changed, 392 insertions(+), 479 deletions(-) delete mode 100644 content/map-resources-en.content.ts delete mode 100644 content/map-resources-hu.content.ts create mode 100644 content/map-resources.content.ts diff --git a/app/(tabs)/map.tsx b/app/(tabs)/map.tsx index 02345c4..994470c 100644 --- a/app/(tabs)/map.tsx +++ b/app/(tabs)/map.tsx @@ -7,8 +7,7 @@ import { Header } from '../../components/common/header'; import { Title } from '../../components/common/title'; import { Map } from '../../components/map/map'; import { ResourceSheet } from '../../components/map/resource-sheet'; -import { MapResources_en } from '../../content/map-resources-en.content'; -import { MapResources_hu } from '../../content/map-resources-hu.content'; +import { MapResources_hu } from '../../content/map-resources.content'; import { MapResource } from '../../types/map.type'; export default function MapPage() { @@ -16,8 +15,7 @@ export default function MapPage() { const [selectedResource, setSelectedResource] = useState(); const onSelectedResource = (id: string) => { - const localizedResource = t('map.key') === 'hu' ? MapResources_hu : MapResources_en; - const res = localizedResource.find((r) => r.id === id); + const res = MapResources_hu.find((r) => r.id === id); setSelectedResource(res); }; @@ -26,7 +24,13 @@ export default function MapPage() {
{t('tabbar.map')}
- + diff --git a/components/map/map.tsx b/components/map/map.tsx index 76a4e19..f391cef 100644 --- a/components/map/map.tsx +++ b/components/map/map.tsx @@ -19,6 +19,7 @@ export function Map({ onSelectedResource, selectedResource }: MapProps) { stroke={extendedColors.slate['500']} strokeWidth={7} strokeLinejoin='round' + onPress={() => onSelectedResource('BDG')} /> - - - - - + + + + + + + + + ); diff --git a/components/map/resource-sheet.tsx b/components/map/resource-sheet.tsx index 95582a6..bd7a831 100644 --- a/components/map/resource-sheet.tsx +++ b/components/map/resource-sheet.tsx @@ -30,11 +30,11 @@ export function ResourceSheet({ resource, className, ...props }: ResourceSheetPr outputRange: [0, 400], }), }} - className={cn('bg-white -mt-10 dark:bg-slate-800 pb-40 rounded-t-2xl px-5 pt-5 space-y-2', className)} + className={cn('bg-white -mt-10 dark:bg-slate-800 pb-32 rounded-t-2xl px-5 pt-5 space-y-2', className)} {...props} > {savedResource?.title} - {savedResource?.description} + {savedResource?.description.hu} ); } diff --git a/content/map-resources-en.content.ts b/content/map-resources-en.content.ts deleted file mode 100644 index 325b042..0000000 --- a/content/map-resources-en.content.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { MapResource } from '../types/map.type'; - -export const MapResources_en: MapResource[] = [ - { - id: 'DOOR', - title: 'Entrance', - description: '', - }, - { - id: 'COFFEE', - title: 'Chill corner', - description: 'Relax with a cup of coffee in hand!', - }, - { - id: 'IB028', - title: 'IB028 Lecture Hall', - description: '', - }, - { - id: 'IB025', - title: 'IB025 Lecture Hall', - description: '', - }, - { - id: 'VIP', - title: 'VIP', - description: '', - }, - { - id: 'ORG', - title: 'Organizers', - description: '', - }, - { - id: 'K1', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K4', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K5', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K2', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K3', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'T5', - title: 'Department', - description: 'This is a department.', - }, - { - id: 'T4', - title: 'Department', - description: 'This is a department.', - }, - { - id: 'T3', - title: 'Department', - description: 'This is a department.', - }, - { - id: 'T2', - title: 'Department', - description: 'This is a department.', - }, - { - id: 'T1', - title: 'Department', - description: 'This is a department.', - }, - { - id: 'C9', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C8', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C7', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C6', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C5', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C4', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C3', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C12', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C13', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C14', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C15', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C10', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C11', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C2', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'C1', - title: 'Company', - description: 'This is a Company.', - }, - { - id: 'WC', - title: 'Toilet', - description: '', - }, - { - id: 'WC_2', - title: 'Toilet', - description: '', - }, - { - id: 'WC_3', - title: 'Toilet', - description: '', - }, -]; diff --git a/content/map-resources-hu.content.ts b/content/map-resources-hu.content.ts deleted file mode 100644 index 02b57f6..0000000 --- a/content/map-resources-hu.content.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { MapResource } from '../types/map.type'; - -export const MapResources_hu: MapResource[] = [ - { - id: 'DOOR', - title: 'Bejárat', - description: '', - }, - { - id: 'COFFEE', - title: 'Chill sarok', - description: 'Kapcsolódj ki egy kávé mellett!', - }, - { - id: 'IB028', - title: 'IB028-as előadó', - description: '', - }, - { - id: 'IB025', - title: 'IB025-ös előadó', - description: '', - }, - { - id: 'VIP', - title: 'VIP', - description: '', - }, - { - id: 'ORG', - title: 'Rendezők', - description: '', - }, - { - id: 'K1', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K4', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K5', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K2', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'K3', - title: 'Kör', - description: 'Ez itt egy szakmai kör.', - }, - { - id: 'T5', - title: 'Tanszék', - description: 'Ez egy tanszék.', - }, - { - id: 'T4', - title: 'Tanszék', - description: 'Ez egy tanszék.', - }, - { - id: 'T3', - title: 'Tanszék', - description: 'Ez egy tanszék.', - }, - { - id: 'T2', - title: 'Tanszék', - description: 'Ez egy tanszék.', - }, - { - id: 'T1', - title: 'Tanszék', - description: 'Ez egy tanszék.', - }, - { - id: 'C9', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C8', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C7', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C6', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C5', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C4', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C3', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C12', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C13', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C14', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C15', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C10', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C11', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C2', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'C1', - title: 'Cég', - description: 'Ez egy cég.', - }, - { - id: 'WC', - title: 'Mosdó', - description: '', - }, - { - id: 'WC_2', - title: 'Mosdó', - description: '', - }, - { - id: 'WC_3', - title: 'Mosdó', - description: '', - }, -]; diff --git a/content/map-resources.content.ts b/content/map-resources.content.ts new file mode 100644 index 0000000..f8b007b --- /dev/null +++ b/content/map-resources.content.ts @@ -0,0 +1,252 @@ +import { MapResource } from '../types/map.type'; + +export const MapResources_hu: MapResource[] = [ + { + id: 'DOOR', + title: 'Bejárat', + description: { + hu: 'Itt jössz be!', + en: 'This is the entrance!', + }, + }, + { + id: 'COFFEE', + title: 'Chill sarok', + description: { + hu: 'Kapcsolódj ki egy kávé mellett!', + en: 'Relax with a coffee!', + }, + }, + { + id: 'COAT', + title: 'Ruhatár', + description: { + hu: 'Itt hagyhatod a kabátod!', + en: 'You can leave your coat here!', + }, + }, + { + id: 'REGISTRATION', + title: 'Regisztráció', + description: { + hu: 'Itt indul minden!', + en: 'This is where everything starts!', + }, + }, + { + id: 'IB028', + title: 'IB028-as előadó', + description: { + hu: 'A legnagyobb előadóterem!', + en: 'The biggest lecture hall!', + }, + }, + { + id: 'IB025', + title: 'IB025-ös előadó', + description: { + hu: 'Egy kisebb előadóterem!', + en: 'A smaller lecture hall!', + }, + }, + { + id: 'VIP', + title: 'VIP', + description: { + hu: 'Különleges vendégeinknek!', + en: 'For our special guests!', + }, + }, + { + id: 'ORG', + title: 'Rendezők', + description: { + hu: 'Itt találod a rendezőket!', + en: 'You can find the organizers here!', + }, + }, + { + id: '25', + title: 'LEGO', + description: { + hu: 'A LEGO kör a Simonyi robotikával fogallkozó köre.', + en: 'The LEGO community dealing with robotics in Simonyi.', + }, + }, + { + id: '24', + title: 'HA5KFU', + description: { + hu: 'Rádióamatőr klub.', + en: 'Radio amateur club.', + }, + }, + { + id: '23', + title: 'SEM', + description: { + hu: 'A Schönherz elektronikai műhelye.', + en: 'The electronics workshop of Schönherz.', + }, + }, + { + id: '22', + title: 'Kir-Dev', + description: { + hu: 'A kollégium webfejlesztő köre.', + en: 'The web developer community of the dormitory.', + }, + }, + { + id: '21', + title: 'schdesign', + description: { + hu: 'A Simonyi kreatív alkotóműhelye.', + en: 'The creative community of Simonyi.', + }, + }, + { + id: '20', + title: 'BME Formula Racing Team', + description: { + hu: 'Technológiailag fejlett autók építése.', + en: 'Building technologically advanced cars.', + }, + }, + { + id: '19', + title: 'Paripa', + description: { + hu: 'Partnerség az iparral program.', + en: 'Partnership with industry program.', + }, + }, + { + id: '18', + title: 'BME Suborbitals', + description: { + hu: 'Kísérleti rakéták fejlesztése versenyre és oktatási célokra.', + en: 'Developing research rockets for competition and educational purposes', + }, + }, + { + id: '12', + title: 'Knorr-Bremse Fékrendszerek Kft.', + description: { + hu: 'A mobilitás biztonságossá tétele.', + en: 'Making mobility safer.', + }, + }, + { + id: '11', + title: 'Barré Technologies Zrt.', + description: { + hu: 'Nagyvállalati megoldásokra szakosodott szoftverfejlesztő és megoldásszállító vállalat.', + en: 'A software development and solution provider company specializing in enterprise solutions.', + }, + }, + { + id: '10', + title: 'OTP Bank Nyrt.', + description: { + hu: 'Kelet-Közép-Európa meghatározó bankcsoportja.', + en: 'The leading bank group in Central and Eastern Europe.', + }, + }, + { + id: '9', + title: 'KUKA Robotics Hungária Kft.', + description: { + hu: 'A robot- és automatizáció-technológia szakértője.', + en: 'Expert in robot and automation technology.', + }, + }, + { + id: '8', + title: 'Nova Services Zrt.', + description: { + hu: 'Az új technológiák és az új IT trendek iránt elkötelezett innovatív IT megoldásokat nyújtó cég.', + en: 'An innovative IT solution provider company committed to new technologies and new IT trends.', + }, + }, + { + id: '7', + title: 'Paks II. Zrt.', + description: { + hu: 'Atomenergiával a fenntartható jövőért.', + en: 'With nuclear energy for a sustainable future.', + }, + }, + { + id: '6', + title: 'Interactive Brokers Zrt.', + description: { + hu: 'Az egyik legnagyobb online brókercég az Egyesült Államok piacán', + en: 'One of the largest online brokerage firms in the United States market', + }, + }, + { + id: '5', + title: 'Silicon Laboratories Hungary Kft.', + description: { + hu: 'Megbízható IoT fejlesztő platform.', + en: 'Trusted IoT Development Platform.', + }, + }, + { + id: '4', + title: 'Sicontact Kft.', + description: { + hu: 'Az ESET biztonsági megoldások hivatalos magyarországi disztribútora.', + en: 'The official distributor of ESET security solutions in Hungary.', + }, + }, + { + id: '3', + title: 'ICF Tech Hungary Kft.', + description: { + hu: 'A technológiából ered minden, amit létrehozunk.', + en: 'Everything we create comes from technology.', + }, + }, + { + id: '2', + title: 'Nokia Solutions and Networks Kft.', + description: { + hu: 'A világ egyik legnagyobb telekommunikációs vállalata', + en: "One of the world's largest telecommunications companies", + }, + }, + { + id: '1', + title: 'Robert Bosch Kft.', + description: { + hu: 'Különböző technológiák és szolgáltatások vezető nemzetközi szállítója.', + en: 'A leading international supplier of various technologies and services.', + }, + }, + { + id: 'WC', + title: 'Mosdó', + description: { + hu: 'Itt találod a mosdót!', + en: 'You can find the toilet here!', + }, + }, + { + id: 'WC_2', + title: 'Mosdó', + description: { + hu: 'Itt találod a mosdót!', + en: 'You can find the toilet here!', + }, + }, + { + id: 'WC_3', + title: 'Mosdó', + description: { + hu: 'Itt találod a mosdót!', + en: 'You can find the toilet here!', + }, + }, +]; diff --git a/types/map.type.ts b/types/map.type.ts index 000c47f..78d61f1 100644 --- a/types/map.type.ts +++ b/types/map.type.ts @@ -1,5 +1,8 @@ export type MapResource = { id: string; title: string; - description: string; + description: { + hu: string; + en: string; + }; }; From 521f29fab8c94bbb9e797138db8d1b4463e31be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Berente?= <30603208+berenteb@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:58:32 +0100 Subject: [PATCH 2/4] fix: onclick handler removed from building --- components/map/map.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/components/map/map.tsx b/components/map/map.tsx index f391cef..050bdc8 100644 --- a/components/map/map.tsx +++ b/components/map/map.tsx @@ -19,7 +19,6 @@ export function Map({ onSelectedResource, selectedResource }: MapProps) { stroke={extendedColors.slate['500']} strokeWidth={7} strokeLinejoin='round' - onPress={() => onSelectedResource('BDG')} /> Date: Wed, 28 Feb 2024 21:01:52 +0100 Subject: [PATCH 3/4] fix: colors for room text --- components/map/map.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/map/map.tsx b/components/map/map.tsx index 050bdc8..9c55add 100644 --- a/components/map/map.tsx +++ b/components/map/map.tsx @@ -64,7 +64,7 @@ export function Map({ onSelectedResource, selectedResource }: MapProps) { > @@ -387,7 +387,7 @@ export function Map({ onSelectedResource, selectedResource }: MapProps) { > Date: Wed, 28 Feb 2024 21:03:01 +0100 Subject: [PATCH 4/4] chore: current date outsourced --- utils/presentation.utils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/presentation.utils.ts b/utils/presentation.utils.ts index 9ba661b..a27c643 100644 --- a/utils/presentation.utils.ts +++ b/utils/presentation.utils.ts @@ -2,21 +2,23 @@ import { differenceInMinutes, isAfter, isBefore } from 'date-fns'; import { PresentationDto } from '../types/conference-api.type'; +const currentDate = new Date(); + export function isPresentationPast(presentation: PresentationDto) { - const now = new Date(); + const now = currentDate; const end = new Date(presentation.endTime); return isBefore(end, now); } export function isPresentationCurrent(presentation: PresentationDto) { - const now = new Date(); + const now = currentDate; const start = new Date(presentation.startTime); const end = new Date(presentation.endTime); return isBefore(start, now) && isAfter(end, now); } export function isPresentationUpcoming(presentation: PresentationDto) { - const now = new Date(); + const now = currentDate; const start = new Date(presentation.startTime); return isAfter(start, now) && differenceInMinutes(start, now) < 15; }