-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add additionalNotes & responseTextItem component
- Loading branch information
Showing
3 changed files
with
94 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import dayjs from "dayjs"; | ||
import { View, Text } from "react-native"; | ||
|
||
export interface ResponseTextItemProps { | ||
timestamp: dayjs.Dayjs; | ||
textValue: string; | ||
} | ||
|
||
export const ResponseTextItem: React.FC<ResponseTextItemProps> = ({ | ||
timestamp, | ||
textValue, | ||
}) => { | ||
return ( | ||
<View | ||
key={Math.random() * 1000} | ||
className="pb-3 mb-3 border-b-2 border-tint" | ||
> | ||
<Text | ||
numberOfLines={2} | ||
ellipsizeMode="tail" | ||
className="font-sans flex flex-wrap text-white text-base font-medium" | ||
> | ||
{textValue} | ||
</Text> | ||
<View className="flex flex-row gap-x-2 items-center mt-1"> | ||
<Text className="font-sans text-sm text-white opacity-60"> | ||
{dayjs(timestamp).format("dd MMM D, YYYY")} | ||
</Text> | ||
<View className="w-1 h-1 bg-white opacity-60" /> | ||
<Text className="font-sans text-sm text-white opacity-60"> | ||
{dayjs(timestamp).format("h:mma")} | ||
</Text> | ||
</View> | ||
</View> | ||
); | ||
}; |