-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reposition panels in a single-column translate view (#3038)
Details: * Only show one Helpers panel at the same time * Use dot rather than count as the tab indicator * Make visual distinction between the History panel and the Helpers. * Add support for batch actions in the single-columm UI Also included: * Move OriginalString component and friends out of Metadata component * Unify Term tab count behaviour with other Helper tabs: do not show 0 * Unify dark-theme.css and light-theme.css structure * De-hardcode and fix color value in the FiltersPanel
- Loading branch information
Showing
17 changed files
with
386 additions
and
122 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,21 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
const NARROW_SCREEN_MAX_WIDTH = 600; | ||
|
||
/** | ||
* Return true if the screen is narrower than 600px. Useful in Responsive Web Design. | ||
*/ | ||
export function useNarrowScreen(): boolean { | ||
const [isNarrow, setIsNarrow] = useState( | ||
window.innerWidth <= NARROW_SCREEN_MAX_WIDTH, | ||
); | ||
|
||
useEffect(() => { | ||
const handleWindowResize = () => | ||
setIsNarrow(window.innerWidth <= NARROW_SCREEN_MAX_WIDTH); | ||
window.addEventListener('resize', handleWindowResize); | ||
return () => window.removeEventListener('resize', handleWindowResize); | ||
}, []); | ||
|
||
return isNarrow; | ||
} |
This file contains 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 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 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 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 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 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.