mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-08-01 19:02:58 -04:00
- Added `ProfileAvatar` for consistent avatar rendering across profiles, with fallback initials and gradient backgrounds. - Created `ShareCTAButton` for sharing links with native sharing support and clipboard fallback. - Integrated custom `tiptap` video extension (`tiptap-video`) for video support in rich text editing. - Introduced `useColumnCount` for responsive column count management in dynamic masonry layouts. - Enhanced onboarding flow with refined "Share My Profile" feature using the new share button. - Updated styles and layout in filtered profiles and onboarding screens for better consistency and responsiveness.
27 lines
934 B
TypeScript
27 lines
934 B
TypeScript
import {DisplayOptions, initialDisplayOptions} from 'common/profiles-rendering'
|
|
import {usePersistentLocalState} from 'web/hooks/use-persistent-local-state'
|
|
|
|
export function useDisplayOptions() {
|
|
const [displayOptions, setDisplayOptions] = usePersistentLocalState<DisplayOptions>(
|
|
initialDisplayOptions,
|
|
'rendering-options',
|
|
)
|
|
|
|
const updateDisplayOptions = (newState: Partial<DisplayOptions>) => {
|
|
const updatedState = {...newState}
|
|
setDisplayOptions((prevState) => ({...prevState, ...updatedState}))
|
|
}
|
|
|
|
// useEffect(() => {
|
|
// if (profile && displayOptions.showPhotos === undefined) {
|
|
// const isLookingForRelationship = !!profile?.pref_relation_styles?.includes('relationship')
|
|
// updateDisplayOptions({
|
|
// showAge: isLookingForRelationship,
|
|
// showGender: isLookingForRelationship,
|
|
// })
|
|
// }
|
|
// }, [profile])
|
|
|
|
return {displayOptions, updateDisplayOptions}
|
|
}
|