EnxDev commented on code in PR #37304:
URL: https://github.com/apache/superset/pull/37304#discussion_r2714328141
##########
superset-frontend/src/components/ListView/ListView.tsx:
##########
@@ -197,32 +198,40 @@ const ViewModeToggle = ({
}: {
mode: 'table' | 'card';
setMode: (mode: 'table' | 'card') => void;
-}) => (
- <ViewModeContainer>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('card');
- }}
- className={cx('toggle-button', { active: mode === 'card' })}
- >
- <Icons.AppstoreOutlined iconSize="xl" />
- </div>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('table');
- }}
- className={cx('toggle-button', { active: mode === 'table' })}
- >
- <Icons.UnorderedListOutlined iconSize="xl" />
- </div>
- </ViewModeContainer>
-);
+}) => {
+ const gridTitle = t('Grid view');
+const listTitle = t('List view');
+ return (
+ <ViewModeContainer>
+ <Tooltip title={gridTitle}>
+ <div
+ role="button"
+ tabIndex={0}
+ onClick={e => {
+ e.currentTarget.blur();
+ setMode('card');
+ }}
+ className={cx('toggle-button', { active: mode === 'card' })}
+ >
+ <Icons.AppstoreOutlined iconSize="xl" />
+ </div>
+ </Tooltip>
+ <Tooltip title={listTitle}>
Review Comment:
```suggestion
<Tooltip title={t('List view')}>
```
##########
superset-frontend/src/components/ListView/ListView.tsx:
##########
@@ -197,32 +198,40 @@ const ViewModeToggle = ({
}: {
mode: 'table' | 'card';
setMode: (mode: 'table' | 'card') => void;
-}) => (
- <ViewModeContainer>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('card');
- }}
- className={cx('toggle-button', { active: mode === 'card' })}
- >
- <Icons.AppstoreOutlined iconSize="xl" />
- </div>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('table');
- }}
- className={cx('toggle-button', { active: mode === 'table' })}
- >
- <Icons.UnorderedListOutlined iconSize="xl" />
- </div>
- </ViewModeContainer>
-);
+}) => {
+ const gridTitle = t('Grid view');
+const listTitle = t('List view');
Review Comment:
```suggestion
```
##########
superset-frontend/src/components/ListView/ListView.tsx:
##########
@@ -197,32 +198,40 @@ const ViewModeToggle = ({
}: {
mode: 'table' | 'card';
setMode: (mode: 'table' | 'card') => void;
-}) => (
- <ViewModeContainer>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('card');
- }}
- className={cx('toggle-button', { active: mode === 'card' })}
- >
- <Icons.AppstoreOutlined iconSize="xl" />
- </div>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('table');
- }}
- className={cx('toggle-button', { active: mode === 'table' })}
- >
- <Icons.UnorderedListOutlined iconSize="xl" />
- </div>
- </ViewModeContainer>
-);
+}) => {
+ const gridTitle = t('Grid view');
+const listTitle = t('List view');
+ return (
+ <ViewModeContainer>
+ <Tooltip title={gridTitle}>
Review Comment:
```suggestion
<Tooltip title={t('Grid view')}>
```
##########
superset-frontend/src/components/ListView/ListView.tsx:
##########
@@ -197,32 +198,40 @@ const ViewModeToggle = ({
}: {
mode: 'table' | 'card';
setMode: (mode: 'table' | 'card') => void;
-}) => (
- <ViewModeContainer>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('card');
- }}
- className={cx('toggle-button', { active: mode === 'card' })}
- >
- <Icons.AppstoreOutlined iconSize="xl" />
- </div>
- <div
- role="button"
- tabIndex={0}
- onClick={e => {
- e.currentTarget.blur();
- setMode('table');
- }}
- className={cx('toggle-button', { active: mode === 'table' })}
- >
- <Icons.UnorderedListOutlined iconSize="xl" />
- </div>
- </ViewModeContainer>
-);
+}) => {
+ const gridTitle = t('Grid view');
Review Comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]