[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 <ilkin.ismailov@overleaf.com>
GitOrigin-RevId: 9b91c073a62dae7cad4402908a34f9880ecdb0ac
This commit is contained in:
Antoine Clausse 2024-09-25 12:09:42 +02:00 committed by Copybot
parent e61b157666
commit d480faf60b
4 changed files with 121 additions and 87 deletions

View file

@ -126,6 +126,7 @@ function WelcomeMessageCreateNewProjectDropdown({
return ( return (
<BootstrapVersionSwitcher <BootstrapVersionSwitcher
bs3={ bs3={
<div className="welcome-message-card-item">
<div <div
role="button" role="button"
tabIndex={0} tabIndex={0}
@ -162,7 +163,11 @@ function WelcomeMessageCreateNewProjectDropdown({
</button> </button>
<button <button
onClick={e => onClick={e =>
handleDropdownItemClick(e, 'upload_project', 'upload-project') handleDropdownItemClick(
e,
'upload_project',
'upload-project'
)
} }
> >
{t('upload_project')} {t('upload_project')}
@ -202,9 +207,10 @@ function WelcomeMessageCreateNewProjectDropdown({
</div> </div>
)} )}
</div> </div>
</div>
} }
bs5={ bs5={
<Dropdown> <Dropdown className="welcome-message-card-item">
<DropdownToggle <DropdownToggle
as={CustomDropdownToggle} as={CustomDropdownToggle}
id="create-new-project-dropdown-toggle-btn" id="create-new-project-dropdown-toggle-btn"

View file

@ -14,6 +14,7 @@ export default function WelcomeMessageLink({
onClick, onClick,
}: WelcomeMessageLinkProps) { }: WelcomeMessageLinkProps) {
return ( return (
<div className="welcome-message-card-item">
<a <a
href={href} href={href}
onClick={onClick} onClick={onClick}
@ -29,5 +30,6 @@ export default function WelcomeMessageLink({
aria-hidden="true" aria-hidden="true"
/> />
</a> </a>
</div>
) )
} }

View file

@ -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 { .welcome-message-card {
border: 1px solid @neutral-20; border: 1px solid @neutral-20;
border-radius: 16px; border-radius: 16px;
@ -115,6 +125,7 @@
@media (min-width: @screen-md-min) { @media (min-width: @screen-md-min) {
margin: 0 15px; margin: 0 15px;
height: 240px; height: 240px;
width: auto;
} }
&:hover { &:hover {
@ -122,6 +133,8 @@
} }
.welcome-message-card-img { .welcome-message-card-img {
max-width: 100%;
@media (min-width: @screen-md-min) { @media (min-width: @screen-md-min) {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -159,7 +172,7 @@
} }
> a { > a {
color: @ol-blue-gray-3; color: @gray-dark;
display: block; display: block;
&:hover { &:hover {
@ -179,7 +192,7 @@
&, &,
&:hover { &:hover {
text-decoration: none; text-decoration: none;
color: @ol-blue-gray-3; color: @gray-dark;
} }
} }
} }

View file

@ -115,7 +115,6 @@
justify-content: space-between; justify-content: space-between;
padding: var(--spacing-08) var(--spacing-06); padding: var(--spacing-08) var(--spacing-06);
margin: var(--spacing-05) 0; margin: var(--spacing-05) 0;
width: 280px;
height: 200px; height: 200px;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
@ -130,12 +129,26 @@
} }
.welcome-message-card-img { .welcome-message-card-img {
max-width: 100%;
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {
margin-bottom: var(--spacing-07); 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 { .create-new-project-dropdown {
transform: none !important; transform: none !important;
top: 100% !important; top: 100% !important;
@ -156,7 +169,7 @@
&, &,
&:hover { &:hover {
text-decoration: none; text-decoration: none;
color: $neutral-60; color: var(--bs-body-color);
} }
} }
} }