-
Notifications
You must be signed in to change notification settings - Fork 2
Standardize widget back button and remove kyper ChevronLeft icon #358
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
42ee6d4
migrated ChevronLeft kyper
a767a3e
feat: use one back button accross the widget for consistency
0dde168
fixed failing test
6c5b0e2
fixing a bug with showMobileBackButton
1c3346f
remove unused code
308850a
using Stack for spacing
0fa0536
add back button component styles
2412ebc
renamed GobackButton to GoBackButtonHeader
562ff92
fixed the import
74c9201
moved and renamed the test file
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .toolbar.toolbar:global(.MuiToolbar-root) { | ||
| left: 50%; | ||
| transform: translateX(-50%); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .textGroup:global(.MuiStack-root) { | ||
| margin-bottom: var(--spacing-3); | ||
| } | ||
|
|
||
| .button:global(.MuiButton-root) { | ||
| width: 14.25%; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
15 changes: 9 additions & 6 deletions
15
...omponents/__tests__/GoBackButton-test.tsx → src/components/GoBackButtonHeader-test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| .container:global(.MuiBox-root) { | ||
| flex-grow: 1; | ||
| } | ||
|
|
||
| .appBar:global(.MuiAppBar-root) { | ||
| background-color: var(--mui-palette-background-paper); | ||
| display: flex; | ||
| } | ||
|
|
||
| .toolbar:global(.MuiToolbar-root) { | ||
| left: 0; | ||
| max-width: 368px; | ||
| transform: translateX(-10%); | ||
| } | ||
|
|
||
| .button:global(.MuiIconButton-root) { | ||
| color: var(--mui-palette-text-primary); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import React, { forwardRef, useRef } from 'react' | ||
| import { AppBar, Box, IconButton, Toolbar } from '@mui/material' | ||
| import { Icon } from '@mxenabled/mxui' | ||
| import clsx from 'clsx' | ||
|
|
||
| import { __ } from 'src/utilities/Intl' | ||
|
|
||
| import styles from 'src/components/GoBackButtonHeader.module.css' | ||
|
|
||
| interface GoBackButtonProps { | ||
| handleGoBack: () => void | ||
| shouldShowBackButton?: boolean | ||
| toolbarClassName?: string | ||
| } | ||
|
|
||
| export const GoBackButtonHeader = forwardRef<HTMLButtonElement, GoBackButtonProps>((props, ref) => { | ||
| const defaultRef = useRef(null) | ||
| const { handleGoBack, shouldShowBackButton = true, toolbarClassName } = props | ||
|
|
||
| return ( | ||
| <Box className={styles.container} data-test="navigation-header"> | ||
| <AppBar className={styles.appBar} elevation={0} position="static"> | ||
| <Toolbar className={clsx(styles.toolbar, toolbarClassName)}> | ||
| {shouldShowBackButton ? ( | ||
| <IconButton | ||
| aria-label={__('Go Back')} | ||
| className={styles.button} | ||
| data-test="back-button" | ||
| name="connect-navigation-back-button" | ||
| onClick={handleGoBack} | ||
| ref={ref ?? defaultRef} | ||
| > | ||
| <Icon name="arrow_back_ios_new" size={24} /> | ||
| </IconButton> | ||
| ) : null} | ||
| </Toolbar> | ||
| </AppBar> | ||
| </Box> | ||
| ) | ||
| }) | ||
|
|
||
| GoBackButtonHeader.displayName = 'GoBackButtonHeader' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.