Skip to content
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

Fix/logos #1097

Merged
merged 8 commits into from
Jun 11, 2024
Merged

Fix/logos #1097

merged 8 commits into from
Jun 11, 2024

Conversation

BeritJanssen
Copy link
Collaborator

This branch ensures that logos will be displayed correctly, i.e., centered and big on the dashboard, and smaller top-left for the experiments (these would require defining separate themes for now).

@BeritJanssen BeritJanssen marked this pull request as draft June 11, 2024 12:17
@BeritJanssen BeritJanssen marked this pull request as ready for review June 11, 2024 12:39
@BeritJanssen BeritJanssen requested a review from drikusroor June 11, 2024 12:39
Copy link
Contributor

@drikusroor drikusroor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I had some questions and remarks but I'll let you decide what to do with them :-)

Comment on lines 15 to 18
@media (max-width: 500px) {
margin-left: 10px;
height: $logo-height-mobile;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would develop mobile-first and then use min-width to make exceptions for larger devices instead of vice versa.

color: transparent;
width: 30%;

@media (max-width: 500px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are using a breakpoint of 500px here. I just checked and found that MUSCLE's codebase now has breakpoints of 320, 350, 420, 500, 520, and 720 px.

First of all, I think that's an excessive amount. Maybe we can simplify that in the future and have only 2-3, maybe 4 breakpoints max.

Second, we already have breakpoints defined in variables.scss. Why not use those or add the ones you are using here?

// breakpoints
$breakpoint-xs: 0;
$breakpoint-sm: 576px;
$breakpoint-md: 768px;
$breakpoint-lg: 992px;
$breakpoint-xl: 1200px;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree that we should clean this up. I copied and pasted this breakpoint from former code. I'll see about reusing the breakpoint from variables here instead.

.aha__dashboard {

.aha__logo {
margin-left: 35%;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for using a percentage as margin? Should it scale with device width?

Comment on lines +42 to +43
'logoUrl': f'{settings.BASE_URL.strip("/")}/{settings.MEDIA_URL.strip("/")}/{str(theme.logo_image.file)}' if theme.logo_image else None,
'backgroundUrl': f'{settings.BASE_URL.strip("/")}/{settings.MEDIA_URL.strip("/")}/{str(theme.background_image.file)}' if theme.background_image else None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you use the serialize_image method like in the other PRs of today?

def serialize_image(image: Image) -> dict:
return {
'file': f'{settings.BASE_URL.strip("/")}/{settings.MEDIA_URL.strip("/")}/{image.file}',
'href': image.href,
'alt': image.alt,
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, that's 100% the better way, yes. For now, the frontend changes involved to adapt to the objects here are kind of daunting (especially to use the href defined in the images).

@BeritJanssen BeritJanssen self-assigned this Jun 11, 2024
@BeritJanssen BeritJanssen merged commit 3f63cc4 into develop Jun 11, 2024
10 checks passed
@BeritJanssen BeritJanssen deleted the fix/logos branch June 11, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants