@lobehub/ui 1.137.5 → 1.137.6
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.
|
@@ -2,9 +2,9 @@ import { type SplineProps } from '@splinetool/react-spline';
|
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
3
|
export interface LogoSplineProps extends Partial<SplineProps> {
|
|
4
4
|
className?: string;
|
|
5
|
-
height?: number;
|
|
5
|
+
height?: number | string;
|
|
6
6
|
style?: CSSProperties;
|
|
7
|
-
width?: number;
|
|
7
|
+
width?: number | string;
|
|
8
8
|
}
|
|
9
9
|
declare const LogoSpline: import("react").NamedExoticComponent<LogoSplineProps>;
|
|
10
10
|
export default LogoSpline;
|
|
@@ -7,10 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import Spline from '@splinetool/react-spline';
|
|
8
8
|
import { useThemeMode } from 'antd-style';
|
|
9
9
|
import { memo, useState } from 'react';
|
|
10
|
-
import
|
|
11
|
-
import { useCdnFn } from "../ConfigProvider";
|
|
12
|
-
import Img from "../Img";
|
|
13
|
-
import { LOGO_3D } from "../Logo/style";
|
|
10
|
+
import Loading from "./Loading";
|
|
14
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
13
|
var LIGHT = 'https://gw.alipayobjects.com/os/kitchen/J9jiHITGrs/scene.splinecode';
|
|
@@ -18,49 +15,29 @@ var DARK = 'https://gw.alipayobjects.com/os/kitchen/CzQKKvSE8a/scene.splinecode'
|
|
|
18
15
|
var LogoSpline = /*#__PURE__*/memo(function (_ref) {
|
|
19
16
|
var className = _ref.className,
|
|
20
17
|
style = _ref.style,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_ref$height = _ref.height,
|
|
24
|
-
height = _ref$height === void 0 ? 400 : _ref$height,
|
|
18
|
+
width = _ref.width,
|
|
19
|
+
height = _ref.height,
|
|
25
20
|
_onLoad = _ref.onLoad,
|
|
26
21
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
-
var genCdnUrl = useCdnFn();
|
|
28
22
|
var _useThemeMode = useThemeMode(),
|
|
29
23
|
isDarkMode = _useThemeMode.isDarkMode;
|
|
30
24
|
var _useState = useState(true),
|
|
31
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
26
|
loading = _useState2[0],
|
|
33
27
|
setLoading = _useState2[1];
|
|
34
|
-
return /*#__PURE__*/_jsxs(
|
|
35
|
-
align: 'center',
|
|
28
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
36
29
|
className: className,
|
|
37
|
-
flex: 'none',
|
|
38
|
-
justify: 'center',
|
|
39
30
|
style: _objectSpread({
|
|
40
31
|
height: height,
|
|
41
|
-
overflow: 'hidden',
|
|
42
32
|
position: 'relative',
|
|
43
33
|
width: width
|
|
44
34
|
}, style),
|
|
45
|
-
children: [loading && /*#__PURE__*/_jsx(
|
|
46
|
-
alt: 'logo',
|
|
47
|
-
height: height * 0.5,
|
|
48
|
-
src: genCdnUrl(LOGO_3D),
|
|
49
|
-
style: {
|
|
50
|
-
position: 'absolute'
|
|
51
|
-
},
|
|
52
|
-
width: height * 0.5
|
|
53
|
-
}), /*#__PURE__*/_jsx(Spline, _objectSpread({
|
|
35
|
+
children: [loading && /*#__PURE__*/_jsx(Loading, {}), /*#__PURE__*/_jsx(Spline, _objectSpread({
|
|
54
36
|
onLoad: function onLoad(splineApp) {
|
|
55
37
|
setLoading(false);
|
|
56
38
|
_onLoad === null || _onLoad === void 0 || _onLoad(splineApp);
|
|
57
39
|
},
|
|
58
|
-
scene: isDarkMode ? DARK : LIGHT
|
|
59
|
-
style: {
|
|
60
|
-
flex: 'none',
|
|
61
|
-
height: height,
|
|
62
|
-
width: width
|
|
63
|
-
}
|
|
40
|
+
scene: isDarkMode ? DARK : LIGHT
|
|
64
41
|
}, rest))]
|
|
65
42
|
});
|
|
66
43
|
});
|