|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
import { setTimeout } from 'timers';
|
|
|
|
|
import { CheckIcon, DocumentDuplicateIcon } from '@heroicons/react/20/solid';
|
|
|
|
|
import { BookmarkSquareIcon, EyeIcon } from '@heroicons/react/24/outline';
|
|
|
|
|
import { Button, TextInput } from '@tih/ui';
|
|
|
|
|
// Import { useState } from 'react';
|
|
|
|
|
// import { setTimeout } from 'timers';
|
|
|
|
|
import { DocumentDuplicateIcon } from '@heroicons/react/20/solid';
|
|
|
|
|
import { EyeIcon } from '@heroicons/react/24/outline';
|
|
|
|
|
import { Button, TextInput, useToast } from '@tih/ui';
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
copyProfileLink,
|
|
|
|
@ -20,18 +20,18 @@ export default function OffersProfileSave({
|
|
|
|
|
profileId,
|
|
|
|
|
token,
|
|
|
|
|
}: OfferProfileSaveProps) {
|
|
|
|
|
const [linkCopied, setLinkCopied] = useState(false);
|
|
|
|
|
const [isSaving, setSaving] = useState(false);
|
|
|
|
|
const [isSaved, setSaved] = useState(false);
|
|
|
|
|
const { showToast } = useToast();
|
|
|
|
|
// Const [isSaving, setSaving] = useState(false);
|
|
|
|
|
// const [isSaved, setSaved] = useState(false);
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const saveProfile = () => {
|
|
|
|
|
setSaving(true);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
setSaving(false);
|
|
|
|
|
setSaved(true);
|
|
|
|
|
}, 5);
|
|
|
|
|
};
|
|
|
|
|
// Const saveProfile = () => {
|
|
|
|
|
// setSaving(true);
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// setSaving(false);
|
|
|
|
|
// setSaved(true);
|
|
|
|
|
// }, 5);
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex w-full justify-center">
|
|
|
|
@ -44,7 +44,7 @@ export default function OffersProfileSave({
|
|
|
|
|
To keep you offer profile strictly anonymous, only people who have the
|
|
|
|
|
link below can edit it.
|
|
|
|
|
</p>
|
|
|
|
|
<div className="mb-5 grid grid-cols-12 gap-4">
|
|
|
|
|
<div className="mb-20 grid grid-cols-12 gap-4">
|
|
|
|
|
<div className="col-span-11">
|
|
|
|
|
<TextInput
|
|
|
|
|
disabled={true}
|
|
|
|
@ -59,17 +59,15 @@ export default function OffersProfileSave({
|
|
|
|
|
label="Copy"
|
|
|
|
|
variant="primary"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
copyProfileLink(profileId, token), setLinkCopied(true);
|
|
|
|
|
copyProfileLink(profileId, token);
|
|
|
|
|
showToast({
|
|
|
|
|
title: `Profile edit link copied to clipboard!`,
|
|
|
|
|
variant: 'success',
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="mb-20">
|
|
|
|
|
{linkCopied && (
|
|
|
|
|
<p className="text-purple-700">Link copied to clipboard!</p>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p className="mb-5 text-gray-900">
|
|
|
|
|
{/* <p className="mb-5 text-gray-900">
|
|
|
|
|
If you do not want to keep the edit link, you can opt to save this
|
|
|
|
|
profile under your user account. It will still only be editable by
|
|
|
|
|
you.
|
|
|
|
@ -83,7 +81,7 @@ export default function OffersProfileSave({
|
|
|
|
|
variant="primary"
|
|
|
|
|
onClick={saveProfile}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div> */}
|
|
|
|
|
<div>
|
|
|
|
|
<Button
|
|
|
|
|
icon={EyeIcon}
|
|
|
|
|