add file count and search type constants

This commit is contained in:
Abhinav 2022-06-02 17:19:59 +05:30
parent 1e9047511c
commit 2214af8983
4 changed files with 21 additions and 5 deletions

View file

@ -37,7 +37,7 @@ export default function AllCollectionCard({
font-weight: 400;
line-height: 20px;
`}>
{collectionSummary.fileCount} {constants.PHOTOS}
{constants.PHOTO_COUNT(collectionSummary.fileCount)}
</Typography>
</div>
</CollectionCard>

View file

@ -38,7 +38,7 @@ export default function collectionInfo(props: Iprops) {
font-size: 14px;
line-height: 20px;
`}>
{fileCount} {constants.PHOTOS}
{constants.PHOTO_COUNT(fileCount)}
</Typography>
</div>
{collectionAttributes.id !== ARCHIVE_SECTION &&

View file

@ -12,6 +12,7 @@ import { FreeFlowText, SpaceBetweenFlex } from 'components/Container';
import CollectionCard from 'components/Collections/CollectionCard';
import { ResultPreviewTile } from 'components/Collections/styledComponents';
import { SelectComponents } from 'react-select/src/components';
import constants from 'utils/strings/constants';
const { Option, Control } = components;
@ -61,7 +62,7 @@ const LabelWithIcon = ({ data }: { data: SearchOption }) => (
line-height: 16px;
`}
mb={1}>
Location
{constants.SEARCH_TYPE(data.type)}
</Typography>
<SpaceBetweenFlex>
<Box mr={1}>
@ -69,7 +70,7 @@ const LabelWithIcon = ({ data }: { data: SearchOption }) => (
<Typography>{data.label}</Typography>
</FreeFlowText>
<Typography color="text.secondary">
{data.fileCount} Photos
{constants.PHOTO_COUNT(data.fileCount)}
</Typography>
</Box>

View file

@ -3,6 +3,7 @@ import Link from '@mui/material/Link';
import { DotSeparator } from 'components/Sidebar/styledComponents';
import React from 'react';
import styled from 'styled-components';
import { SuggestionType } from 'types/search';
/**
* Global English constants.
@ -405,6 +406,21 @@ const englishConstants = {
CREATE_ALBUM_FAILED: 'failed to create album , please try again',
SEARCH_HINT: () => <span>Search for location, dates, themes</span>,
SEARCH_TYPE: (type: SuggestionType) => {
switch (type) {
case SuggestionType.COLLECTION:
return 'Album';
case SuggestionType.LOCATION:
return 'Location';
case SuggestionType.DATE:
return 'Date';
case SuggestionType.IMAGE:
case SuggestionType.VIDEO:
return 'File';
}
},
PHOTO_COUNT: (count: number) =>
`${count === 1 ? `1 Photo` : `${count} Photo`}`,
TERMS_AND_CONDITIONS: () => (
<Typography variant="body2">
I agree to the{' '}
@ -732,7 +748,6 @@ const englishConstants = {
NEW: 'New',
VIEW_ALL_ALBUMS: 'View all Albums',
ALL_ALBUMS: 'All Albums',
PHOTOS: 'Photos',
ENDS: 'Ends',
ENTER_TWO_FACTOR_OTP:
' enter the 6-digit code from your authenticator app.',