Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding reverse shares' shares a clickable link (copy) #178

Merged
merged 2 commits into from
Jul 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions frontend/src/pages/account/reverseShares.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Accordion,
ActionIcon,
Anchor,
Box,
Button,
Center,
Expand Down Expand Up @@ -34,6 +35,8 @@ const MyShares = () => {

const [reverseShares, setReverseShares] = useState<MyReverseShare[]>();

const appUrl = config.get("general.appUrl");

const getReverseShares = () => {
shareService
.getMyReverseShares()
Expand Down Expand Up @@ -119,19 +122,19 @@ const MyShares = () => {
<Accordion.Panel>
{reverseShare.shares.map((share) => (
<Group key={share.id} mb={4}>
<Text maw={120} truncate>
{share.id}
</Text>
<Anchor href={`${appUrl}/share/${share.id}`}>
<Text maw={120} truncate>
{share.id}
</Text>
</Anchor>
<ActionIcon
color="victoria"
variant="light"
size={25}
onClick={() => {
if (window.isSecureContext) {
clipboard.copy(
`${config.get(
"general.appUrl"
)}/share/${share.id}`
`${appUrl}/share/${share.id}`
);
toast.success(
"The share link was copied to the keyboard."
Expand Down