-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: apply early access changes #3474
Changes from 1 commit
4c440ee
10d5966
7b85bf2
250e552
bd8a2de
f69d7f9
fe851ff
f00fbd0
5d96fb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.EarlyAccessBannerBtn { | ||
&:hover, | ||
&:active { | ||
background-color: var(--bs-rk-green) !important; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use the hover color instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you clarify what you mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Renku V1, that's the button's primary green color (#009568), not the hover color (#007a6c). That is usually imported as |
||
color: var(--bs-white) !important; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,154 @@ | ||||||
/*! | ||||||
* Copyright 2025 - Swiss Data Science Center (SDSC) | ||||||
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and | ||||||
* Eidgenössische Technische Hochschule Zürich (ETHZ). | ||||||
* | ||||||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
* you may not use this file except in compliance with the License. | ||||||
* You may obtain a copy of the License at | ||||||
* | ||||||
* http://www.apache.org/licenses/LICENSE-2.0 | ||||||
* | ||||||
* Unless required by applicable law or agreed to in writing, software | ||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
* See the License for the specific language governing permissions and | ||||||
* limitations under the License. | ||||||
*/ | ||||||
import cx from "classnames"; | ||||||
import { useLocation } from "react-router-dom"; | ||||||
import { Link } from "react-router-dom-v5-compat"; | ||||||
import { Alert, Container } from "reactstrap"; | ||||||
import { Links } from "../../utils/constants/Docs.js"; | ||||||
import { Url } from "../../utils/helpers/url"; | ||||||
import style from "./EarlyAccessBanner.module.scss"; | ||||||
|
||||||
const BANNER_DARK_IMG = "/static/public/img/earlyAccessDark.svg"; | ||||||
const BANNER_LIGHT_IMG = "/static/public/img/earlyAccessLight.svg"; | ||||||
const LOGO_V2 = "/static/public/img/renku2.0Logo.svg"; | ||||||
const LOGO_V2_DARK = "/static/public/img/renku2.0LogoDark.svg"; | ||||||
|
||||||
interface EarlyAccessBannerProps { | ||||||
theme: "dark" | "light"; | ||||||
} | ||||||
|
||||||
export function DashboardBanner({ user }: { user: { logged: boolean } }) { | ||||||
const location = useLocation(); | ||||||
|
||||||
if (location.pathname !== Url.get(Url.pages.landing)) return null; | ||||||
|
||||||
if (user.logged) return <EarlyAccessBanner theme="light" />; | ||||||
|
||||||
return <EarlyAccessBanner theme="dark" />; | ||||||
} | ||||||
|
||||||
export function EarlyAccessBanner({ theme }: EarlyAccessBannerProps) { | ||||||
const themeAssets = { | ||||||
light: { | ||||||
btnStyles: ["bg-rk-blue", "text-rk-white"], | ||||||
bannerStyles: ["bg-white", "text-rk-blue"], | ||||||
dotsImgUrl: BANNER_LIGHT_IMG, | ||||||
logoImgUrl: LOGO_V2_DARK, | ||||||
linkStyle: "text-rk-blue", | ||||||
}, | ||||||
dark: { | ||||||
btnStyles: ["bg-white", "text-rk-blue"], | ||||||
bannerStyles: ["bg-rk-blue", "text-rk-white"], | ||||||
dotsImgUrl: BANNER_DARK_IMG, | ||||||
logoImgUrl: LOGO_V2, | ||||||
linkStyle: "text-white", | ||||||
}, | ||||||
}; | ||||||
|
||||||
const callToActionBtn = ( | ||||||
<Link | ||||||
to="/v2" | ||||||
className={cx( | ||||||
"btn", | ||||||
themeAssets[theme].btnStyles, | ||||||
style.EarlyAccessBannerBtn | ||||||
)} | ||||||
rel="noreferrer noopener" | ||||||
> | ||||||
Try it out | ||||||
</Link> | ||||||
); | ||||||
|
||||||
return ( | ||||||
<Alert | ||||||
className={cx( | ||||||
"border-start-0", | ||||||
"border-end-0", | ||||||
"border-top-0", | ||||||
"border-button-1", | ||||||
"border-white", | ||||||
"rounded-0", | ||||||
"mb-0", | ||||||
"py-3", | ||||||
themeAssets[theme].bannerStyles | ||||||
)} | ||||||
fade={false} | ||||||
> | ||||||
<Container | ||||||
className={cx( | ||||||
"w-100", | ||||||
"d-flex", | ||||||
"justify-content-between", | ||||||
"align-items-center" | ||||||
)} | ||||||
> | ||||||
<div className="d-none d-sm-block d-lg-none"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<img | ||||||
src={themeAssets[theme].dotsImgUrl} | ||||||
className={cx("img-fluid", "object-fit-cover")} | ||||||
style={{ width: "83px", height: "50px" }} | ||||||
alt="Small image" | ||||||
/> | ||||||
</div> | ||||||
<div className="d-none d-lg-block"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<img | ||||||
src={themeAssets[theme].dotsImgUrl} | ||||||
className="img-fluid" | ||||||
alt="Full image" | ||||||
style={{ height: "50px" }} | ||||||
/> | ||||||
</div> | ||||||
<div | ||||||
className={cx( | ||||||
"d-flex", | ||||||
"gap-3", | ||||||
"align-items-center", | ||||||
"flex-column", | ||||||
"flex-md-row" | ||||||
)} | ||||||
> | ||||||
<img | ||||||
src={themeAssets[theme].logoImgUrl} | ||||||
alt="Renku 2.0" | ||||||
height="25" | ||||||
/> | ||||||
<h5 className="mt-1 mb-0">EARLY ACCESS!</h5> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</div> | ||||||
<div | ||||||
className={cx( | ||||||
"d-flex", | ||||||
"gap-3", | ||||||
"align-items-center", | ||||||
"flex-column", | ||||||
"flex-md-row" | ||||||
)} | ||||||
> | ||||||
{callToActionBtn} | ||||||
<Link | ||||||
to={Links.RENKU_2_LEARN_MORE} | ||||||
className={themeAssets[theme].linkStyle} | ||||||
rel="noreferrer noopener" | ||||||
target="_blank" | ||||||
> | ||||||
Learn more | ||||||
</Link> | ||||||
</div> | ||||||
</Container> | ||||||
</Alert> | ||||||
); | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
img { | ||
height: 150px; | ||
object-position: top; | ||
|
||
@include media-breakpoint-up(md) { | ||
height: 180px; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.EarlyAccessBadge { | ||
background-color: #ca4e86 !important; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image seems higher than necessary, with some empty space at the bottom. Since it is scaled with the current solution, should we remove the bottom empty space and use an SVG instead?
P.S. About the scaling, the dots are small on smaller screens; while enlarging the window, they get big, then smaller again, and then gradually bigger (see gif). Is that intended? I think we should either scale them gradually or fix two/three sizes, but not mix the two styles (low priority).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, let's keep this for later