@ludo.ninja/components 1.4.3 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/utils/index.ts +2 -0
- package/src/components/assetPage/assetLikes/index.tsx +0 -96
- package/src/components/assetPage/assetNft/index.tsx +0 -52
- package/src/components/assetPage/assetWrapper/index.tsx +0 -174
- package/src/components/assetPage/audioVideoPlayer/Duration.tsx +0 -32
- package/src/components/assetPage/audioVideoPlayer/index.tsx +0 -525
- package/src/components/assetPage/category/index.tsx +0 -71
- package/src/components/assetPage/description/index.tsx +0 -54
- package/src/components/assetPage/detailsAccordeon/index.tsx +0 -130
- package/src/components/assetPage/figCaption/index.tsx +0 -299
- package/src/components/assetPage/index.ts +0 -13
- package/src/components/assetPage/information/index.tsx +0 -194
- package/src/components/assetPage/marketPlaces/index.tsx +0 -86
- package/src/components/assetPage/media/AssetImage/index.tsx +0 -217
- package/src/components/assetPage/moreDropDown/index.tsx +0 -176
- package/src/components/assetPage/participants/index.tsx +0 -330
- package/src/components/assetPage/priceRank/index.tsx +0 -192
- package/src/components/assetPage/properties/index.tsx +0 -56
- package/src/components/assetPage/slider/index.tsx +0 -235
- package/src/components/assetPage/slider/slideItem.tsx +0 -55
- package/src/components/assetPage/slider/store.ts +0 -23
- package/src/components/assetPage/tittle/index.tsx +0 -143
- package/src/components/assetPage/viewer3D/index.tsx +0 -206
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import Image from 'next/image';
|
|
4
|
-
import Link from 'next/link';
|
|
5
|
-
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
|
|
8
|
-
import { MarketPlaceEntity } from '@ludo.ninja/core';
|
|
9
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
10
|
-
|
|
11
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
12
|
-
import BoxShadow from '@/styles/mixins/boxShadow';
|
|
13
|
-
import BoxTransform from '@/styles/mixins/boxTransform';
|
|
14
|
-
|
|
15
|
-
import { getStaticENVDomain } from '@/utils/env';
|
|
16
|
-
|
|
17
|
-
const Container = styled.div`
|
|
18
|
-
margin: 30px 0 0 0;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
flex-wrap: wrap;
|
|
22
|
-
|
|
23
|
-
${mediaQuery.tablet} {
|
|
24
|
-
margin: 20px 0 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
${mediaQuery.minWidthFourK} {
|
|
28
|
-
margin: ${adaptiveValueCalc(30)} 0 0 0;
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
const StyledImage = styled(Image)`
|
|
33
|
-
${BoxShadow};
|
|
34
|
-
${BoxTransform};
|
|
35
|
-
border-radius: 6px;
|
|
36
|
-
margin: 0 7px 6px 0;
|
|
37
|
-
width: 40px;
|
|
38
|
-
height: 40px;
|
|
39
|
-
|
|
40
|
-
${mediaQuery.minWidthFourK} {
|
|
41
|
-
border-radius: ${adaptiveValueCalc(6)};
|
|
42
|
-
margin: 0 ${adaptiveValueCalc(7)} ${adaptiveValueCalc(6)} 0;
|
|
43
|
-
width: ${adaptiveValueCalc(40)};
|
|
44
|
-
height: ${adaptiveValueCalc(40)};
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
const MarketLinkWrapper = ({
|
|
49
|
-
market,
|
|
50
|
-
children,
|
|
51
|
-
}: {
|
|
52
|
-
market: MarketPlaceEntity;
|
|
53
|
-
children: ReactNode;
|
|
54
|
-
}) => {
|
|
55
|
-
if (market.getMarketPlaceUrl()) {
|
|
56
|
-
return (
|
|
57
|
-
<Link
|
|
58
|
-
target="_blank"
|
|
59
|
-
title={market.getMarketPlaceName()}
|
|
60
|
-
href={market.getMarketPlaceUrl() as string}
|
|
61
|
-
>
|
|
62
|
-
{children}
|
|
63
|
-
</Link>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
return <>{children}</>;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const MarketPlaces = ({ markets }: { markets: MarketPlaceEntity[] }) => (
|
|
70
|
-
<Container>
|
|
71
|
-
{markets?.map((market) => (
|
|
72
|
-
<MarketLinkWrapper key={market.getMarketPlaceId()} market={market}>
|
|
73
|
-
<StyledImage
|
|
74
|
-
width={40}
|
|
75
|
-
height={40}
|
|
76
|
-
src={
|
|
77
|
-
market.getMarketPlaceIconRegular({
|
|
78
|
-
domain: getStaticENVDomain(),
|
|
79
|
-
}) as string
|
|
80
|
-
}
|
|
81
|
-
alt={market.getMarketPlaceName()}
|
|
82
|
-
/>
|
|
83
|
-
</MarketLinkWrapper>
|
|
84
|
-
))}
|
|
85
|
-
</Container>
|
|
86
|
-
);
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import Link from 'next/link';
|
|
4
|
-
|
|
5
|
-
import Skeleton from 'react-loading-skeleton';
|
|
6
|
-
import styled, { css } from 'styled-components';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
AccentColor,
|
|
10
|
-
InactiveButtonColor,
|
|
11
|
-
WhiteColor,
|
|
12
|
-
} from '@ludo.ninja/ui/build/styles/colors';
|
|
13
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
14
|
-
|
|
15
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
16
|
-
|
|
17
|
-
import { defineImgProportion } from '@/utils/imageProportionsSize';
|
|
18
|
-
|
|
19
|
-
import { poppinsFontVarCss } from '@/fonts/vars';
|
|
20
|
-
|
|
21
|
-
const SScreenshotContainer = styled.div`
|
|
22
|
-
border-radius: 16px;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
background-color: ${WhiteColor};
|
|
25
|
-
transition: background-color 150ms;
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
background-color: ${InactiveButtonColor};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.link {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
padding: 10px;
|
|
35
|
-
width: 100%;
|
|
36
|
-
height: 48px;
|
|
37
|
-
|
|
38
|
-
${mediaQuery.desktop} {
|
|
39
|
-
height: 42px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
span {
|
|
43
|
-
text-align: center;
|
|
44
|
-
color: ${AccentColor};
|
|
45
|
-
font-family: ${poppinsFontVarCss.css};
|
|
46
|
-
font-size: 15px;
|
|
47
|
-
font-weight: 500;
|
|
48
|
-
line-height: 22px;
|
|
49
|
-
width: 100%;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
text-overflow: ellipsis;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
${mediaQuery.minWidthFourK} {
|
|
56
|
-
border-radius: ${adaptiveValueCalc(16)};
|
|
57
|
-
|
|
58
|
-
.link {
|
|
59
|
-
padding: ${adaptiveValueCalc(10)};
|
|
60
|
-
height: ${adaptiveValueCalc(48)};
|
|
61
|
-
|
|
62
|
-
span {
|
|
63
|
-
font-size: ${adaptiveValueCalc(15)};
|
|
64
|
-
line-height: ${adaptiveValueCalc(22)};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
`;
|
|
69
|
-
|
|
70
|
-
const ImageContainer = styled.div<{ isScreenshot: boolean | undefined }>`
|
|
71
|
-
display: flex;
|
|
72
|
-
position: relative;
|
|
73
|
-
align-self: center;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
align-items: center;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
|
|
78
|
-
& img {
|
|
79
|
-
object-fit: contain;
|
|
80
|
-
aspect-ratio: auto;
|
|
81
|
-
width: 100%;
|
|
82
|
-
border-radius: 16px;
|
|
83
|
-
max-height: 510px;
|
|
84
|
-
max-width: 510px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
${(props) =>
|
|
88
|
-
props.isScreenshot
|
|
89
|
-
? css`
|
|
90
|
-
width: 508px;
|
|
91
|
-
height: 244px;
|
|
92
|
-
|
|
93
|
-
${mediaQuery.desktop} {
|
|
94
|
-
width: 336px;
|
|
95
|
-
height: 164px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
${mediaQuery.mobile} {
|
|
99
|
-
width: 320px;
|
|
100
|
-
height: 154px;
|
|
101
|
-
}
|
|
102
|
-
`
|
|
103
|
-
: css`
|
|
104
|
-
border-radius: 16px;
|
|
105
|
-
width: 510px;
|
|
106
|
-
height: 510px;
|
|
107
|
-
|
|
108
|
-
${mediaQuery.desktop} {
|
|
109
|
-
width: 335px;
|
|
110
|
-
height: 335px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
${mediaQuery.mobile} {
|
|
114
|
-
width: 320px;
|
|
115
|
-
height: 320px;
|
|
116
|
-
}
|
|
117
|
-
`}
|
|
118
|
-
${mediaQuery.minWidthFourK} {
|
|
119
|
-
& img {
|
|
120
|
-
border-radius: ${adaptiveValueCalc(16)};
|
|
121
|
-
max-height: ${adaptiveValueCalc(510)};
|
|
122
|
-
max-width: ${adaptiveValueCalc(510)};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
${(props) =>
|
|
126
|
-
props.isScreenshot
|
|
127
|
-
? css`
|
|
128
|
-
width: ${adaptiveValueCalc(508)};
|
|
129
|
-
height: ${adaptiveValueCalc(244)};
|
|
130
|
-
`
|
|
131
|
-
: css`
|
|
132
|
-
border-radius: ${adaptiveValueCalc(16)};
|
|
133
|
-
width: ${adaptiveValueCalc(510)};
|
|
134
|
-
height: ${adaptiveValueCalc(510)};
|
|
135
|
-
`}
|
|
136
|
-
}
|
|
137
|
-
`;
|
|
138
|
-
|
|
139
|
-
const AssetImage = ({
|
|
140
|
-
imageUrl,
|
|
141
|
-
errorImg,
|
|
142
|
-
originalUrl,
|
|
143
|
-
alt,
|
|
144
|
-
isScreenshot,
|
|
145
|
-
}: {
|
|
146
|
-
imageUrl: string;
|
|
147
|
-
errorImg: string;
|
|
148
|
-
alt: string;
|
|
149
|
-
originalUrl?: string | null | undefined;
|
|
150
|
-
isScreenshot?: boolean;
|
|
151
|
-
}) => {
|
|
152
|
-
const [size, setSize] = useState({});
|
|
153
|
-
const [loading, setLoading] = useState<boolean>(true);
|
|
154
|
-
const ref = useRef<HTMLImageElement | null>(null);
|
|
155
|
-
|
|
156
|
-
useLayoutEffect(() => {
|
|
157
|
-
const { width, height } = defineImgProportion(ref, 80);
|
|
158
|
-
if (imageUrl && parseFloat(height) && parseFloat(width)) {
|
|
159
|
-
defineImgProportion(ref, 80);
|
|
160
|
-
setSize({ width, height });
|
|
161
|
-
}
|
|
162
|
-
}, [imageUrl]);
|
|
163
|
-
|
|
164
|
-
const LinkComponent = originalUrl ? Link : React.Fragment;
|
|
165
|
-
|
|
166
|
-
const ScreenShotContainer = isScreenshot
|
|
167
|
-
? SScreenshotContainer
|
|
168
|
-
: React.Fragment;
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
<LinkComponent href={`${originalUrl}`} target="_blank">
|
|
172
|
-
<ScreenShotContainer>
|
|
173
|
-
<ImageContainer isScreenshot={isScreenshot}>
|
|
174
|
-
{loading && (
|
|
175
|
-
<Skeleton
|
|
176
|
-
height={'100%'}
|
|
177
|
-
width={'100%'}
|
|
178
|
-
style={{
|
|
179
|
-
lineHeight: 'normal',
|
|
180
|
-
position: 'absolute',
|
|
181
|
-
top: 0,
|
|
182
|
-
left: 0,
|
|
183
|
-
visibility: `${loading ? 'hidden' : 'visible'}`,
|
|
184
|
-
}}
|
|
185
|
-
/>
|
|
186
|
-
)}
|
|
187
|
-
<img
|
|
188
|
-
alt={alt}
|
|
189
|
-
ref={ref}
|
|
190
|
-
src={imageUrl}
|
|
191
|
-
onError={(e) => {
|
|
192
|
-
(e.target as HTMLImageElement).src = errorImg;
|
|
193
|
-
setSize({ width: '100%', height: '100%' });
|
|
194
|
-
}}
|
|
195
|
-
onLoad={() => setLoading(false)}
|
|
196
|
-
style={{
|
|
197
|
-
opacity: loading ? '0' : '1',
|
|
198
|
-
...(isScreenshot
|
|
199
|
-
? {
|
|
200
|
-
maxHeight: '100%',
|
|
201
|
-
maxWidth: '100%',
|
|
202
|
-
}
|
|
203
|
-
: size),
|
|
204
|
-
}}
|
|
205
|
-
/>
|
|
206
|
-
</ImageContainer>
|
|
207
|
-
{isScreenshot && originalUrl && (
|
|
208
|
-
<div className="link" title={originalUrl}>
|
|
209
|
-
<span>{originalUrl}</span>
|
|
210
|
-
</div>
|
|
211
|
-
)}
|
|
212
|
-
</ScreenShotContainer>
|
|
213
|
-
</LinkComponent>
|
|
214
|
-
);
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
export default AssetImage;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
6
|
-
import { ClickAwayListener } from '@ludo.ninja/utils';
|
|
7
|
-
|
|
8
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
9
|
-
import {
|
|
10
|
-
BackgroundColorLight,
|
|
11
|
-
BlackColor,
|
|
12
|
-
TextGrayColor,
|
|
13
|
-
WhiteColor,
|
|
14
|
-
} from '@/styles/colors';
|
|
15
|
-
|
|
16
|
-
import IconWithButton from '@/system/Buttons/IconWithButton';
|
|
17
|
-
|
|
18
|
-
import { getAdaptiveScale } from '@/utils/adaptive/scale';
|
|
19
|
-
import { useWindowDimensionsWithServerInitial } from '@/utils/screen';
|
|
20
|
-
|
|
21
|
-
import { dmsansFontVarCss } from '@/fonts/vars';
|
|
22
|
-
|
|
23
|
-
import MoreIcon from '@/public/creation/card/moreBtn.svg';
|
|
24
|
-
|
|
25
|
-
const SContainer = styled.div`
|
|
26
|
-
position: relative;
|
|
27
|
-
|
|
28
|
-
& > *:first-child {
|
|
29
|
-
width: 24px;
|
|
30
|
-
height: 24px;
|
|
31
|
-
|
|
32
|
-
${mediaQuery.minWidthFourK} {
|
|
33
|
-
width: ${adaptiveValueCalc(24)};
|
|
34
|
-
height: ${adaptiveValueCalc(24)};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
const SContent = styled.div<{ isOpen: boolean }>`
|
|
39
|
-
position: absolute;
|
|
40
|
-
padding: 8px;
|
|
41
|
-
top: calc(100% + 8px);
|
|
42
|
-
right: 0;
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
|
|
46
|
-
transition: opacity 200ms;
|
|
47
|
-
|
|
48
|
-
pointer-events: ${(props) => (props.isOpen ? 'unset' : 'none')};
|
|
49
|
-
opacity: ${(props) => (props.isOpen ? '1' : '0')};
|
|
50
|
-
|
|
51
|
-
border-radius: 6px;
|
|
52
|
-
background: ${WhiteColor};
|
|
53
|
-
box-shadow: 0px 8px 16px -16px rgba(33, 21, 95, 0.1);
|
|
54
|
-
width: 184px;
|
|
55
|
-
|
|
56
|
-
${mediaQuery.minWidthFourK} {
|
|
57
|
-
padding: ${adaptiveValueCalc(8)};
|
|
58
|
-
top: calc(100% + ${adaptiveValueCalc(8)});
|
|
59
|
-
border-radius: ${adaptiveValueCalc(6)};
|
|
60
|
-
box-shadow: 0 ${adaptiveValueCalc(8)} ${adaptiveValueCalc(16)}
|
|
61
|
-
${adaptiveValueCalc(-16)} rgba(33, 21, 95, 0.1);
|
|
62
|
-
width: ${adaptiveValueCalc(184)};
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
|
|
66
|
-
const hover = css`
|
|
67
|
-
color: ${BlackColor};
|
|
68
|
-
border-radius: 4px;
|
|
69
|
-
background: ${BackgroundColorLight};
|
|
70
|
-
|
|
71
|
-
${mediaQuery.minWidthFourK} {
|
|
72
|
-
border-radius: ${adaptiveValueCalc(4)};
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
|
|
76
|
-
const SButton = styled.button`
|
|
77
|
-
font-family: ${dmsansFontVarCss.css};
|
|
78
|
-
padding: 6px 8px;
|
|
79
|
-
color: ${TextGrayColor};
|
|
80
|
-
font-size: 13px;
|
|
81
|
-
font-weight: 400;
|
|
82
|
-
line-height: 18px;
|
|
83
|
-
outline: none;
|
|
84
|
-
border: none;
|
|
85
|
-
background: inherit;
|
|
86
|
-
transition: background-color 200ms;
|
|
87
|
-
text-align: left;
|
|
88
|
-
|
|
89
|
-
&:active {
|
|
90
|
-
${hover}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@media (hover: hover) {
|
|
94
|
-
&:hover {
|
|
95
|
-
${hover}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
${mediaQuery.minWidthFourK} {
|
|
100
|
-
padding: ${adaptiveValueCalc(6)} ${adaptiveValueCalc(8)};
|
|
101
|
-
font-size: ${adaptiveValueCalc(13)};
|
|
102
|
-
line-height: ${adaptiveValueCalc(18)};
|
|
103
|
-
}
|
|
104
|
-
`;
|
|
105
|
-
|
|
106
|
-
type TItem = {
|
|
107
|
-
id: number | string;
|
|
108
|
-
title: string;
|
|
109
|
-
onClick?: () => void;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
interface IDropDown {
|
|
113
|
-
items: TItem[];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const SIcon = styled.div`
|
|
117
|
-
display: flex;
|
|
118
|
-
align-items: center;
|
|
119
|
-
justify-content: center;
|
|
120
|
-
|
|
121
|
-
${mediaQuery.minWidthFourK} {
|
|
122
|
-
width: ${adaptiveValueCalc(17)};
|
|
123
|
-
height: ${adaptiveValueCalc(4)};
|
|
124
|
-
}
|
|
125
|
-
`;
|
|
126
|
-
|
|
127
|
-
const IconResize = () => {
|
|
128
|
-
const { windowDimensions } = useWindowDimensionsWithServerInitial();
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<SIcon>
|
|
132
|
-
<MoreIcon
|
|
133
|
-
style={getAdaptiveScale({
|
|
134
|
-
windowDimensions,
|
|
135
|
-
currentSize: 1,
|
|
136
|
-
})}
|
|
137
|
-
/>
|
|
138
|
-
</SIcon>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const MoreDropDown = ({ items }: IDropDown) => {
|
|
143
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
144
|
-
|
|
145
|
-
const handle = {
|
|
146
|
-
close() {
|
|
147
|
-
setIsOpen(false);
|
|
148
|
-
},
|
|
149
|
-
toggle() {
|
|
150
|
-
setIsOpen((prev) => !prev);
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<ClickAwayListener onClickAway={handle.close}>
|
|
156
|
-
<SContainer>
|
|
157
|
-
<IconWithButton variant={'dots'} onClick={handle.toggle}>
|
|
158
|
-
<IconResize />
|
|
159
|
-
</IconWithButton>
|
|
160
|
-
<SContent isOpen={isOpen}>
|
|
161
|
-
{items.map(({ title, onClick, id }) => (
|
|
162
|
-
<SButton
|
|
163
|
-
key={id}
|
|
164
|
-
onClick={() => {
|
|
165
|
-
onClick?.();
|
|
166
|
-
handle.close();
|
|
167
|
-
}}
|
|
168
|
-
>
|
|
169
|
-
<span>{title}</span>
|
|
170
|
-
</SButton>
|
|
171
|
-
))}
|
|
172
|
-
</SContent>
|
|
173
|
-
</SContainer>
|
|
174
|
-
</ClickAwayListener>
|
|
175
|
-
);
|
|
176
|
-
};
|