Skip to content

Commit e8b44a4

Browse files
author
Daveed
committed
albums in a page llink to the markketplace
1 parent 4deddfd commit e8b44a4

File tree

3 files changed

+81
-43
lines changed

3 files changed

+81
-43
lines changed

src/components/albums.grid.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
AspectRatio,
1212
} from '@mantine/core';
1313
import { IconUsers } from '@tabler/icons-react';
14+
import config from '../config';
1415

1516
interface AlbumCardProps {
1617
album: Album;
@@ -25,7 +26,7 @@ interface AlbumsProps {
2526
function AlbumCard({ album, store_slug }: AlbumCardProps) {
2627

2728
return (
28-
<a href={`#/${store_slug}/${album.slug}`} style={{ textDecoration: 'none' }}>
29+
<a href={new URL(`/store/${store_slug}/${album.slug}`, config.markket_url).toString()} style={{ textDecoration: 'none' }}>
2930
<Card
3031
shadow="sm"
3132
padding="lg"

src/components/home.page.tsx

Lines changed: 77 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from 'react'
2-
import { Container, Paper, Stack, Image, Title, Button, Group } from '@mantine/core'
2+
import {
3+
Container, Paper, Stack, Image, Title, Button, Box, Overlay,
4+
Group
5+
} from '@mantine/core'
36
import { IconHeartbeat } from '@tabler/icons-react'
47
import ReactMarkdown from 'react-markdown'
58
import PageContent from './page.content'
@@ -16,48 +19,80 @@ interface PageProps {
1619

1720
const PageComponent = ({ page, store }: PageProps) => {
1821
return (
19-
<Container size="md" py="xl" id={window.location.hash?.replace('#', '')}>
20-
<Paper shadow="md" radius="md" p="xl" mb="xl">
21-
<Stack align="center">
22-
{store?.Logo && (
23-
<Image
24-
src={store.Logo.formats?.small?.url || store.Logo.url}
25-
alt={store.title}
26-
width={200}
27-
height={200}
28-
fit="contain"
29-
/>
30-
)}
22+
<Container size="md" py="xl">
23+
<Box pos="relative" h={300} mb={50}>
24+
<Box
25+
style={{
26+
backgroundImage: `url(${store?.Cover?.url || store?.SEO?.socialImage?.url || ''})`,
27+
backgroundSize: 'cover',
28+
backgroundPosition: 'center',
29+
height: '100%',
30+
width: '100%',
31+
}}
32+
>
33+
<Overlay
34+
gradient="linear-gradient(180deg, rgba(36, 85, 214, 0.2) 0%, rgba(36, 85, 214, 0.4) 100%)"
35+
opacity={0.6}
36+
zIndex={1}
37+
/>
38+
</Box>
3139

32-
<Title order={1}>
33-
{store?.title}
34-
</Title>
35-
36-
{store?.Description && (
37-
<div className="blocks-content">
38-
<ReactMarkdown >
39-
{store.Description}
40-
</ReactMarkdown>
41-
</div>
42-
)}
43-
44-
{store?.URLS?.length && (
45-
<Group mt="md">
46-
{store.URLS.map((url) => (
47-
<Button
48-
key={url.id}
49-
component="a"
50-
href={url.URL}
51-
target="_blank"
52-
variant="light"
53-
>
54-
<IconHeartbeat size={18} />{` `}
55-
{url.Label}
56-
</Button>
57-
))}
58-
</Group>
59-
)}
60-
</Stack>
40+
<Paper
41+
pos="absolute"
42+
left="50%"
43+
style={{ transform: 'translate(-50%, 50%)' }}
44+
bottom={0}
45+
shadow="xl"
46+
p="xs"
47+
withBorder
48+
radius="md"
49+
bg="white"
50+
className="z-10"
51+
>
52+
{store?.Logo?.url && (
53+
<img
54+
src={store.Logo.url}
55+
alt={store.SEO?.metaTitle}
56+
width={150}
57+
height={150}
58+
className="rounded-md object-contain"
59+
/>
60+
)}
61+
</Paper>
62+
</Box>
63+
<Paper shadow="md" radius="md" p="xl" mb="xl">
64+
<Container size="lg" className="pb-20 pt-10">
65+
<Stack gap="xl">
66+
<Title className="text-4xl text-center md:text-5xl mb-4">
67+
{store?.title || store?.SEO?.metaTitle}
68+
</Title>
69+
</Stack>
70+
</Container>
71+
<Stack align="center">
72+
{store?.Description && (
73+
<div className="blocks-content">
74+
<ReactMarkdown >
75+
{store.Description}
76+
</ReactMarkdown>
77+
</div>
78+
)}
79+
{store?.URLS?.length && (
80+
<Group mt="md">
81+
{store.URLS.map((url) => (
82+
<Button
83+
key={url.id}
84+
component="a"
85+
href={url.URL}
86+
target="_blank"
87+
variant="light"
88+
>
89+
<IconHeartbeat size={18} />{` `}
90+
{url.Label}
91+
</Button>
92+
))}
93+
</Group>
94+
)}
95+
</Stack>
6196
</Paper>
6297
{page && (
6398
<Paper className='blocks-content' shadow="md" radius="md" p="xl" mb="xl">

src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
const STRAPI_URL = process.env.REACT_APP_STRAPI_URL || 'https://api.markket.place';
22
const STORE_SLUG = process.env.REACT_APP_STORE_SLUG || 'markket';
3+
const MARKKET_URL = process.env.REACT_APP_MARKKET_URL || 'https://de.markket.place/';
34

45
const config = {
56
api_url: STRAPI_URL,
67
store_slug: STORE_SLUG,
8+
markket_url: MARKKET_URL,
79
};
810

911
export default config;

0 commit comments

Comments
 (0)