mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-16 23:31:19 +03:00
Only show share and embed if public or unlisted
Also slight refactor
This commit is contained in:
parent
8b36cef510
commit
8cab77415e
1 changed files with 6 additions and 3 deletions
|
@ -711,6 +711,8 @@ function Status({
|
||||||
}
|
}
|
||||||
|
|
||||||
const actionsRef = useRef();
|
const actionsRef = useRef();
|
||||||
|
const isPublic = ['public', 'unlisted'].includes(visibility);
|
||||||
|
const isPinnable = ['public', 'unlisted', 'private'].includes(visibility);
|
||||||
const StatusMenuItems = (
|
const StatusMenuItems = (
|
||||||
<>
|
<>
|
||||||
{isSizeLarge && (
|
{isSizeLarge && (
|
||||||
|
@ -916,7 +918,8 @@ function Status({
|
||||||
<Icon icon="link" />
|
<Icon icon="link" />
|
||||||
<span>Copy</span>
|
<span>Copy</span>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
{navigator?.share &&
|
{isPublic &&
|
||||||
|
navigator?.share &&
|
||||||
navigator?.canShare?.({
|
navigator?.canShare?.({
|
||||||
url,
|
url,
|
||||||
}) && (
|
}) && (
|
||||||
|
@ -937,7 +940,7 @@ function Status({
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{isSizeLarge && (
|
{isPublic && isSizeLarge && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowEmbed(true);
|
setShowEmbed(true);
|
||||||
|
@ -980,7 +983,7 @@ function Status({
|
||||||
)}
|
)}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
{isSelf && /(public|unlisted|private)/i.test(visibility) && (
|
{isSelf && isPinnable && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue