Merge pull request #363 from ente-io/public-link-changes

Public link changes
This commit is contained in:
Abhinav Kumar 2022-02-06 16:43:34 +05:30 committed by GitHub
commit c801e8225f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 43 additions and 39 deletions

View file

@ -50,7 +50,7 @@ export const Value = styled.div<{ width?: string }>`
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
width: ${(props) => props.width ?? '30%'}; width: ${(props) => props.width ?? '30%'};
text-align: center;
color: #ddd; color: #ddd;
`; `;

View file

@ -50,7 +50,7 @@ const EmptyScreen = styled.div`
} }
`; `;
const PHOTOSWIPE_HASH_SUFFIX = '&photoswipe-opened'; const PHOTOSWIPE_HASH_SUFFIX = '&opened';
interface Props { interface Props {
files: EnteFile[]; files: EnteFile[];

View file

@ -12,7 +12,7 @@ import {
} from 'constants/gallery'; } from 'constants/gallery';
import constants from 'utils/strings/constants'; import constants from 'utils/strings/constants';
import { PublicCollectionGalleryContext } from 'utils/publicCollectionGallery'; import { PublicCollectionGalleryContext } from 'utils/publicCollectionGallery';
import { ENTE_WEBSITE_LINK } from 'constants/publicCollection'; import { ENTE_WEBSITE_LINK } from 'constants/urls';
import { getVariantColor, ButtonVariant } from './pages/gallery/LinkButton'; import { getVariantColor, ButtonVariant } from './pages/gallery/LinkButton';
const A_DAY = 24 * 60 * 60 * 1000; const A_DAY = 24 * 60 * 60 * 1000;

View file

@ -148,7 +148,14 @@ function RenderCreationTime({
<> <>
<Row> <Row>
<Label width="30%">{constants.CREATION_TIME}</Label> <Label width="30%">{constants.CREATION_TIME}</Label>
<Value width={isInEditMode ? '50%' : '60%'}> <Value
width={
!shouldDisableEdits
? isInEditMode
? '50%'
: '60%'
: '70%'
}>
{isInEditMode ? ( {isInEditMode ? (
<EnteDateTimePicker <EnteDateTimePicker
loading={loading} loading={loading}
@ -160,11 +167,11 @@ function RenderCreationTime({
formatDateTime(pickedTime) formatDateTime(pickedTime)
)} )}
</Value> </Value>
{!shouldDisableEdits && (
<Value <Value
width={isInEditMode ? '20%' : '10%'} width={isInEditMode ? '20%' : '10%'}
style={{ cursor: 'pointer', marginLeft: '10px' }}> style={{ cursor: 'pointer', marginLeft: '10px' }}>
{!shouldDisableEdits && {!isInEditMode ? (
(!isInEditMode ? (
<IconButton onClick={openEditMode}> <IconButton onClick={openEditMode}>
<EditIcon /> <EditIcon />
</IconButton> </IconButton>
@ -181,8 +188,9 @@ function RenderCreationTime({
<CloseIcon /> <CloseIcon />
</IconButton> </IconButton>
</> </>
))} )}
</Value> </Value>
)}
</Row> </Row>
</> </>
); );
@ -323,7 +331,7 @@ function RenderFileName({
<Label width="30%">{constants.FILE_NAME}</Label> <Label width="30%">{constants.FILE_NAME}</Label>
{!isInEditMode ? ( {!isInEditMode ? (
<> <>
<Value width="60%"> <Value width={!shouldDisableEdits ? '60%' : '70%'}>
<FreeFlowText> <FreeFlowText>
{getFileTitle(filename, extension)} {getFileTitle(filename, extension)}
</FreeFlowText> </FreeFlowText>
@ -735,11 +743,13 @@ function PhotoSwipe(props: Iprops) {
}} }}
/> />
)} )}
{!props.isSharedCollection && (
<button <button
className="pswp-custom info-btn" className="pswp-custom info-btn"
title={constants.INFO} title={constants.INFO}
onClick={handleOpenInfo} onClick={handleOpenInfo}
/> />
)}
<div className="pswp__preloader"> <div className="pswp__preloader">
<div className="pswp__preloader__icn"> <div className="pswp__preloader__icn">
<div className="pswp__preloader__cut"> <div className="pswp__preloader__cut">
@ -765,6 +775,7 @@ function PhotoSwipe(props: Iprops) {
</div> </div>
</div> </div>
</div> </div>
{!props.isSharedCollection && (
<InfoModal <InfoModal
shouldDisableEdits={props.isSharedCollection} shouldDisableEdits={props.isSharedCollection}
showInfo={showInfo} showInfo={showInfo}
@ -775,6 +786,7 @@ function PhotoSwipe(props: Iprops) {
exif={exif} exif={exif}
scheduleUpdate={scheduleUpdate} scheduleUpdate={scheduleUpdate}
/> />
)}
</> </>
); );
} }

View file

@ -1,3 +1,4 @@
import { ENTE_WEBSITE_LINK } from 'constants/urls';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Button } from 'react-bootstrap'; import { Button } from 'react-bootstrap';
import styled from 'styled-components'; import styled from 'styled-components';
@ -42,17 +43,9 @@ function GoToEnte() {
} }
}; };
const getHookLink = (os: OS) => {
if (os === OS.ANDROID || os === OS.IOS) {
return 'https://ente.io/app';
} else {
return 'https://web.ente.io';
}
};
return ( return (
<Wrapper> <Wrapper>
<ButtonWithLink href={getHookLink(os)}> <ButtonWithLink href={ENTE_WEBSITE_LINK}>
{getButtonText(os)} {getButtonText(os)}
</ButtonWithLink> </ButtonWithLink>
</Wrapper> </Wrapper>

View file

@ -2,5 +2,3 @@ export enum REPORT_REASON {
COPYRIGHT = 'COPYRIGHT', COPYRIGHT = 'COPYRIGHT',
MALICIOUS_CONTENT = 'MALICIOUS_CONTENT', MALICIOUS_CONTENT = 'MALICIOUS_CONTENT',
} }
export const ENTE_WEBSITE_LINK = 'https://ente.io';

View file

@ -0,0 +1 @@
export const ENTE_WEBSITE_LINK = 'https://ente.io';

View file

@ -144,7 +144,7 @@ class PublicCollectionDownloadManager {
} }
const resp = await fetch(getPublicCollectionFileURL(file.id), { const resp = await fetch(getPublicCollectionFileURL(file.id), {
headers: { headers: {
'X-Auth-Token': token, 'X-Auth-Access-Token': token,
}, },
}); });
const reader = resp.body.getReader(); const reader = resp.body.getReader();