فهرست منبع

create AlertDialog component

kaori 3 سال پیش
والد
کامیت
7153b5855e
2فایلهای تغییر یافته به همراه48 افزوده شده و 0 حذف شده
  1. 41 0
      packages/app/src/components/AlertDialog.tsx
  2. 7 0
      packages/app/src/components/BasicLayout.tsx

+ 41 - 0
packages/app/src/components/AlertDialog.tsx

@@ -0,0 +1,41 @@
+import React from 'react';
+
+import {
+  Modal, ModalBody, ModalFooter,
+} from 'reactstrap';
+
+
+type Props = {
+  title: string,
+  message: string,
+  isOpen: boolean,
+  onClose: () => void,
+}
+
+
+export const AlertDialog = (props: Props): JSX.Element => {
+  function handleSubmit() {
+    props.onClose();
+  }
+
+  return (
+    <Modal isOpen={props.isOpen} toggle={props.onClose} id="edit-tag-modal" autoFocus={false}>
+      <ModalBody>
+        <h2>
+          {props.title}
+        </h2>
+        <h4>
+          {props.message}
+        </h4>
+      </ModalBody>
+      <ModalFooter>
+        <button type="button" className="btn btn-primary" onClick={props.onClose}>
+          Cancel
+        </button>
+        <button type="button" className="btn btn-primary" onClick={handleSubmit}>
+          Done
+        </button>
+      </ModalFooter>
+    </Modal>
+  );
+};

+ 7 - 0
packages/app/src/components/BasicLayout.tsx

@@ -49,6 +49,13 @@ export const BasicLayout = ({ children, title, className }: Props): JSX.Element
 
 
       <ShortcutsModal />
       <ShortcutsModal />
       <SystemVersion />
       <SystemVersion />
+
+      {/* Link test */}
+      <Link href="/629581929e61e2a5fe4c64a5">
+        <a>/629581929e61e2a5fe4c64a5</a>
+      </Link>
+      <br />
+      <a href="https://www.google.com/">https://www.google.com/</a>
     </>
     </>
   );
   );
 };
 };