2021-12-11 18:55:57 +09:00
|
|
|
// React
|
2021-05-30 10:44:57 +09:00
|
|
|
import React, { useState, useEffect } from 'react';
|
2021-12-11 18:55:57 +09:00
|
|
|
|
|
|
|
// Font Awesome
|
2021-05-30 10:44:57 +09:00
|
|
|
import { faUserClock } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
|
|
|
|
|
|
export default function Modal() {
|
|
|
|
const [showModal, setShowModal] = React.useState(false);
|
2021-12-11 18:07:22 +09:00
|
|
|
|
2021-05-30 10:44:57 +09:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<button
|
2021-05-30 11:30:22 +09:00
|
|
|
className="bg-pink-600 text-white active:bg-pink-600 font-bold text-sm px-6 py-3 rounded hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
|
2021-05-30 10:44:57 +09:00
|
|
|
type="button"
|
|
|
|
onClick={() => setShowModal(true)}
|
|
|
|
>
|
|
|
|
<FontAwesomeIcon icon={faUserClock} className="w-5 h-5 inline"/> WakaTime
|
|
|
|
</button>
|
|
|
|
{showModal ? (
|
|
|
|
<>
|
|
|
|
<div
|
|
|
|
className="justify-center items-center flex overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none"
|
|
|
|
>
|
|
|
|
<div className="relative mx-auto w-4/5 max-h-1/2 -mt-96 max-w-3xl">
|
|
|
|
{/* Modal content */}
|
|
|
|
<div className="border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none">
|
|
|
|
{/* Modal body */}
|
|
|
|
<div className="relative p-2 flex-auto">
|
|
|
|
<figure><embed src="https://wakatime.com/share/@yude/6f15075a-b9d5-464a-8b4f-545d31933dfb.svg"></embed></figure>
|
|
|
|
</div>
|
|
|
|
{/* Modal footer for close button */}
|
|
|
|
<div className="flex items-center justify-end p-6 border-t border-solid border-blueGray-200 rounded-b">
|
|
|
|
<button
|
2021-05-30 11:30:22 +09:00
|
|
|
className="text-red-500 font-bold uppercase px-6 py-2 text-sm outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
|
2021-05-30 10:44:57 +09:00
|
|
|
type="button"
|
|
|
|
onClick={() => setShowModal(false)}
|
|
|
|
>
|
|
|
|
{close}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|