Skip to content
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

ar(feat) [DPCP-40]: Parse Services. #17

Merged
merged 7 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/tailwind.config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 2 additions & 0 deletions public/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 2 additions & 0 deletions public/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ export const DreamPipColors = {
secondary,
bw: n300,
white: white,
bg: dark1,
},
dark: {
primary,
secondary,
bw: white,
white: white,
bg: light1,
},
},
primary: {
Expand Down
2 changes: 1 addition & 1 deletion src/atoms/05_SystemIcon/SystemIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint no-unused-vars:0, no-shadow:0, @typescript-eslint/no-explicit-any:0 */

Check failure on line 1 in src/atoms/05_SystemIcon/SystemIcon.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::build

Cannot find module '../../../dist/esm/tailwind.config.ts' or its corresponding type declarations.
// @atoms/SystemIcon.tsx
import { useMemo } from 'react';
import clsx from 'clsx';
import { DreamPipColors } from '../../../tailwind.config.ts';
import { DreamPipColors } from '../../../dist/esm/tailwind.config.ts';
import * as Icons from './assets';

type Theme = 'light' | 'dark';
Expand Down Expand Up @@ -88,7 +88,7 @@
},
};

const IconComponent = useMemo(() => Icons[icon], [icon, theme]);

Check warning on line 91 in src/atoms/05_SystemIcon/SystemIcon.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::lint

React Hook useMemo has an unnecessary dependency: 'theme'. Either exclude it or remove the dependency array

