diff --git a/src/Components/MemberCard.js b/src/Components/MemberCard.js index fb67c11f..61587bc4 100644 --- a/src/Components/MemberCard.js +++ b/src/Components/MemberCard.js @@ -12,10 +12,12 @@ import Twemoji from 'react-twemoji'; import API_URL from "../Constants/constants.js"; import defaultAvatar from '../default_discord_avatar.png' -import { FaUser, FaTrashAlt } from "react-icons/fa"; +import { FaLink, FaLock, FaTrashAlt } from "react-icons/fa"; export default function MemberCard(props) { + const system = JSON.parse(localStorage.getItem('user')); + const sysID = system.id; const [member, setMember] = useState(props.member); const [ displayName, setDisplayName ] = useState(""); @@ -200,13 +202,32 @@ export default function MemberCard(props) { }); } + function copyLink() { + var link = `https://spectralitree.github.io/pk-webs/profile/${sysID}/${member.id}` + var textField = document.createElement('textarea') + textField.innerText = link + document.body.appendChild(textField); + + textField.select(); + textField.setSelectionRange(0, 99999); + document.execCommand('copy'); + + document.body.removeChild(textField); + } + return ( memberDeleted ? Member Deleted : +
{ member.visibility === 'public' ? + Copy public link + + }> copyLink()}> : + } { localStorage.getItem('pagesonly') ? - {member.name} ({member.id}) - : {member.name} ({member.id})} + {member.name} ({member.id}) + : {member.name} ({member.id})}
{ member.avatar_url ? } className="avatar" modal> {close => (
close()}> diff --git a/src/Components/MemberPage.js b/src/Components/MemberPage.js index 1f18be98..8c17b9ab 100644 --- a/src/Components/MemberPage.js +++ b/src/Components/MemberPage.js @@ -12,11 +12,13 @@ import API_URL from "../Constants/constants.js"; import history from "../History.js"; import defaultAvatar from '../default_discord_avatar.png' -import { FaUser, FaTrashAlt } from "react-icons/fa"; +import { FaLink, FaLock, FaTrashAlt } from "react-icons/fa"; export default function MemberPage(props) { const [ member, setMember] = useState(props.member); + const system = JSON.parse(localStorage.getItem('user')); + const sysID = system.id; const [ displayName, setDisplayName ] = useState(""); const [ birthday, setBirthday ] = useState(""); @@ -200,6 +202,19 @@ export default function MemberPage(props) { }); } + function copyLink() { + var link = `https://spectralitree.github.io/pk-webs/profile/${sysID}/${member.id}` + var textField = document.createElement('textarea') + textField.innerText = link + document.body.appendChild(textField); + + textField.select(); + textField.setSelectionRange(0, 99999); + document.execCommand('copy'); + + document.body.removeChild(textField); + } + return ( memberDeleted ? Member Deleted @@ -211,7 +226,11 @@ export default function MemberPage(props) {
: "" } - {member.name} ({member.id}) +
{ member.visibility === 'public' ? + Copy public link + + }> copyLink()}> : }{member.name} ({member.id})
{ member.avatar_url ? } className="avatar" modal> {close => (
close()}> diff --git a/src/Components/ProfileCard.js b/src/Components/ProfileCard.js index bb7096bb..bdd95c3b 100644 --- a/src/Components/ProfileCard.js +++ b/src/Components/ProfileCard.js @@ -9,7 +9,7 @@ import LazyLoad from 'react-lazyload'; import Twemoji from 'react-twemoji'; import defaultAvatar from '../default_discord_avatar.png' -import { FaUser } from "react-icons/fa"; +import { FaLink } from "react-icons/fa"; export default function MemberCard(props) { const { sysID } = useParams(); @@ -66,12 +66,30 @@ export default function MemberCard(props) { } else setDesc("(no description)"); }, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags]); + function copyLink() { + var link = `https://spectralitree.github.io/pk-webs/profile/${sysID}/${member.id}` + var textField = document.createElement('textarea') + textField.innerText = link + document.body.appendChild(textField); + + textField.select(); + textField.setSelectionRange(0, 99999); + document.execCommand('copy'); + + document.body.removeChild(textField); + } + return ( +
+ Copy link + + }> copyLink()}> { localStorage.getItem('pagesonly') ? - {member.name} ({member.id}) - : {member.name} ({member.id})} + {member.name} ({member.id}) + : {member.name} ({member.id})}
{ member.avatar_url ? } className="avatar" modal> {close => (
close()}> diff --git a/src/Components/ProfilePage.js b/src/Components/ProfilePage.js index 474e3a36..7019148d 100644 --- a/src/Components/ProfilePage.js +++ b/src/Components/ProfilePage.js @@ -8,7 +8,7 @@ import autosize from 'autosize'; import Twemoji from 'react-twemoji'; import defaultAvatar from '../default_discord_avatar.png' -import { FaUser } from "react-icons/fa"; +import { FaLink } from "react-icons/fa"; export default function ProfilePage(props) { @@ -66,6 +66,19 @@ export default function ProfilePage(props) { } else setDesc("(no description)"); }, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags]); + function copyLink() { + var link = `https://spectralitree.github.io${location.pathname}` + var textField = document.createElement('textarea') + textField.innerText = link + document.body.appendChild(textField); + + textField.select(); + textField.setSelectionRange(0, 99999); + document.execCommand('copy'); + + document.body.removeChild(textField); + } + return ( <> { localStorage.getItem('colorbg') ? "" : member.color ? <>
@@ -73,7 +86,12 @@ export default function ProfilePage(props) { You are currently viewing a member. - {member.name} ({member.id}) +
+ Copy link + + }> copyLink()}> + {member.name} ({member.id})
{ member.avatar_url ? } className="avatar" modal> {close => (
close()}> diff --git a/src/Custom.scss b/src/Custom.scss index 6e22c505..c71b099c 100644 --- a/src/Custom.scss +++ b/src/Custom.scss @@ -13,7 +13,17 @@ html { } body { - padding-bottom: 60px; + position: relative; +} + +.contents { + display: flex; + flex-flow: column; + height: 100vh +} + +.content { + flex: 1; } .opendyslexic { @@ -159,7 +169,7 @@ body { code { color: black !important; background-color: $gray-300; - padding: 5px 7px; + padding: 3px 7px; border-radius: 3px; margin: 3px; display: inline-block; @@ -251,9 +261,7 @@ blockquote { } .footer { - position: absolute !important; width: 100% !important; - bottom: 0px !important; } .dark-mode .page-item:not(.active) .page-link { @@ -289,7 +297,7 @@ blockquote { width: 100%; height: 100%; z-index: -4; - opacity: 0.6; + opacity: 1; } .backdrop-overlay { @@ -307,7 +315,7 @@ blockquote { } .dark-mode .backdrop-overlay { - background: linear-gradient(to bottom, rgba(52, 58, 64, 1) 0%, rgba(255, 255, 255, 0) 100%); + background: linear-gradient(to bottom, rgba(52, 58, 64, 1) 0%, rgba(52, 58, 64, 0) 100%); } @import "~bootstrap/scss/bootstrap";