Files
Compass/web/hooks/use-display-options.ts
MartinBraquet a5c4969d48 Introduce new components and utilities: ProfileAvatar, ShareCTAButton, custom video extensions, and responsive hooks.
- 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.
2026-07-27 00:51:20 +02:00

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}
}