return (
<IconComponent
Expand Down
13 changes: 8 additions & 5 deletions src/atoms/10_Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ export const HGrid = function ({

const gridRowStyles = `${clsx(gridRowSx)} ${gridColumnStyles} ${bleedStyles}`;

const mappedChildren = Children.map(children, (child: any) => (
<Box component="article" className={`${child?.props?.className || ''}`}>
{child}
</Box>
));
const mappedChildren = Children.map(children, (child: any) => {
if (!child) return undefined;
return (
<Box component="article" className={`${child?.props?.className || ''}`}>
{child}
</Box>
);
});

return (
<Box
Expand Down
190 changes: 134 additions & 56 deletions src/molecules/00_Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,28 @@ export enum ECardBackground {
NONE = 'none',
}

interface ILocation {
lat: number;
lng: number;
radius: number;
}

export interface ICard {
id?: string;
className?: string;
onLike?: (item: string) => 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';
}
Expand All @@ -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 = [
Expand All @@ -84,59 +96,125 @@ export const HCard = function ({
background === ECardBackground.NONE ? undefined : EGradientVariant.WHITE
}
>
<Grid className="relative" theme={theme} full>
<Link href={link} faux>
<Image
src={image}
variant={EImageVariant.SIXTEEN_PER_NINE}
className="col-span-full col-start-0 md:col-span-4 md:col-start-0 rounded-md overflow-hidden"
/>
</Link>
<Review theme={theme} className="absolute left-a1 sm:top-a1 top-a2">
{rating}
</Review>
<Button
onClick={() => onLike(id)}
theme={theme}
buttonTheme={
selected ? EButtonTheme.PASSION_SELECTED : EButtonTheme.PASSION
}
icon={selected ? ESystemIcon.heart : ESystemIcon['heart-broken']}
className="absolute right-a1 sm:top-a1 top-a2"
/>
<Link href={badgeLink || link} faux>
<BadgeChip className="absolute left-a1 bottom-a1" />
</Link>
</Grid>
{images.length > 0 ? (
<Grid className="relative" theme={theme} full>
<Link href={link} faux>
<Image
src={images[0]}
variant={EImageVariant.SIXTEEN_PER_NINE}
className="col-span-full col-start-0 md:col-span-4 md:col-start-0 rounded-md overflow-hidden"
/>
</Link>
{rating ? (
<Review theme={theme} className="absolute left-a1 sm:top-a1 top-a2">
{rating}
</Review>
) : undefined}
{onLike ? (
<Button
onClick={() => onLike(id)}
theme={theme}
buttonTheme={
selected ? EButtonTheme.PASSION_SELECTED : EButtonTheme.PASSION
}
icon={selected ? ESystemIcon.heart : ESystemIcon['heart-broken']}
className="absolute right-a1 sm:top-a1 top-a2"
/>
) : undefined}
{badgeText ? (
<Link href={badgeLink || link} faux>
<BadgeChip className="absolute left-a1 bottom-a1">
{badgeText}
</BadgeChip>
</Link>
) : undefined}
</Grid>
) : undefined}
<Grid theme={theme} full className="gap-0">
<Link href={link} title={title} faux className="flex flex-col">
<Typography
variant={TypographyVariant.H4}
truncate
className="w-full pt-a2 col-span-full col-start-0 md:col-span-full md:col-start-0"
>
{title}
</Typography>
<Typography
inherit
variant={TypographyVariant.SMALL}
className="w-full pt-a1 pb-0 text-neutral-light dark:text-body-dark col-span-full col-start-0 md:col-span-full md:col-start-0"
>
{where}
</Typography>
<Typography
inherit
variant={TypographyVariant.SMALL}
className="w-full pt-0 text-neutral-light dark:text-body-dark col-span-full col-start-0 md:col-span-full md:col-start-0"
{images.length === 0 ? (
<Grid
variant={EGridVariant.TWELVE_COLUMNS}
bleed={EBleedVariant.ZERO}
className="grid gap-a2"
>
{when}
</Typography>
<PriceTag
variant={EPriceTagVariant.NORMAL}
className="w-full pt-a2 pb-a0 col-span-4 col-start-0 md:col-span-4 md:col-start-0"
>
{price}
</PriceTag>
{onLike ? (
<Button
onClick={() => onLike(id)}
theme={theme}
buttonTheme={
selected
? EButtonTheme.PASSION_SELECTED
: EButtonTheme.PASSION
}
icon={
selected ? ESystemIcon.heart : ESystemIcon['heart-broken']
}
className="col-start-0 col-span-2"
/>
) : undefined}
{rating ? (
<Review theme={theme} className="col-span-4 col-start-0">
{rating}
</Review>
) : undefined}
{badgeText ? (
<Link
href={badgeLink || link}
faux
className="col-span-4 col-start-0"
>
<BadgeChip className="">{badgeText}</BadgeChip>
</Link>
) : undefined}
</Grid>
) : undefined}
<Link href={link} title={title} faux className="flex flex-col">
{title ? (
<Typography
variant={TypographyVariant.H4}
truncate
className="pt-a2 w-full col-span-full col-start-0 md:col-span-full md:col-start-0"
>
{title}
</Typography>
) : undefined}
{description ? (
<Typography
inherit
variant={TypographyVariant.SMALL}
className="w-full pt-a1 pb-0 text-neutral-light dark:text-body-dark col-span-full col-start-0 md:col-span-full md:col-start-0"
>
{description}
</Typography>
) : undefined}
{where ? (
<Typography
inherit
variant={TypographyVariant.SMALL}
data-lat={latlng.lat}
data-lng={latlng.lng}
className="w-full pt-a1 pb-0 text-neutral-light dark:text-body-dark col-span-full col-start-0 md:col-span-full md:col-start-0"
>
{where}
</Typography>
) : undefined}
{when ? (
<Typography
inherit
variant={TypographyVariant.SMALL}
className="w-full pt-0 text-neutral-light dark:text-body-dark col-span-full col-start-0 md:col-span-full md:col-start-0"
>
{when}
</Typography>
) : undefined}
{value ? (
<PriceTag
variant={EPriceTagVariant.NORMAL}
className="w-full pt-a2 pb-a0 col-span-4 col-start-0 md:col-span-4 md:col-start-0"
>
{value}
</PriceTag>
) : undefined}
</Link>
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/01_CardGrid/CardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/02_AudioPlayer/AudioPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
};
}
return () => {};
}, [status]);

Check warning on line 125 in src/molecules/02_AudioPlayer/AudioPlayer.tsx

View workflow job for this annotation

GitHub Actions / oneiros::pr_checks::lint

React Hook useEffect has missing dependencies: 'handleStatus' and 'prompt'. Either include them or remove the dependency array

return (
<div id={id} className={gridStyles}>
Expand Down Expand Up @@ -161,7 +161,7 @@
))}
</audio>
</div>
<Typography className="col-span-4 col-start-1" truncate>
<Typography className="ml-a2 col-span-4 col-start-1" truncate>
{title}
</Typography>
</div>
Expand Down
Loading
Loading