/* Copyright (C) Click & Push Accessibility, Inc - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written and maintained by the Click & Push Development team * , January 2022 */ import { FontAwesome } from "@expo/vector-icons"; import { format, parseISO } from 'date-fns'; import React, { memo } from "react"; import { SafeAreaView, Text, TouchableOpacity, View } from "react-native"; import { LMComment } from "../hooks/useComments"; import { Landmark } from "../hooks/useLandmarks"; import { authStore } from "../libs/auth/AuthStore"; /** * Props for the {@link Comment} component. */ export interface CommentProps { /** * The [comment]{@link LMComment} object being displayed by the {@link Comment} component. */ comment: LMComment /** * Whether or not this comment is selected and should be highlighted */ selected: boolean focusComment: (id: string) => void startEditingComment: (comment: LMComment) => void deleteComment: (id: string) => void } /** * Component that displays a {@link LMComment} object in a clean format. * @component */ export const Comment: React.FC = ({comment, selected, focusComment: selectComment, startEditingComment: startEditingComment, deleteComment}) => { return ( selectComment(comment.id)}> {comment.poster_name}: {format(parseISO(comment.timestamp.toString()), "MMMM do, yyyy h:mma")} {comment.content} {comment.edited ? Edited : null} {selected && comment.poster == authStore.userId ? startEditingComment(comment)}/> deleteComment(comment.id)}/> : null} )} /** * Props for the {@link LandmarkDetails} component. */ export interface LandmarkDetailsProps { /** * The {@link Landmark} object being displayed/edited in the {@link LandmarkDetails} modal. */ landmark: Landmark | undefined /** * A callback passed from the parent {@link Map} that toggles the visibility of the {@link LandmarkDetails} modal. */ setVisible: (state: boolean) => void; /** * A callback passed from the parent {@link Map} that toggles the ability to edit the {@link Landmark} in {@link LandmarkDetails} modal. */ setEditing: (state: boolean) => void; /** * A flag that determines whether the properties of the {@link Landmark} displayed in the {@link LandmarkDetails} modal can be edited */ editingEnabled: boolean } /** * Component that renders the details of a selected {@link Landmark} and allows the user to edit those details. Contained within a [react-native-modal]{@link https://github.com/react-native-modal/react-native-modal}. * @component * @category Map */ const Home: React.FC = () => { return ( Home placeholder ) } export default memo(Home);