-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from us3r-network/dashboard-dev
Dashboard dev
- Loading branch information
Showing
36 changed files
with
1,957 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { useCallback, useState } from 'react' | ||
import CopyIcon from './Icons/CopyIcon' | ||
import styled from 'styled-components' | ||
|
||
export default function CopyTint({ data }: { data: string }) { | ||
const [showCopyTint, setShowCopyTint] = useState(false) | ||
const copyId = useCallback(async (appId: string) => { | ||
try { | ||
await navigator.clipboard.writeText(appId) | ||
setShowCopyTint(true) | ||
setTimeout(() => { | ||
setShowCopyTint(false) | ||
}, 2000) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
}, []) | ||
return ( | ||
<CopyBox> | ||
<button | ||
onClick={() => { | ||
copyId(data) | ||
}} | ||
> | ||
<CopyIcon /> | ||
</button> | ||
{showCopyTint && <span>Copied</span>} | ||
</CopyBox> | ||
) | ||
} | ||
|
||
const CopyBox = styled.div` | ||
position: relative; | ||
> span { | ||
position: absolute; | ||
font-size: 13px; | ||
color: inherit; | ||
left: 0; | ||
bottom: -12px; | ||
/* transform: translate(-50%, 50%); */ | ||
} | ||
> button { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.