fixing my own misspelling of link

This commit is contained in:
Martina 2021-11-23 14:33:09 -08:00
parent 43b87e798c
commit 0554e51edb
3 changed files with 30 additions and 11 deletions

View File

@ -31,7 +31,7 @@ const STYLES_SHARING_BUTTON = (theme) => css`
const getFileURL = ({ file }) => {
const rootUrl = window?.location?.origin;
return `${rootUrl}/_/object/${file.id}`;
return `${rootUrl}/_/view/${file.id}`;
};
function FileSharingButtons({ file, data, viewer }) {
@ -61,16 +61,16 @@ function FileSharingButtons({ file, data, viewer }) {
<>
<button css={STYLES_SHARING_BUTTON} onClick={handleTwitterSharing}>
<SVG.Twitter width={16} />
<System.P2 style={{ marginLeft: 12 }}>Share Via Twitter</System.P2>
<System.P2 style={{ marginLeft: 12 }}>Share via Twitter</System.P2>
</button>
<button css={STYLES_SHARING_BUTTON} onClick={handleEmailSharing}>
<SVG.Mail width={16} />
<System.P2 style={{ marginLeft: 12 }}>Share Via Email </System.P2>
<System.P2 style={{ marginLeft: 12 }}>Share via email </System.P2>
</button>
<button css={STYLES_SHARING_BUTTON} onClick={handleLinkCopy}>
<SVG.Link width={16} />
<System.P2 style={{ marginLeft: 12 }}>
{copyState.isLinkCopied ? "Copied" : "Copy link"}
{copyState.isLinkCopied ? "Copied" : "Copy public link"}
</System.P2>
</button>
<button css={STYLES_SHARING_BUTTON} onClick={handleCidCopy}>
@ -117,7 +117,7 @@ function DownloadButton({ file, viewer, ...props }) {
) : (
<SVG.Download width={16} />
)}
<System.P2 style={{ marginLeft: 12 }}>Download File</System.P2>
<System.P2 style={{ marginLeft: 12 }}>Download file</System.P2>
</button>
</div>
) : null;
@ -163,7 +163,7 @@ export function Share({ file, data, viewer, isOpen, onClose }) {
rel="noreferrer"
>
<SVG.InfoCircle width={16} />
<System.P2 style={{ marginLeft: 4 }}>What is CID?</System.P2>
<System.P2 style={{ marginLeft: 4 }}>What is a CID?</System.P2>
</a>
</Jumper.Item>
</Jumper.Root>

25
package-lock.json generated
View File

@ -63,7 +63,8 @@
"universal-cookie": "^4.0.4",
"uuid": "^8.3.2",
"webpack": "^5.37.1",
"ws": "^7.4.3"
"ws": "^7.4.3",
"zustand": "^3.6.5"
},
"devDependencies": {
"@babel/core": "^7.15.0",
@ -13292,6 +13293,22 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/zustand": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-3.6.5.tgz",
"integrity": "sha512-/WfLJuXiEJimt61KGMHebrFBwckkCHGhAgVXTgPQHl6IMzjqm6MREb1OnDSnCRiSmRdhgdFCctceg6tSm79hiw==",
"engines": {
"node": ">=12.7.0"
},
"peerDependencies": {
"react": ">=16.8"
},
"peerDependenciesMeta": {
"react": {
"optional": true
}
}
},
"node_modules/zwitch": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz",
@ -23725,6 +23742,12 @@
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
},
"zustand": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-3.6.5.tgz",
"integrity": "sha512-/WfLJuXiEJimt61KGMHebrFBwckkCHGhAgVXTgPQHl6IMzjqm6MREb1OnDSnCRiSmRdhgdFCctceg6tSm79hiw==",
"requires": {}
},
"zwitch": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz",

View File

@ -132,10 +132,6 @@ app.prepare().then(async () => {
const id = Utilities.getIdFromCookie(req);
if (!file.isPublic && file.ownerId !== id) {
return res.redirect("/_/404");
}
let viewer = null;
if (id) {
viewer = await ViewerManager.getById({