diff --git a/public/tailwind.config.d.ts b/public/tailwind.config.d.ts
index 556cbd6..861c2dd 100644
--- a/public/tailwind.config.d.ts
+++ b/public/tailwind.config.d.ts
@@ -34,12 +34,14 @@ export declare const DreamPipColors: {
secondary: string;
bw: string;
white: string;
+ bg: string;
};
dark: {
primary: string;
secondary: string;
bw: string;
white: string;
+ bg: string;
};
};
primary: {
@@ -140,12 +142,14 @@ declare const _default: {
secondary: string;
bw: string;
white: string;
+ bg: string;
};
dark: {
primary: string;
secondary: string;
bw: string;
white: string;
+ bg: string;
};
};
primary: {
diff --git a/public/tailwind.config.js b/public/tailwind.config.js
index 5736b9d..f955790 100644
--- a/public/tailwind.config.js
+++ b/public/tailwind.config.js
@@ -94,12 +94,14 @@ exports.DreamPipColors = {
secondary: secondary,
bw: n300,
white: white,
+ bg: dark1,
},
dark: {
primary: primary,
secondary: secondary,
bw: white,
white: white,
+ bg: light1,
},
},
primary: {
diff --git a/public/tailwind.config.ts b/public/tailwind.config.ts
index 58cde07..5a22ca6 100644
--- a/public/tailwind.config.ts
+++ b/public/tailwind.config.ts
@@ -107,12 +107,14 @@ export const DreamPipColors = {
secondary,
bw: n300,
white: white,
+ bg: dark1,
},
dark: {
primary,
secondary,
bw: white,
white: white,
+ bg: light1,
},
},
primary: {
diff --git a/src/atoms/10_Grid/Grid.tsx b/src/atoms/10_Grid/Grid.tsx
index 982a2ad..53ae100 100644
--- a/src/atoms/10_Grid/Grid.tsx
+++ b/src/atoms/10_Grid/Grid.tsx
@@ -149,11 +149,14 @@ export const HGrid = function ({
const gridRowStyles = `${clsx(gridRowSx)} ${gridColumnStyles} ${bleedStyles}`;
- const mappedChildren = Children.map(children, (child: any) => (
-
- {child}
-
- ));
+ const mappedChildren = Children.map(children, (child: any) => {
+ if (!child) return undefined;
+ return (
+
+ {child}
+
+ );
+ });
return (
void;
title?: string;
+ description?: string;
+ latlng?: ILocation;
where?: string;
when?: string;
- price?: string;
+ value?: string;
link?: string;
rating?: string;
+ badgeText?: string;
badgeLink?: string;
selected?: boolean;
- image?: string;
+ images?: string[];
background?: ECardBackground;
theme?: 'light' | 'dark';
}
@@ -48,16 +57,19 @@ export const HCard = function ({
id = 'atom__Card',
className = '',
onLike = () => {},
- rating = '4.5/5',
+ rating = '',
link = 'https://dreampip.com',
title = 'This is a very long title for a card to see how it displays on it.',
+ description = 'This is a very long description for a card to see how it displays on it.',
where = 'Home',
when = 'Whenever',
+ latlng = { lat: 0, lng: 0, radius: 0.4 },
selected = false,
- price = '1900€',
+ value = '1800£',
background = ECardBackground.NONE,
+ badgeText = '',
badgeLink = '',
- image = 'https://placehold.co/600x400',
+ images = ['https://placehold.co/600x400'],
theme = 'light',
}: ICard) {
const gridSx = [
@@ -84,59 +96,125 @@ export const HCard = function ({
background === ECardBackground.NONE ? undefined : EGradientVariant.WHITE
}
>
-
-
-
-
-
- {rating}
-
-
+ {images.length > 0 ? (
+
+
+
+
+ {rating ? (
+
+ {rating}
+
+ ) : undefined}
+ {onLike ? (
+
+ ) : undefined}
-
-
- {title}
-
-
- {where}
-
-
- {when}
-
-
- {price}
-
+ {onLike ? (
+
+ ) : undefined}
+
+ {title ? (
+
+ {title}
+
+ ) : undefined}
+ {description ? (
+
+ {description}
+
+ ) : undefined}
+ {where ? (
+
+ {where}
+
+ ) : undefined}
+ {when ? (
+
+ {when}
+
+ ) : undefined}
+ {value ? (
+
+ {value}
+
+ ) : undefined}
diff --git a/src/molecules/01_CardGrid/CardGrid.tsx b/src/molecules/01_CardGrid/CardGrid.tsx
index 0209708..2bedc2a 100644
--- a/src/molecules/01_CardGrid/CardGrid.tsx
+++ b/src/molecules/01_CardGrid/CardGrid.tsx
@@ -32,7 +32,7 @@ export const DEFAULT_CARDS = [
price: '299€',
link: 'https://dreampip.com',
badgeLink: 'https://dreampip.com',
- rating: '4.5/5',
+ rating: '',
selected: true,
},
{
diff --git a/src/molecules/02_AudioPlayer/AudioPlayer.tsx b/src/molecules/02_AudioPlayer/AudioPlayer.tsx
index 2eaafc6..5e50cd7 100644
--- a/src/molecules/02_AudioPlayer/AudioPlayer.tsx
+++ b/src/molecules/02_AudioPlayer/AudioPlayer.tsx
@@ -161,7 +161,7 @@ export const HAudioPlayer = function ({
))}
-
+
{title}
diff --git a/src/molecules/03_Calendar/CalendarView.tsx b/src/molecules/03_Calendar/CalendarView.tsx
index 54742ed..8771d2a 100644
--- a/src/molecules/03_Calendar/CalendarView.tsx
+++ b/src/molecules/03_Calendar/CalendarView.tsx
@@ -12,7 +12,7 @@ import { Button } from '../../atoms/01_Button';
import { Typography } from '../../atoms/02_Typography';
import { ESystemIcon } from '../../atoms/05_SystemIcon';
-export const EventLocale: any = {
+export const DEFAULT_DICTIONARY: any = {
default: {
locale: 'en-us',
timezone: 'Europe/Rome',
@@ -27,7 +27,7 @@ export const EventLocale: any = {
when: 'When',
related: 'Other episodes from our guests',
episodes: "Listen to this event's episodes",
- back: 'Back to events',
+ back: 'Back to calData',
countdown: 'Countdown',
photos: 'Photos',
local: 'Local time',
@@ -38,9 +38,9 @@ export const EventLocale: any = {
or: 'Or, add your name to the event discount list:',
reset: 'Reset filters',
countries: 'Countries',
- events: 'Events',
- eventsDescription:
- 'A list of our events. Brought with love to your boroughs.',
+ calData: 'Events',
+ calDataDescription:
+ 'A list of our calData. Brought with love to your boroughs.',
D: 'Day',
W: 'Week',
Q: 'Quarter',
@@ -85,8 +85,8 @@ export const EventLocale: any = {
or: "Oppure, iscriverti alla lista sconti dell'evento:",
reset: 'Ripristina filtri',
countries: 'Paesi',
- events: 'Eventi',
- eventsDescription:
+ calData: 'Eventi',
+ calDataDescription:
'Un elenco dei nostri eventi. Portato con amore nei tuoi quartieri.',
D: 'Giorno',
W: 'Settimana',
@@ -132,8 +132,8 @@ export const EventLocale: any = {
or: 'Ou adicione seu nome na lista de desconto:',
reset: 'Redefinir filtros',
countries: 'Países',
- events: 'Eventos',
- eventsDescription:
+ calData: 'Eventos',
+ calDataDescription:
'Uma lista de nossos eventos. Trazidos com amor para seus bairros.',
D: 'Dia',
W: 'Semana',
@@ -179,8 +179,8 @@ export const EventLocale: any = {
or: 'O añade tu nombre a la lista de descuentos del evento:',
reset: 'Restablecer filtros',
countries: 'Países',
- events: 'Eventos',
- eventsDescription:
+ calData: 'Eventos',
+ calDataDescription:
'Una lista de nuestros eventos. Traído con amor a tus barrios.',
D: 'Día',
W: 'Semana',
@@ -227,8 +227,8 @@ export const EventLocale: any = {
or: 'Oder fügen Sie Ihren Namen zur Rabattliste des Events hinzu:',
reset: 'Filter zurücksetzen',
countries: 'Länder',
- events: 'Veranstaltungen',
- eventsDescription:
+ calData: 'Veranstaltungen',
+ calDataDescription:
'Eine Liste unserer Veranstaltungen. Mit Liebe in deine Bezirke gebracht.',
D: 'Tag',
W: 'Woche',
@@ -276,8 +276,8 @@ export const EventLocale: any = {
or: "Ou ajoutez votre nom à la liste de réduction de l'événement:",
reset: 'Réinitialiser les filtres',
countries: 'Pays',
- events: 'Événements',
- eventsDescription:
+ calData: 'Événements',
+ calDataDescription:
'Une liste de nos événements. Apportée avec amour dans vos quartiers.',
D: 'Jour',
W: 'Semaine',
@@ -324,8 +324,8 @@ export const EventLocale: any = {
or: 'Sau, adaugă-ți numele în lista de reduceri a evenimentului:',
reset: 'Resetează filtrele',
countries: 'Țări',
- events: 'Evenimente',
- eventsDescription:
+ calData: 'Evenimente',
+ calDataDescription:
'O listă a evenimentelor noastre. Adusă cu dragoste în cartierele tale.',
D: 'Zi',
W: 'Săptămână',
@@ -372,8 +372,8 @@ export const EventLocale: any = {
or: 'Lub dodaj swoje imię do listy zniżek na wydarzenie:',
reset: 'Zresetuj filtry',
countries: 'Kraje',
- events: 'Wydarzenia',
- eventsDescription:
+ calData: 'Wydarzenia',
+ calDataDescription:
'Lista naszych wydarzeń. Przygotowane z miłością do twoich dzielnic.',
D: 'Dzień',
W: 'Tydzień',
@@ -418,8 +418,8 @@ export const EventLocale: any = {
or: 'Nebo se přidejte na seznam slev k události:',
reset: 'Resetovat filtry',
countries: 'Země',
- events: 'Události',
- eventsDescription: 'Seznam našich událostí. S láskou pro vaše obvody.',
+ calData: 'Události',
+ calDataDescription: 'Seznam našich událostí. S láskou pro vaše obvody.',
D: 'Den',
W: 'Týden',
Q: 'Čtvrtletí',
@@ -464,8 +464,8 @@ export const EventLocale: any = {
or: 'Eller, lägg till ditt namn i evenemangets rabattlista:',
reset: 'Återställ filter',
countries: 'Länder',
- events: 'Evenemang',
- eventsDescription:
+ calData: 'Evenemang',
+ calDataDescription:
'En lista över våra evenemang. Levererat med kärlek till dina stadsdelar.',
D: 'Dag',
W: 'Vecka',
@@ -512,8 +512,8 @@ export const EventLocale: any = {
or: 'Või lisage oma nimi ürituse soodustuste nimekirja:',
reset: 'Lähtesta filtrid',
countries: 'Riigid',
- events: 'Üritused',
- eventsDescription:
+ calData: 'Üritused',
+ calDataDescription:
'Nimekiri meie üritustest. Toome armastusega teie linnaosadesse.',
D: 'Päev',
W: 'Nädal',
@@ -559,8 +559,9 @@ export const EventLocale: any = {
or: 'または、イベントの割引リストに名前を追加してください:',
reset: 'フィルターをリセット',
countries: '国々',
- events: 'イベント',
- eventsDescription: '私たちのイベントのリスト。あなたの地区への愛を込めて。',
+ calData: 'イベント',
+ calDataDescription:
+ '私たちのイベントのリスト。あなたの地区への愛を込めて。',
D: '日',
W: '週',
Q: '四半期',
@@ -596,7 +597,7 @@ export const EventLocale: any = {
},
};
-export const DEFAULT_EVENTS = {
+export const DEFAULT_CALDATA = {
calData: [
{
id: '[musica, samba] Banda - Samba do São Lázaro',
@@ -665,8 +666,9 @@ export interface IAudioTrack {
export interface ICalendarView {
id?: string;
className?: string;
- events?: any[];
+ calData?: any[];
locale?: string;
+ dictionary?: any;
initialView?: string;
headerToolbar?: any;
nowIndicator?: boolean;
@@ -676,9 +678,10 @@ export interface ICalendarView {
export const HCalendarView = function ({
id = 'atom__CalendarView',
className = '',
- events = DEFAULT_EVENTS.calData,
+ calData = DEFAULT_CALDATA.calData,
locale = 'en-US',
initialView = 'timeGridWeek',
+ dictionary = DEFAULT_DICTIONARY,
headerToolbar = {
left: 'title',
center: '',
@@ -692,9 +695,9 @@ export const HCalendarView = function ({
const [modalPrompt, setModalPrompt] = useState('');
const [askedCal, setAskedCal] = useState(false);
const [info, setInfo] = useState({ event: { url: '' } });
- // to-do add localization
+ // to-do add dictionary
const localization =
- EventLocale[locale as keyof typeof EventLocale] || EventLocale.default;
+ dictionary[locale as keyof typeof dictionary] || dictionary.default;
const gridSx = [
{
[`class03
@@ -798,7 +801,7 @@ export const HCalendarView = function ({
initialView={initialView}
nowIndicator={nowIndicator}
locale={locale}
- events={events}
+ events={calData}
height={600}
aspectRatio={1.5}
firstDay={1}
@@ -861,10 +864,10 @@ export const HCalendarView = function ({
theme={theme}
onClick={handleCancelModalClick}
>
- Cancel
+ {localization.cancel}
diff --git a/src/molecules/04_Map/MapView.tsx b/src/molecules/04_Map/MapView.tsx
index ea1b790..244b80d 100644
--- a/src/molecules/04_Map/MapView.tsx
+++ b/src/molecules/04_Map/MapView.tsx
@@ -5,11 +5,12 @@
import clsx from 'clsx';
import Map, { Source, Layer, Popup as GLPop } from 'react-map-gl';
import bbox from '@turf/bbox';
-import React, { useRef, useState, useEffect } from 'react';
+import React, { useRef, useState, useEffect, useMemo } from 'react';
import { Button, ButtonVariant, EButtonTheme } from '../../atoms/01_Button';
import { Typography } from '../../atoms/02_Typography';
import { Link } from '../../atoms/03_Link';
import { SystemIcon, ESystemIcon } from '../../atoms/05_SystemIcon';
+import { DreamPipColors } from '../../../tailwind.config.ts';
import 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
@@ -275,50 +276,6 @@ export const MAP_CENTRES = {
},
};
-export const clusterLayer = {
- id: 'clusters',
- type: 'circle',
- source: 'molecule__MapView',
- filter: ['has', 'point_count'],
- paint: {
- 'circle-color': [
- 'step',
- ['get', 'point_count'],
- '#fff',
- 10,
- '#22cc00',
- 30,
- '#cc2200',
- ],
- 'circle-radius': ['step', ['get', 'point_count'], 20, 5, 30, 10, 40],
- },
-};
-
-export const clusterCountLayer = {
- id: 'molecule__MapView',
- type: 'symbol',
- source: 'molecule__MapView',
- filter: ['has', 'point_count'],
- layout: {
- 'text-field': '{point_count_abbreviated}',
- // 'text-font': ['Comfortaa', 'Arial Unicode MS Bold'],
- 'text-size': 12,
- },
-};
-
-export const unclusteredPointLayer = {
- id: 'point',
- type: 'circle',
- source: 'molecule__MapView',
- filter: ['!', ['has', 'point_count']],
- paint: {
- 'circle-color': '#fff',
- 'circle-radius': 10,
- 'circle-stroke-width': 1,
- 'circle-stroke-color': '#fff',
- },
-};
-
export const DEFAULT_EVENTS = {
calData: [
{
@@ -374,7 +331,7 @@ export enum EMapViewVariant {
export interface IMapView {
id?: string;
className?: string;
- events?: any;
+ mapData?: any;
locale?: string;
mobile?: boolean;
city?: string;
@@ -415,7 +372,7 @@ const Popup = function ({
return (
{localization.calendar}
@@ -479,7 +436,7 @@ const Popup = function ({
export const HMapView = function ({
id = 'molecule__MapView',
className = '',
- events = DEFAULT_EVENTS,
+ mapData = DEFAULT_EVENTS,
locale,
mobile,
city,
@@ -489,6 +446,67 @@ export const HMapView = function ({
fetchNewData,
theme = 'light',
}: IMapView) {
+ const clusterLayer = {
+ id: 'clusters',
+ type: 'circle',
+ source: 'molecule__MapView',
+ filter: ['has', 'point_count'],
+ paint: {
+ 'circle-color': [
+ 'step',
+ ['get', 'point_count'],
+ theme === 'dark'
+ ? DreamPipColors.icon.dark.bg
+ : DreamPipColors.icon.light.bg,
+ 10,
+ theme === 'dark'
+ ? DreamPipColors.icon.dark.secondary
+ : DreamPipColors.icon.light.secondary,
+ 30,
+ theme === 'dark'
+ ? DreamPipColors.icon.dark.primary
+ : DreamPipColors.icon.light.primary,
+ ],
+ 'circle-radius': ['step', ['get', 'point_count'], 20, 5, 30, 10, 40],
+ },
+ };
+
+ const clusterCountLayer = {
+ id: 'molecule__MapView',
+ type: 'symbol',
+ source: 'molecule__MapView',
+ filter: ['has', 'point_count'],
+ layout: {
+ 'text-field': '{point_count_abbreviated}',
+ // 'text-font': ['Comfortaa', 'Arial Unicode MS Bold'],
+ 'text-size': 12,
+ },
+ };
+
+ console.log({ DreamPipColors });
+
+ const unclusteredPointLayer = useMemo(
+ () => ({
+ id: 'point',
+ type: 'circle',
+ source: 'molecule__MapView',
+ filter: ['!', ['has', 'point_count']],
+ paint: {
+ 'circle-color':
+ theme === 'dark'
+ ? DreamPipColors.icon.dark.bg
+ : DreamPipColors.icon.light.bg,
+ 'circle-radius': 10,
+ 'circle-stroke-width': 1,
+ 'circle-stroke-color':
+ theme === 'dark'
+ ? DreamPipColors.icon.dark.bg
+ : DreamPipColors.icon.light.bg,
+ },
+ }),
+ [theme, DreamPipColors],
+ );
+
const mapRef = useRef(null);
const popup = useRef({ open: false, feature: undefined });
const hoverPopup = useRef(null);
@@ -551,15 +569,15 @@ export const HMapView = function ({
};
useEffect(() => {
- if (events?.timeframe !== timeframe) {
+ if (mapData?.timeframe !== timeframe) {
fetchNewData({ force: true });
}
}, [timeframe]);
useEffect(() => {
- // if (!events?.mapData) return;
- if (mapRef?.current && events?.mapData?.features?.length) {
- const bounds = bbox(events?.mapData);
+ // if (!mapData?.mapData) return;
+ if (mapRef?.current && mapData?.mapData?.features?.length) {
+ const bounds = bbox(mapData?.mapData);
if (bounds?.length) {
try {
@@ -569,7 +587,7 @@ export const HMapView = function ({
}
}
}
- }, [JSON.stringify(events?.mapData)]);
+ }, [JSON.stringify(mapData?.mapData)]);
const onClick = (event) => {
const [target] = event.features;
@@ -631,7 +649,7 @@ export const HMapView = function ({
) : undefined}
{hoverPopupOpen && hoverPopup.current ? (
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 58cde07..5a22ca6 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -107,12 +107,14 @@ export const DreamPipColors = {
secondary,
bw: n300,
white: white,
+ bg: dark1,
},
dark: {
primary,
secondary,
bw: white,
white: white,
+ bg: light1,
},
},
primary: {