From d480faf60ba1c2bcb4f8a9482470e38bdb4f51d3 Mon Sep 17 00:00:00 2001 From: Antoine Clausse Date: Wed, 25 Sep 2024 12:09:42 +0200 Subject: [PATCH] [web] Make the welcome page cards all have the same widths (implementation 2) (#20570) * welcome page adjusted columns in BS5 * [web] Fix card color * [web] Fixup card width in BS3 * [web] Fix lint * [web] Fix cards text color in BS3 * [web] Fix cards positioning in BS3 * [web] Prevent cards from becoming too large on big screens --------- Co-authored-by: Ilkin Ismailov GitOrigin-RevId: 9b91c073a62dae7cad4402908a34f9880ecdb0ac --- ...me-message-create-new-project-dropdown.tsx | 142 +++++++++--------- .../welcome-message-link.tsx | 32 ++-- .../stylesheets/app/project-list-react.less | 17 ++- .../bootstrap-5/pages/project-list.scss | 17 ++- 4 files changed, 121 insertions(+), 87 deletions(-) diff --git a/services/web/frontend/js/features/project-list/components/welcome-message-new/welcome-message-create-new-project-dropdown.tsx b/services/web/frontend/js/features/project-list/components/welcome-message-new/welcome-message-create-new-project-dropdown.tsx index 13ad86cc84..be5455b7c1 100644 --- a/services/web/frontend/js/features/project-list/components/welcome-message-new/welcome-message-create-new-project-dropdown.tsx +++ b/services/web/frontend/js/features/project-list/components/welcome-message-new/welcome-message-create-new-project-dropdown.tsx @@ -126,85 +126,91 @@ function WelcomeMessageCreateNewProjectDropdown({ return ( -

{t('create_a_new_project')}

- - {showDropdown && ( -
- - - - {isOverleaf && ( +
+
+

{t('create_a_new_project')}

+ + {showDropdown && ( +
+ - )} - {portalTemplates.length > 0 ? ( - <> -
-
- {t('institution_templates')} -
- {portalTemplates?.map((portalTemplate, index) => ( - - handlePortalTemplateClick(e, portalTemplate.name) - } - > - {portalTemplate.name} - - ))} - - ) : null} -
- )} + + {isOverleaf && ( + + )} + {portalTemplates.length > 0 ? ( + <> +
+
+ {t('institution_templates')} +
+ {portalTemplates?.map((portalTemplate, index) => ( + + handlePortalTemplateClick(e, portalTemplate.name) + } + > + {portalTemplate.name} + + ))} + + ) : null} +
+ )} +
} bs5={ - + -

{title}

- - + ) } diff --git a/services/web/frontend/stylesheets/app/project-list-react.less b/services/web/frontend/stylesheets/app/project-list-react.less index aa70b2ac8c..1716aa433c 100644 --- a/services/web/frontend/stylesheets/app/project-list-react.less +++ b/services/web/frontend/stylesheets/app/project-list-react.less @@ -98,6 +98,16 @@ } } + .welcome-message-card-item { + display: flex; + flex: 1; + flex-direction: column; + + @media (min-width: @screen-md-min) { + flex: 0 1 310px; + } + } + .welcome-message-card { border: 1px solid @neutral-20; border-radius: 16px; @@ -115,6 +125,7 @@ @media (min-width: @screen-md-min) { margin: 0 15px; height: 240px; + width: auto; } &:hover { @@ -122,6 +133,8 @@ } .welcome-message-card-img { + max-width: 100%; + @media (min-width: @screen-md-min) { margin-bottom: 20px; } @@ -159,7 +172,7 @@ } > a { - color: @ol-blue-gray-3; + color: @gray-dark; display: block; &:hover { @@ -179,7 +192,7 @@ &, &:hover { text-decoration: none; - color: @ol-blue-gray-3; + color: @gray-dark; } } } diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/project-list.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/project-list.scss index a9fc0f7127..8b775fe8ca 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/pages/project-list.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/project-list.scss @@ -115,7 +115,6 @@ justify-content: space-between; padding: var(--spacing-08) var(--spacing-06); margin: var(--spacing-05) 0; - width: 280px; height: 200px; position: relative; cursor: pointer; @@ -130,12 +129,26 @@ } .welcome-message-card-img { + max-width: 100%; + @include media-breakpoint-up(lg) { margin-bottom: var(--spacing-07); } } } + .welcome-message-card-item { + display: flex; + flex: 1; + flex-direction: column; + width: 280px; + + @include media-breakpoint-up(lg) { + flex: 0 1 312px; + width: auto; + } + } + .create-new-project-dropdown { transform: none !important; top: 100% !important; @@ -156,7 +169,7 @@ &, &:hover { text-decoration: none; - color: $neutral-60; + color: var(--bs-body-color); } } }