Skip to content

Commit

Permalink
Add link to doc for resync (#2047)
Browse files Browse the repository at this point in the history
Adds a link to resync peerdb documentation:
PeerDB-io/docs#174

Also keeps the close resync button enabled
  • Loading branch information
Amogh-Bharadwaj authored Sep 5, 2024
1 parent af67431 commit 93f2170
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions ui/components/ResyncDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import { Button } from '@/lib/Button';
import { Dialog, DialogClose } from '@/lib/Dialog';
import { Label } from '@/lib/Label';
import { Divider } from '@tremor/react';
import Link from 'next/link';
import { useState } from 'react';
import { BarLoader, DotLoader } from 'react-spinners';

type ResyncDialogProps = {
mirrorName: string;
};

const resyncDocLink = 'https://docs.peerdb.io/features/resync-mirror';

export const ResyncDialog = ({ mirrorName }: ResyncDialogProps) => {
const [syncing, setSyncing] = useState(false);
const [msg, setMsg] = useState<{
Expand Down Expand Up @@ -73,6 +76,18 @@ export const ResyncDialog = ({ mirrorName }: ResyncDialogProps) => {
<br></br>
This involves <b>dropping the existing mirror</b> and recreating it
with initial load.
<Label
as={Link}
target='_blank'
style={{
color: 'teal',
cursor: 'pointer',
width: 'fit-content',
}}
href={resyncDocLink}
>
Learn more
</Label>
</Label>
<div style={{ display: 'flex', alignItems: 'center' }}>
{syncing && <DotLoader size={15} />}
Expand All @@ -87,10 +102,7 @@ export const ResyncDialog = ({ mirrorName }: ResyncDialogProps) => {
</div>
<div style={{ display: 'flex', marginTop: '1rem' }}>
<DialogClose>
<Button
disabled={syncing}
style={{ backgroundColor: '#6c757d', color: 'white' }}
>
<Button style={{ backgroundColor: '#6c757d', color: 'white' }}>
{msg.color === 'positive' ? 'Close' : 'Cancel'}
</Button>
</DialogClose>
Expand Down

0 comments on commit 93f2170

Please sign in to comment.