rename disableEdits to shouldDisableEdits

This commit is contained in:
Abhinav 2022-01-21 20:18:24 +05:30
parent 6b6a75df22
commit 858a494b99

View file

@ -91,11 +91,11 @@ const renderInfoItem = (label: string, value: string | JSX.Element) => (
); );
function RenderCreationTime({ function RenderCreationTime({
disableEdits, shouldDisableEdits,
file, file,
scheduleUpdate, scheduleUpdate,
}: { }: {
disableEdits: boolean; shouldDisableEdits: boolean;
file: EnteFile; file: EnteFile;
scheduleUpdate: () => void; scheduleUpdate: () => void;
}) { }) {
@ -162,7 +162,7 @@ function RenderCreationTime({
<Value <Value
width={isInEditMode ? '20%' : '10%'} width={isInEditMode ? '20%' : '10%'}
style={{ cursor: 'pointer', marginLeft: '10px' }}> style={{ cursor: 'pointer', marginLeft: '10px' }}>
{!disableEdits && {!shouldDisableEdits &&
(!isInEditMode ? ( (!isInEditMode ? (
<IconButton onClick={openEditMode}> <IconButton onClick={openEditMode}>
<EditIcon /> <EditIcon />
@ -278,11 +278,11 @@ const FileNameEditForm = ({ filename, saveEdits, discardEdits, extension }) => {
}; };
function RenderFileName({ function RenderFileName({
disableEdits, shouldDisableEdits,
file, file,
scheduleUpdate, scheduleUpdate,
}: { }: {
disableEdits: boolean; shouldDisableEdits: boolean;
file: EnteFile; file: EnteFile;
scheduleUpdate: () => void; scheduleUpdate: () => void;
}) { }) {
@ -327,7 +327,7 @@ function RenderFileName({
{getFileTitle(filename, extension)} {getFileTitle(filename, extension)}
</FreeFlowText> </FreeFlowText>
</Value> </Value>
{!disableEdits && ( {!shouldDisableEdits && (
<Value <Value
width="10%" width="10%"
style={{ style={{
@ -406,7 +406,7 @@ function ExifData(props: { exif: any }) {
} }
function InfoModal({ function InfoModal({
disableEdits, shouldDisableEdits,
showInfo, showInfo,
handleCloseInfo, handleCloseInfo,
items, items,
@ -430,14 +430,14 @@ function InfoModal({
)} )}
{metadata?.title && ( {metadata?.title && (
<RenderFileName <RenderFileName
disableEdits={disableEdits} shouldDisableEdits={shouldDisableEdits}
file={items[photoSwipe?.getCurrentIndex()]} file={items[photoSwipe?.getCurrentIndex()]}
scheduleUpdate={scheduleUpdate} scheduleUpdate={scheduleUpdate}
/> />
)} )}
{metadata?.creationTime && ( {metadata?.creationTime && (
<RenderCreationTime <RenderCreationTime
disableEdits={disableEdits} shouldDisableEdits={shouldDisableEdits}
file={items[photoSwipe?.getCurrentIndex()]} file={items[photoSwipe?.getCurrentIndex()]}
scheduleUpdate={scheduleUpdate} scheduleUpdate={scheduleUpdate}
/> />
@ -757,7 +757,7 @@ function PhotoSwipe(props: Iprops) {
</div> </div>
</div> </div>
<InfoModal <InfoModal
disableEdits={props.isSharedCollection} shouldDisableEdits={props.isSharedCollection}
showInfo={showInfo} showInfo={showInfo}
handleCloseInfo={handleCloseInfo} handleCloseInfo={handleCloseInfo}
items={items} items={items}