Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Make dialog's header compatible with RTL layout #8231

Closed
wants to merge 8 commits into from
Closed

Make dialog's header compatible with RTL layout #8231

wants to merge 8 commits into from

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Apr 5, 2022

Signed-off-by: Suguru Hirahara luixxiul@users.noreply.github.com

Cherry-picked from #8217

This PR makes the dialog's header compatible with a RTL (Right-To-Left) layout, by including the close button into the flexbox which automatically takes care of the direction of child elements. The button will be placed 3px (magic number) above the first baseline.

Current implementation

Image 1 (Left-To-Right layout with one line title)
before

Image 2 (Left-To-Right layout with two lines title)
before1

Image 3 (Right-to-Left layout with one line title)
before2

The button should be placed on the left side.

With this PR:

Image 4 (Left-To-Right layout with one line title)
after3

Image 5 (Left-To-Right layout with two lines title)
after4

Image 6 (Right-to-Left layout with one line title)
after5

Image 7 (Right-to-Left layout with two lines title)
after2

Image 8 (InvitationDialog's header in Hebrew)
after

Image 9 (the header with mx_Dialog_headerWithButton emulated)
after

The title text is placed at the center as expected.

type: task


This change is marked as an internal change (Task), so will not be included in the changelog.

Preview: https://pr8231--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
@luixxiul luixxiul requested a review from a team as a code owner April 5, 2022 10:20
@github-actions github-actions bot added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Apr 5, 2022
@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #8231 (278d61c) into develop (cdb0c2c) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##           develop    #8231   +/-   ##
========================================
  Coverage    29.25%   29.25%           
========================================
  Files          863      863           
  Lines        49876    49876           
  Branches     12696    12696           
========================================
  Hits         14592    14592           
  Misses       35284    35284           
Impacted Files Coverage Δ
src/components/views/dialogs/BaseDialog.tsx 53.57% <ø> (ø)
src/components/views/dialogs/HostSignupDialog.tsx 0.00% <0.00%> (ø)

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
.mx_Dialog_cancelButton is used on BaseDialog.tsx and HostSignupDialog.tsx.
Both cases the button is placed inside .mx_Dialog_header.

See: _LocationViewDialog.scss, where .mx_Dialog_cancelButton is nested under .mx_Dialog_header.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
@luixxiul luixxiul marked this pull request as draft April 10, 2022 04:13
@luixxiul
Copy link
Contributor Author

The close button should be dependent on the dialog itself rather than the title as theoretically there would be a case where something such as an image could be placed above the title, so placing the button with position: absolute should be preferred. Closing as #8217 should take care of it.

@luixxiul luixxiul closed this Apr 10, 2022
@luixxiul luixxiul deleted the rtl-pick-2 branch April 10, 2022 04:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant