Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
Binary file added public/images/mobiles-imulator-container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Meta, StoryObj } from "@storybook/react";

import MobileSimulatorContainer from ".";

const meta: Meta<typeof MobileSimulatorContainer> = {
component: MobileSimulatorContainer,
decorators: [
// MARK: 当需要进行自定义Block容器时 在此处定义
(Story) => {
return (
<div className="w-full min-h-96 mx-auto flex justify-center items-center">
<Story />
</div>
);
},
],
};

type MobileSimulatorContainerStory = StoryObj<typeof meta>;

export const Dark: MobileSimulatorContainerStory = {
args: {
className: "",
children: "",
},
};

export default meta;
27 changes: 27 additions & 0 deletions src/components/MobileSimulatorContainer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import "./style.css";

/**
* @name MobileSimulatorContainerProps
* @description MobileSimulatorContainer 组件的属性
* @param {string} className - 类名
* @param {React.CSSProperties} style - 样式
*/
export type MobileSimulatorContainerProps = {
style?: React.CSSProperties;
className?: string;
children?: JSX.Element | JSX.Element[] | React.ReactNode | React.ReactNode[];
};

/**
* @name 容器组件
*/
const MobileSimulatorContainer = (props: MobileSimulatorContainerProps) => {
const { className, style, children } = props;
return (
<div className={`mobile ${className}`} style={style}>
<div className="mobile-content">{children}</div>
</div>
);
};

export default MobileSimulatorContainer;
26 changes: 26 additions & 0 deletions src/components/MobileSimulatorContainer/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.mobile {
height: 500px;
min-width: 300px;
background-image: url("/images/mobiles-imulator-container.png");
background-size: contain;
background-repeat: no-repeat;
position: relative;
}

.mobile-content {
position: absolute;
left: 40px;
top: 55px;
font-size: 14px;
word-break: break-all;
line-height: 1.6;
width: 190px;
height: 405px;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
}

.mobile-content::-webkit-scrollbar {
display: none;
}
Loading