Skip to content
Merged
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
17 changes: 11 additions & 6 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, ButtonProps } from "antd";
import { Button, ButtonProps } from "@mui/material";
import colors from "../styles/colors";
import { useAtom } from "jotai";
import { currentNameSpace } from "../atoms/namespace";
Expand All @@ -19,14 +19,19 @@ interface IAletheiaButtonProps extends AletheiaButtonProps {
type?: ButtonType;
event?: any;
rounded?: string;
loading?: boolean;
htmlType?: "button" | "submit" | "reset";
icon?: any;
target?: "_blank" | "_self" | "_parent" | "_top";
}

const AletheiaButton: (props: IAletheiaButtonProps) => JSX.Element = (
props: IAletheiaButtonProps
) => {
const AletheiaButton: React.FC<IAletheiaButtonProps> = (props) => {
const { children, type, rounded, htmlType, style, ...restProps } = props;

const [nameSpace] = useAtom(currentNameSpace);

const [backgroundColor, setBackgroundColor] = useState(colors.primary);

useLayoutEffect(() => {
setBackgroundColor(
nameSpace === NameSpaceEnum.Main
Expand Down Expand Up @@ -98,8 +103,8 @@ const AletheiaButton: (props: IAletheiaButtonProps) => JSX.Element = (
}

return (
<Button {...props} type="default" style={buttonStyle}>
{props.children}
<Button type={htmlType || "button"} variant="outlined" style={buttonStyle} {...restProps}>
{children}
</Button>
);
};
Expand Down
Loading