diff --git a/public/images/mobiles-imulator-container.png b/public/images/mobiles-imulator-container.png new file mode 100644 index 0000000..2e5dace Binary files /dev/null and b/public/images/mobiles-imulator-container.png differ diff --git a/src/components/MobileSimulatorContainer/MobileSimulatorContainer.stories.tsx b/src/components/MobileSimulatorContainer/MobileSimulatorContainer.stories.tsx new file mode 100644 index 0000000..0b478ad --- /dev/null +++ b/src/components/MobileSimulatorContainer/MobileSimulatorContainer.stories.tsx @@ -0,0 +1,28 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import MobileSimulatorContainer from "."; + +const meta: Meta = { + component: MobileSimulatorContainer, + decorators: [ + // MARK: 当需要进行自定义Block容器时 在此处定义 + (Story) => { + return ( +
+ +
+ ); + }, + ], +}; + +type MobileSimulatorContainerStory = StoryObj; + +export const Dark: MobileSimulatorContainerStory = { + args: { + className: "", + children: "", + }, +}; + +export default meta; diff --git a/src/components/MobileSimulatorContainer/index.tsx b/src/components/MobileSimulatorContainer/index.tsx new file mode 100644 index 0000000..39f81f6 --- /dev/null +++ b/src/components/MobileSimulatorContainer/index.tsx @@ -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 ( +
+
{children}
+
+ ); +}; + +export default MobileSimulatorContainer; diff --git a/src/components/MobileSimulatorContainer/style.css b/src/components/MobileSimulatorContainer/style.css new file mode 100644 index 0000000..0dc6d6c --- /dev/null +++ b/src/components/MobileSimulatorContainer/style.css @@ -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; +}