Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Daily Thought App
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COM3014-Coursework
Daily Thought App
Commits
afa039b5
Commit
afa039b5
authored
2 years ago
by
Matt Kirby
Browse files
Options
Downloads
Patches
Plain Diff
Moved answer card to its own component
parent
ae335374
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
create "Basic components"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
daily-thought-frontend/src/components/post/AnswerCard.tsx
+55
-0
55 additions, 0 deletions
daily-thought-frontend/src/components/post/AnswerCard.tsx
with
55 additions
and
0 deletions
daily-thought-frontend/src/components/post/AnswerCard.tsx
0 → 100644
+
55
−
0
View file @
afa039b5
import
{
Post
}
from
"
@/types/post
"
import
{
FC
,
PropsWithChildren
}
from
"
react
"
import
{
Bars3Icon
,
HeartIcon
,
ChatBubbleLeftIcon
}
from
'
@heroicons/react/24/outline
'
import
LikeStack
from
"
./LikeStack
"
import
Comment
from
"
../comments/Comment
"
type
AnswerCardProps
=
{
post
:
Post
;
commentLimit
:
number
;
}
const
AnswerCard
:
FC
<
PropsWithChildren
<
AnswerCardProps
>>
=
({
post
,
commentLimit
})
=>
{
return
(
<
div
className
=
"flex-1 rounded-3xl bg-white text-lg shadow-lg overflow-hidden"
>
<
div
className
=
"p-4"
>
<
p
className
=
"text-sm text-gray-600"
>
{
`
${
post
.
User
.
Name
}
's answer`
}
</
p
>
<
div
>
This is my super duper answer. My name is Timmy C and I enjoy smooth jazz.
</
div
>
<
div
className
=
"mt-2 flex "
>
<
div
className
=
"flex-1"
>
<
button
type
=
"button"
className
=
"ml-auto mr-2 flex-shrink-0 rounded-full bg-white p-1 text-c-pink hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-c-pink"
>
<
span
className
=
"sr-only"
>
View notifications
</
span
>
<
HeartIcon
className
=
"h-6 w-6"
aria-hidden
=
"true"
/>
</
button
>
<
button
type
=
"button"
className
=
"ml-auto mr-2 flex-shrink-0 rounded-full bg-white p-1 text-c-pink hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-c-pink"
>
<
span
className
=
"sr-only"
>
View notifications
</
span
>
<
ChatBubbleLeftIcon
className
=
"h-6 w-6"
aria-hidden
=
"true"
/>
</
button
>
</
div
>
<
LikeStack
Users
=
{
[]
}
/>
</
div
>
</
div
>
<
div
className
=
"border-t bg-gray-50 p-2"
>
<
p
className
=
"text-xs text-gray-500 hover:text-c-pink"
>
View all 3 comments
</
p
>
<
Comment
Comment
=
{
{
Data
:
"
asdfg
"
,
User
:
post
.
User
}
}
/>
</
div
>
</
div
>
)
}
export
default
AnswerCard
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment