feat: first commit

This commit is contained in:
eleanor.mao
2025-03-31 22:34:22 +08:00
commit d25187c9c8
390 changed files with 57031 additions and 0 deletions

View File

@ -0,0 +1,32 @@
@import '@/styles/common.less';
@import '@/styles/variables.less';
.common-dialog {
&__container {
display: flex;
flex-direction: column;
align-items: center;
}
&__title {
font-size: 36px;
line-height: 58px;
font-weight: 500;
color: @blColor;
}
&__confirm-button,
&__cancel-button {
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
}
&__confirm-button {
margin-top: 48px;
}
&__cancel-button {
color: @blHighlightColor;
background: transparent;
margin-top: 40px;
}
}

View File

@ -0,0 +1,47 @@
import { Button } from '@tarojs/components';
import { Dialog } from '@taroify/core';
import classNames from 'classnames';
import { PropsWithChildren } from 'react';
import './index.less';
interface IProps extends PropsWithChildren {
visible: boolean;
content: string;
onClose?: () => void;
className?: string;
confirm?: string;
cancel?: string;
onClick?: () => void;
onCancel?: () => void;
}
const PREFIX = 'common-dialog';
function CommonDialog(props: IProps) {
const { visible, content, confirm, cancel, className, children, onClose, onClick, onCancel } = props;
return (
<Dialog className={classNames(PREFIX, className)} open={visible} onClose={onClose}>
<Dialog.Content>
<div className={`${PREFIX}__container`}>
<div className={`${PREFIX}__title`}>{content}</div>
{children}
{confirm && (
<Button className={`${PREFIX}__confirm-button`} onClick={onClick}>
{confirm}
</Button>
)}
{cancel && (
<Button className={`${PREFIX}__cancel-button`} onClick={onCancel}>
{cancel}
</Button>
)}
</div>
</Dialog.Content>
</Dialog>
);
}
export default CommonDialog;