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

Fixes margin for the sidebar menus while using rtl languages #15471

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

Godmartinz
Copy link
Collaborator

Description

This makes the icons of the sidebar menu centered again while using Right to Left languages.

image

Fixes #[sc-26688]

Type of change

Please delete options that are not relevant.

  • [x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • PHP version:
  • MySQL version
  • Webserver version
  • OS version

Checklist:

Copy link

what-the-diff bot commented Sep 9, 2024

PR Summary

  • Improved User Experience for RTL Languages
    A condition has been included in the main layout template that checks which language is being used by the user, and if the language is Right-to-Left (RTL), it adjusts the style of the sidebar menu accordingly to ensure a consistent and seamless user experience.

Copy link
Owner

@snipe snipe left a comment

Choose a reason for hiding this comment

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

Can we make this a ternary instead?

@Godmartinz Godmartinz changed the title fixes margin for the sidebar menus while using rtl languages Fixes margin for the sidebar menus while using rtl languages Sep 9, 2024
@Godmartinz Godmartinz requested a review from snipe September 9, 2024 20:10
@@ -426,7 +426,7 @@
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree">
<ul class="sidebar-menu" data-widget="tree" style="margin-right: {{ \App\Helpers\Helper::determineLanguageDirection() === 'rtl' ? '12px' : '0px' }};">
Copy link
Owner

Choose a reason for hiding this comment

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

I'd probably do something like this:

{{ \App\Helpers\Helper::determineLanguageDirection() == 'rtl' ? 'style="margin-right:12px' : '' }};"

No need to specify a margin at all if rtl isn't true, and this could have other layout effects if we specify it.

@snipe snipe merged commit fe5fc6e into snipe:develop Sep 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants