diff --git a/app/frontend/src/javascript/components/editorial-block/editorial-block.tsx b/app/frontend/src/javascript/components/editorial-block/editorial-block.tsx index 69259a910..27cb63736 100644 --- a/app/frontend/src/javascript/components/editorial-block/editorial-block.tsx +++ b/app/frontend/src/javascript/components/editorial-block/editorial-block.tsx @@ -6,19 +6,30 @@ import { FabButton } from '../base/fab-button'; declare const Application: IApplication; +interface EditorialBlockProps { + text: string, + cta?: string, + url?: string +} + /** * Display a editorial text block with an optional cta button */ -export const EditorialBlock: React.FC = () => { +export const EditorialBlock: React.FC = ({ text, cta, url }) => { + /** Link to url from props */ + const linkTo = (): void => { + window.location.href = url; + }; + return ( -
-
Lorem ipsum

sit amet consectetur adipisicing elit. Voluptates, possimus excepturi deleniti sed pariatur sint.

' }}>
- CTA label +
25 ? 'long-cta' : ''}`}> +
+ {cta && {cta}}
); }; -const EditorialBlockWrapper: React.FC = (props) => { +const EditorialBlockWrapper: React.FC = ({ ...props }) => { return ( @@ -26,4 +37,4 @@ const EditorialBlockWrapper: React.FC = (props) => { ); }; -Application.Components.component('editorialBlock', react2angular(EditorialBlockWrapper, [])); +Application.Components.component('editorialBlock', react2angular(EditorialBlockWrapper, ['text', 'cta', 'url'])); diff --git a/app/frontend/src/javascript/components/machines/machines-list.tsx b/app/frontend/src/javascript/components/machines/machines-list.tsx index 31a246249..76d59e97d 100644 --- a/app/frontend/src/javascript/components/machines/machines-list.tsx +++ b/app/frontend/src/javascript/components/machines/machines-list.tsx @@ -98,7 +98,10 @@ export const MachinesList: React.FC = ({ onError, onSuccess,
{/* TODO: Condition to display editorial block */} {false && - + Lorem ipsum dolor sit amet

Consectetur adipiscing elit. In eget eros sed odio tristique cursus. Quisque pretium tortor vel lorem tempor, eu egestas lorem laoreet. Pellentesque arcu lectus, rutrum eu volutpat nec, luctus eget sapien. Sed ligula tortor, blandit eget purus sit sed.

'} + cta={'Pif paf pouf'} + url={'https://www.plop.io'} /> }
diff --git a/app/frontend/src/javascript/components/trainings/trainings-settings.tsx b/app/frontend/src/javascript/components/trainings/trainings-settings.tsx index 5021192f8..6cdc35d74 100644 --- a/app/frontend/src/javascript/components/trainings/trainings-settings.tsx +++ b/app/frontend/src/javascript/components/trainings/trainings-settings.tsx @@ -119,7 +119,7 @@ export const TrainingsSettings: React.FC = () => { rules={{ required: isActiveAuthorizationValidity, min: 1 }} step={1} formState={formState} - label={t('app.admin.trainings_settings.authorization_validity_duration')} /> + label={t('app.admin.trainings_settings.authorization_validity_period')} /> }
diff --git a/app/frontend/src/stylesheets/modules/base/editorial-block.scss b/app/frontend/src/stylesheets/modules/base/editorial-block.scss index 286e11b20..e46d782be 100644 --- a/app/frontend/src/stylesheets/modules/base/editorial-block.scss +++ b/app/frontend/src/stylesheets/modules/base/editorial-block.scss @@ -8,11 +8,18 @@ border: 1px solid var(--gray-soft-dark); border-radius: var(--border-radius); @include editor; + button { white-space: normal; } @media (min-width: 540px) { flex-direction: row; justify-content: space-between; align-items: flex-end; + button { white-space: nowrap; } + &.long-cta { + flex-direction: column; + align-items: flex-start; + button { margin-left: auto; } + } } @media (min-width: 1200px) { width: 50%; diff --git a/app/frontend/src/stylesheets/modules/base/fab-button.scss b/app/frontend/src/stylesheets/modules/base/fab-button.scss index 1f5cbea32..1a6e06508 100644 --- a/app/frontend/src/stylesheets/modules/base/fab-button.scss +++ b/app/frontend/src/stylesheets/modules/base/fab-button.scss @@ -1,5 +1,5 @@ .fab-button { - height: 38px; + min-height: 38px; margin-bottom: 0; padding: 6px 12px; display: inline-flex; diff --git a/app/frontend/templates/admin/machines/index.html b/app/frontend/templates/admin/machines/index.html index 3e9c36fc9..389c94674 100644 --- a/app/frontend/templates/admin/machines/index.html +++ b/app/frontend/templates/admin/machines/index.html @@ -11,9 +11,9 @@
- +