Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SelectOption } from '@viaa/avo2-components';
import type { CheckboxProps, SelectOption } from '@viaa/avo2-components';
import { AvoCoreContentPickerType, AvoSearchOrderDirection } from '@viaa/avo2-types';
import { GET_BACKGROUND_COLOR_OPTIONS_ARCHIEF } from '~modules/content-page/const/get-color-options';
import type { FileUploadProps } from '~shared/components/FileUpload/FileUpload';
Expand Down Expand Up @@ -80,6 +80,7 @@ const visualTypeIsImage: ContentBlockField['isVisible'] = (_config, formGroupSta

const INITIAL_TIMELINE_NODE_STATE = (): TimelineNodeBlockComponentState => ({
date: '',
showDate: true,
title: '',
text: '',
visualType: 'NONE',
Expand Down Expand Up @@ -148,6 +149,14 @@ export const TIMELINE_BLOCK_CONFIG = (position = 0): ContentBlockConfig => ({
)
),
},
showDate: {
editorType: ContentBlockEditor.Checkbox,
editorProps: {
label: tText(
'react-admin/modules/content-page/components/blocks/block-timeline/block-timeline___toon-datum'
),
} as CheckboxProps,
},
title: TEXT_FIELD(
{
label: tText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ $object-meta-vertical-padding: variables.$g-spacer-unit * 2;

@include typography.heading-lg;

min-height: 2.6rem; // to avoid that an invisible date would case jumping in styling
line-height: 2.6rem;
color: colors.$color-gray-300;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export const BlockTimeline: FunctionComponent<BlockTimelineProps> = ({
)}
aria-hidden="true"
/>
{formatDateToDayMonthNameYear(node.date, locale)}
{node.showDate && formatDateToDayMonthNameYear(node.date, locale)}
</time>
<div className="c-block-timeline__node-content">
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ export interface MediaItemComponentState {

export interface TimelineNodeBlockComponentState extends MediaItemComponentState {
date: string;
showDate: boolean;
title: string;
text?: string;
visualType: TimelineNodeVisualType;
Expand Down