Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Block Explorer UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
Block Explorer UI
Commits
0b2b19e3
Commit
0b2b19e3
authored
3 months ago
by
Lukas
Browse files
Options
Downloads
Patches
Plain Diff
Update post card with properties button added to card footer
parent
972ee48f
No related branches found
No related tags found
1 merge request
!504
Lbudginas/#404 part1 create post properties on post page
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/post/PostContentCard.tsx
+32
-5
32 additions, 5 deletions
components/post/PostContentCard.tsx
with
32 additions
and
5 deletions
components/post/PostContentCard.tsx
+
32
−
5
View file @
0b2b19e3
import
Link
from
"
next/link
"
;
import
{
ChevronDown
,
ChevronUp
}
from
"
lucide-react
"
;
import
{
formatAndDelocalizeFromTime
}
from
"
@/utils/TimeUtils
"
;
import
{
Card
,
CardHeader
,
CardContent
}
from
"
../ui/card
"
;
import
{
Card
,
CardHeader
,
CardContent
,
CardFooter
}
from
"
../ui/card
"
;
import
{
changeHBDToDollarsDisplay
}
from
"
@/utils/StringUtils
"
;
const
PostContentCard
=
(
data
:
any
)
=>
{
if
(
!
data
||
!
data
.
data
)
return
;
import
Hive
from
"
@/types/Hive
"
;
const
{
category
,
author
,
created
,
body
,
title
,
total_payout_value
}
=
data
.
data
;
interface
PostContentCardProps
{
isPropertiesOpen
:
boolean
;
handlePropertiesToggle
:
()
=>
void
;
data
:
Hive
.
Content
;
}
const
PostContentCard
:
React
.
FC
<
PostContentCardProps
>
=
({
isPropertiesOpen
,
handlePropertiesToggle
,
data
,
})
=>
{
if
(
!
data
)
return
;
const
{
category
,
author
,
created
,
body
,
title
,
total_payout_value
}
=
data
;
return
(
<
Card
className
=
"overflow-hidden pb-0 w-[100%]"
>
<
div
className
=
"flex text-sm justify-between items-center py-1 px-4 border-b-[1px] border-slate-400 bg-rowHover"
>
...
...
@@ -34,6 +45,22 @@ const PostContentCard = (data: any) => {
<
pre
className
=
"text-sm"
>
{
body
}
</
pre
>
</
div
>
</
CardContent
>
<
CardFooter
className
=
"p-0"
>
<
div
className
=
"flex w-full py-2 px-4 border-t-[1px] border-slate-400"
>
<
button
onClick
=
{
handlePropertiesToggle
}
className
=
"flex items-center text-xs p-2 hover:bg-buttonHover"
>
Properties
{
isPropertiesOpen
?
(
<
ChevronUp
className
=
"w-4 ml-1"
/>
)
:
(
<
ChevronDown
className
=
"w-4 ml-1"
/>
)
}
</
button
>
</
div
>
</
CardFooter
>
</
Card
>
);
};
...
...
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