Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F969914
header-with-image.jdd.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
header-with-image.jdd.tsx
View Options
import
type
{
FlatTemplatable
}
from
"tempstream"
;
import
{
TempstreamJSX
}
from
"tempstream"
;
import
type
{
ExtractStructuredComponentArgumentsParsed
,
JDDContext
,
}
from
"@sealcode/jdd"
;
import
{
Component
,
ComponentArguments
}
from
"@sealcode/jdd"
;
const
component_arguments
=
{
title
:
new
ComponentArguments
.
ShortText
(),
content
:
new
ComponentArguments
.
Markdown
(),
image_with_alt
:
new
ComponentArguments
.
Structured
({
image
:
new
ComponentArguments
.
Image
(),
alt
:
new
ComponentArguments
.
ShortText
(),
}),
button
:
new
ComponentArguments
.
Structured
({
text
:
new
ComponentArguments
.
ShortText
().
setExampleValues
([
""
]),
link
:
new
ComponentArguments
.
ShortText
().
setExampleValues
([
""
]),
}),
}
as
const
;
export
class
HeaderWithImage
extends
Component
<
typeof
component_arguments
>
{
getArguments
()
{
return
component_arguments
;
}
toHTML
(
{
title
,
content
,
image_with_alt
,
button
,
}
:
ExtractStructuredComponentArgumentsParsed
<
typeof
component_arguments
>
,
{
render_markdown
,
render_image
}
:
JDDContext
)
:
FlatTemplatable
{
const
buttonText
=
button
.
text
.
toUpperCase
();
const
titleUpperCase
=
title
.
toUpperCase
();
return
(
<
div
class
=
"header-with-image"
>
<
div
class
=
"container"
>
<
div
class
=
"img-container"
>
{
render_image
(
image_with_alt
.
image
,
{
container
:
{
width
:
600
,
height
:
450
,
objectFit
:
"contain"
},
alt
:
image_with_alt
.
alt
,
// crop: { width: 600, height: 450 },
})}
<
/div>
<
div
class
=
"title-wrapper"
>
<
h2
class
=
"title"
>
{
titleUpperCase
}
<
/h2>
<
/div>
<
div
class
=
"content"
>
{
render_markdown
(
content
)}
<
/div>
{
button
.
text
===
""
?
null
:
(
<
div
class
=
"button-container"
>
<
a
class
=
"button"
href
=
{
button
.
link
}
>
{
buttonText
}
<
/a>
<
/div>
)}
<
/div>
<
/div>
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sun, Nov 24, 02:30 (19 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
548106
Default Alt Text
header-with-image.jdd.tsx (1 KB)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment