-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): change
Share
icon and improve layout of item header actio…
…ns (#566) chore: improve layout of item header actions chore: use smaller sized favorite icon in item actions and bigger sized icon in item card
- Loading branch information
Showing
27 changed files
with
1,080 additions
and
1,088 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ | |
"@graasp/chatbox": "1.0.3", | ||
"@graasp/query-client": "0.2.1", | ||
"@graasp/sdk": "0.4.1", | ||
"@graasp/translations": "1.3.0", | ||
"@graasp/ui": "0.11.1", | ||
"@graasp/translations": "1.5.0", | ||
"@graasp/ui": "0.13.0", | ||
"@mui/icons-material": "5.11.0", | ||
"@mui/lab": "5.0.0-alpha.117", | ||
"@mui/material": "5.11.6", | ||
|
@@ -72,7 +72,7 @@ | |
"dist": "env-cmd -f ./.env.production react-app-rewired build", | ||
"dist:dev": "env-cmd -f ./.env.development react-app-rewired build", | ||
"eject": "react-scripts eject", | ||
"lint": "eslint .", | ||
"lint": "eslint --resolve-plugins-relative-to .", | ||
"type-check": "tsc --noEmit", | ||
"check": "yarn prettier:check && yarn lint && yarn type-check", | ||
"prettier:check": "prettier --check src/**/*.{js,ts,tsx,json}", | ||
|
@@ -87,9 +87,6 @@ | |
"release:major": "standard-version -a --release-as major", | ||
"release:patch": "standard-version -a --release-as patch" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
|
@@ -122,8 +119,8 @@ | |
"@types/react": "^17.0.2", | ||
"@types/react-dom": "^17.0.2", | ||
"@types/uuid": "9.0.0", | ||
"@typescript-eslint/eslint-plugin": "5.51.0", | ||
"@typescript-eslint/parser": "5.51.0", | ||
"@typescript-eslint/eslint-plugin": "^5.5.0", | ||
"@typescript-eslint/parser": "^5.5.0", | ||
"concurrently": "7.6.0", | ||
"cypress": "12.6.0", | ||
"cypress-localstorage-commands": "2.2.2", | ||
|
@@ -147,19 +144,11 @@ | |
"wait-on": "7.0.1" | ||
}, | ||
"resolutions": { | ||
"@graasp/sdk": "0.4.1", | ||
"@graasp/ui": "0.11.1", | ||
"@mui/icons-material": "5.11.0", | ||
"@mui/material": "5.11.6", | ||
"ansi-html": "0.0.8", | ||
"browserslist": "4.16.5", | ||
"glob-parent": "5.1.2", | ||
"i18next": "21.8.1", | ||
"immer": "9.0.6", | ||
"immutable": "4.2.4", | ||
"node-forge": "1.3.0", | ||
"nth-check": "2.0.1", | ||
"react-error-overlay": "6.0.9" | ||
"@svgr/webpack": "6.5.1" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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,37 @@ | ||
import EditIcon from '@mui/icons-material/Edit'; | ||
import { IconButton, Tooltip } from '@mui/material'; | ||
|
||
import { BUILDER } from '@graasp/translations'; | ||
|
||
import { useBuilderTranslation } from '../../config/i18n'; | ||
import { buildEditButtonId } from '../../config/selectors'; | ||
import { useLayoutContext } from '../context/LayoutContext'; | ||
|
||
type Props = { | ||
itemId: string; | ||
}; | ||
|
||
const EditItemCaptionButton = ({ itemId }: Props): JSX.Element => { | ||
const { t: translateBuilder } = useBuilderTranslation(); | ||
const { setEditingItemId } = useLayoutContext(); | ||
|
||
const onClick = () => { | ||
setEditingItemId(itemId); | ||
}; | ||
|
||
return ( | ||
<Tooltip title={translateBuilder(BUILDER.EDIT_BUTTON_TOOLTIP)}> | ||
<span> | ||
<IconButton | ||
aria-label="edit" | ||
onClick={onClick} | ||
id={buildEditButtonId(itemId)} | ||
> | ||
<EditIcon /> | ||
</IconButton> | ||
</span> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default EditItemCaptionButton; |
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,43 @@ | ||
import InfoIcon from '@mui/icons-material/Info'; | ||
import { IconButton, Tooltip } from '@mui/material'; | ||
|
||
import { BUILDER } from '@graasp/translations'; | ||
|
||
import { useBuilderTranslation } from '../../config/i18n'; | ||
import { | ||
ITEM_INFORMATION_BUTTON_ID, | ||
ITEM_INFORMATION_ICON_IS_OPEN_CLASS, | ||
} from '../../config/selectors'; | ||
import { useLayoutContext } from '../context/LayoutContext'; | ||
|
||
const ItemMetadataButton = (): JSX.Element => { | ||
const { t: translateBuilder } = useBuilderTranslation(); | ||
const { | ||
isItemMetadataMenuOpen, | ||
setIsItemMetadataMenuOpen, | ||
setIsChatboxMenuOpen, | ||
} = useLayoutContext(); | ||
|
||
const onClick = () => { | ||
setIsItemMetadataMenuOpen(!isItemMetadataMenuOpen); | ||
setIsChatboxMenuOpen(false); | ||
}; | ||
|
||
return ( | ||
<Tooltip title={translateBuilder(BUILDER.ITEM_METADATA_TITLE)}> | ||
<span> | ||
<IconButton | ||
id={ITEM_INFORMATION_BUTTON_ID} | ||
onClick={onClick} | ||
className={ | ||
isItemMetadataMenuOpen ? ITEM_INFORMATION_ICON_IS_OPEN_CLASS : '' | ||
} | ||
> | ||
<InfoIcon /> | ||
</IconButton> | ||
</span> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default ItemMetadataButton; |
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
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.