mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 12:45:50 +00:00
Return alertTemplate to original state remove non used code
This commit is contained in:
@@ -158,19 +158,6 @@ export function Navbar(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function XrplApexEvent({ message, button, link, show, date }) {
|
|
||||||
const { useTranslate } = useThemeHooks();
|
|
||||||
const { translate } = useTranslate();
|
|
||||||
if (show) {
|
|
||||||
return (
|
|
||||||
<div className="xrpl-apex-event">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function TopNavCollapsible({ children }) {
|
export function TopNavCollapsible({ children }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,55 +1,44 @@
|
|||||||
import * as React from "react";
|
import clsx from 'clsx'
|
||||||
import { useThemeHooks } from "@redocly/theme/core/hooks";
|
import * as React from 'react';
|
||||||
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
||||||
|
|
||||||
const alertStyle: React.CSSProperties = {
|
const alertStyle = {
|
||||||
position: "relative",
|
position: "relative",
|
||||||
margin: "0px",
|
margin: "0px",
|
||||||
zIndex: 9999,
|
zIndex: "9999",
|
||||||
};
|
|
||||||
interface AlertTemplateProps {
|
|
||||||
message: string;
|
|
||||||
link: string;
|
|
||||||
button: string;
|
|
||||||
show: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AlertTemplate({
|
function typeToClass(type: string): string {
|
||||||
message,
|
if(type === "error") {
|
||||||
link,
|
return "alert-danger"
|
||||||
button,
|
} else if(type === "success") {
|
||||||
show,
|
return "alert-success"
|
||||||
}: AlertTemplateProps): React.JSX.Element {
|
} else if(type === "info") {
|
||||||
const { useTranslate } = useThemeHooks();
|
return "alert-info"
|
||||||
const { translate } = useTranslate();
|
} else {
|
||||||
if (!show) return null;
|
return ""
|
||||||
return (
|
}
|
||||||
<div
|
}
|
||||||
className={`web-banner`}
|
|
||||||
style={{ ...alertStyle }}
|
interface AlertTemplateProps {
|
||||||
>
|
message: string
|
||||||
<div className="banner-content">
|
options: {
|
||||||
<div className="event-info">{translate(message)}</div>
|
type: string
|
||||||
<button
|
}
|
||||||
onClick={() => window.open(link, "_blank")}
|
style: any
|
||||||
className="ticket-button"
|
close: any // Callback to close the alert early
|
||||||
>
|
}
|
||||||
<span className="button-text">{translate(button)}</span>
|
|
||||||
<img
|
export default function AlertTemplate ({ message, options, style, close }: AlertTemplateProps): React.JSX.Element {
|
||||||
src="https://cdn.builder.io/api/v1/image/assets/7f21b7559e5f46cebba4373859bcb6b5/bb74a0f169c7bf5ebfe70eabaef024556dd89f9a3e47a03da76851b4f66dab43?apiKey=7f21b7559e5f46cebba4373859bcb6b5&"
|
const { useTranslate } = useThemeHooks();
|
||||||
alt=""
|
const { translate } = useTranslate()
|
||||||
className="button-icon"
|
return(
|
||||||
/>
|
<div className={clsx("bootstrap-growl alert alert-dismissible", typeToClass(options.type))} style={{ ...alertStyle, ...style }}>
|
||||||
</button>
|
<button className="close" data-dismiss="alert" type="button" onClick={close}>
|
||||||
</div>
|
<span aria-hidden="true">×</span>
|
||||||
</div>
|
<span className="sr-only">{translate("Close")}</span>
|
||||||
);
|
</button>
|
||||||
// return(
|
{message}
|
||||||
// <div className={clsx("bootstrap-growl alert alert-dismissible", typeToClass(options.type))} style={{ ...alertStyle, ...style }}>
|
</div>
|
||||||
// <button className="close" data-dismiss="alert" type="button" onClick={close}>
|
)
|
||||||
// <span aria-hidden="true">×</span>
|
|
||||||
// <span className="sr-only">{translate("Close")}</span>
|
|
||||||
// </button>
|
|
||||||
// {message}
|
|
||||||
// </div>
|
|
||||||
// )
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user