mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-01-25 14:18:41 -05:00
Fix stringOrStringArrayToText
This commit is contained in:
@@ -43,6 +43,7 @@ export function DietFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -37,6 +37,7 @@ export function EducationFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -39,6 +39,7 @@ export function InterestFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: options.map((o) => t(`profile.${label}.${toKey(o)}`, o)),
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -46,6 +46,7 @@ export function LanguageFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -42,6 +42,7 @@ export function MbtiFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: displayTypes,
|
||||
capitalizeFirstLetterOption: false,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -47,6 +47,7 @@ export function PoliticalFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -42,6 +42,7 @@ export function RelationshipFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedRelationships,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -46,6 +46,7 @@ export function RelationshipStatusFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -48,6 +48,7 @@ export function ReligionFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -43,6 +43,7 @@ export function RomanticFilterText(props: {
|
||||
{stringOrStringArrayToText({
|
||||
text: convertedTypes,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})}{' '}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -42,6 +42,7 @@ export function AboutRow(props: {
|
||||
suffix?: string | null
|
||||
}) {
|
||||
const {icon, text, preText, suffix} = props
|
||||
const t = useT()
|
||||
if (!text?.length && !preText && !suffix) {
|
||||
return <></>
|
||||
}
|
||||
@@ -55,6 +56,7 @@ export function AboutRow(props: {
|
||||
preText: preText,
|
||||
asSentence: false,
|
||||
capitalizeFirstLetterOption: true,
|
||||
t: t,
|
||||
})
|
||||
}
|
||||
if (suffix) {
|
||||
@@ -150,6 +152,7 @@ function Seeking(props: { profile: Profile }) {
|
||||
preText: t('profile.interested_in', 'Interested in'),
|
||||
asSentence: true,
|
||||
capitalizeFirstLetterOption: false,
|
||||
t: t,
|
||||
})
|
||||
|
||||
const noMin = (min ?? MIN_INT) <= 18
|
||||
@@ -188,6 +191,7 @@ function RelationshipType(props: { profile: Profile }) {
|
||||
preText: t('profile.seeking', 'Seeking'),
|
||||
asSentence: true,
|
||||
capitalizeFirstLetterOption: false,
|
||||
t: t,
|
||||
})
|
||||
if (relationshipTypes?.includes('relationship')) {
|
||||
const romanticStyles = profile.pref_romantic_styles
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {filterDefined} from 'common/util/array'
|
||||
import {useT} from "web/lib/locale";
|
||||
|
||||
export default function stringOrStringArrayToText(fields: {
|
||||
text: string[] | string | null | undefined
|
||||
@@ -7,6 +6,7 @@ export default function stringOrStringArrayToText(fields: {
|
||||
postText?: string
|
||||
asSentence?: boolean
|
||||
capitalizeFirstLetterOption?: boolean
|
||||
t: any
|
||||
}): string | null {
|
||||
const {
|
||||
text,
|
||||
@@ -14,8 +14,8 @@ export default function stringOrStringArrayToText(fields: {
|
||||
postText = '',
|
||||
asSentence,
|
||||
capitalizeFirstLetterOption,
|
||||
t,
|
||||
} = fields
|
||||
const t = useT()
|
||||
|
||||
if (!text || text.length < 1) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user